This change refactors the following files:
1. test_imagearraycopy.cpp
2. test_arrayimagecopy.cpp
The purpose of refactoring is to allow passing different buffer and
image flags to the test function as well as passing customisable test
functions.
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Fixes narrowing conversion build errors in test_common
Removing disable of narrowing errors in main CMakeLists.txt
and moving it down to specific test_conformance suite's
CMakeLists.txt where there are many more build errors revealed
from this fix.
Fixes a few simple issues under test_conformance in the process.
Contributes #787
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
---------
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
Basic explicit_s2v:
The verification step was always using round to even when converting a
float to half even for round to zero cores.
Commonfns degrees:
The verification step was only taking into account infinities and not
values that over/underflow. This resulted in an incorrect error
calculation. E.g:
double cpu_result = 175668.85998711039;
cl_half gpu_result = 31743; // this is 65504 when converting to float,
we overflowed.
float error = (cpu_result - gpu_result) * some_factor;
The fix adds the check if( (cl_half) reference == test ) before
calculating the error.
Merge image_array_copy, image_array_copy3d
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>
CL_DEVICE_MAX_WORK_GROUP_SIZE is specified to fill in a size_t. By
asking it to fill in an uninitialised cl_long, on platforms where size_t
is smaller than cl_long, the high bits of the cl_long remain
uninitialised.
* Added cl_khr_fp16 support for test_explicit_s2v from basic (issue #142, basic)
* Cosmetic corrections
* cosmetic fix
* Added correction to distinguish signed and unsigned char types for ARM architecture tests
* Added missing pieces of convertion procedure to support half
* Corrected condition to verify if additional pragma is necessary (issue #142, basic)
* Add NaN check for half to float conversion
* check-format fixes
* Add NaN check for all float types
Use std::isnan for float/double types.
Change-Id: I005bddccaa3f8490ac59b2aa431ed315733ad143
* Fix Ubuntu build error with isnan macro definition
Change-Id: I671ed826a9631fbbc66d0aa9b674ab00124c7967
* Check format fixes
* NAN define not needed anymore
---------
Co-authored-by: Vasu Penugonda <vpenugon@qti.qualcomm.com>
Co-authored-by: Sreelakshmi Haridas <sharidas@quicinc.com>
Only disable `-Wsign-compare` for tests that do not compile cleanly
with this warning enabled. Re-enable the warning for the other tests,
so that it can catch any new occurrences.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Use CTS type wrappers for test_basic test_loop
* Move variable declaration to first use in verify_loop
Signed-off-by: John Kesapides <john.kesapides@arm.com>
With GCC 13 some headers are no longer included transitively through
C++ Standard Library headers.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added cl_khr_fp16 support for test_vloadstore from basic (issue #142, basic)
* Moved string helper procedures due to request from test_commonfns PR #1695
* restored original test sizes
* Corrected invalid initialization of reference buffer
* Added cl_khr_fp16 and cl_khr_fp64 support for float2int and int2float tests from basic
* removed debug output
* Replaced procedure to generate random half values in specific range (issue #142, basic)
* Added cosmetic fixes due to code review comments
* Moved string helper procedures due to request for test_commonfns PR #1695
* Added half and double support for fpmath test from basic (issue #142, basic)
* Cosmetic corrections due to code review
* Removed unnecessary casting
* Added corrections due to code review
* Tuning range of input generation to avoid hitting infinity
* Moved string helpers procedures due to request from test_commonfns PR #1695
Remove the unused `numItems` variable.
As this fixes all occurrences of this warning in test_basic, remove
the suppression flag.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Added cl_khr_fp16 extension support for vector_creation test from basic
* Added corrections related to vendor's review
* Added protection to avoid similar creation cases
* Added comment for recent correction
* cosmetics
* Corrected factor array to restore lost capacity of original test..
leaving only 16-sizes vector tests limited.
The latest version of the cl_khr_extended_async_copies extension uses
element size rather the element type as its base. The means it can be
called with arbitrary and in particular non power of 2 sizes, such as 3
or 13.
Update the test_async_copy2D and test_async_copy3D tests to make them
element size based rather than type based.
As well as this run all tests that can fit into the memory of the
target rather than presumed large elements cannot fit.
Make some addtional good practice changes in terms of const usage,
declaring variables where they are use, and usage of iterators.
The test coverage increases from 1224 cases to 1332 cases for the
test_async_copy2D and test_async_copy3D cases.
Ticket: #1579
Signed-off-by: Chris Gearing <chris.gearing@mobileye.com>
Co-authored-by: Chris Gearing <chris.gearing@mobileye.com>
* Added support for cl_khr_fp16 extenstion in test_astype from basic (issue #142, basic)
* Added correction to iterate over vector of types
* Fixed case with both fp16 and fp64 supported
* Cosmetic corrections due to code review
* Cosmetic corrections due to code review
* Removed hardcoded -cl-std=CL2.0 build option from progvar tests
Fixes issue #1380https://github.com/KhronosGroup/OpenCL-CTS/issues/1380
These changes will query the device for the latest supported CL C
version instead of using a hardcoded value. The create_single_kernel_helper
function queries for the latest CL C version internally, so calls to
create_single_kernel_helper_with_build_options were replaced with calls
to create_single_kernel_helper instead.
* Fixed formatting
Only disable `-Wunused-but-set-variable` for tests that do not compile
cleanly with this warning enabled. This re-enables the warning for
most other tests, so that it can catch any new occurrences.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
To the best of my understanding, these occurrences of the
`-Wunused-but-set` warnings do not reveal any underlying issues, so we
can safely remove these variables. There are more occurrences of this
warning in other places (not touched by this commit) that require
further analysis.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* [NFC] Remove duplicate symbol declarations
Those are provided by testHarness.h.
Signed-off-by: Kévin Petit <kpet@free.fr>
* add missing include
---------
Signed-off-by: Kévin Petit <kpet@free.fr>
There is no particular reason to limit the domain of unsigned 32-bit
integers in the input, so use genrand_int32 directly.
Signed-off-by: Stuart Brady <stuart.brady@arm.com>
Fail when an unhandled image format is encountered instead of
continuing validation with uninitialized variables.
Fixes a `-Wsometimes-uninitialized` warning for e.g. the `tolerance`
variable.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Move functions in .h files to .cpp files where appropriate; align
prototypes and definitions; and remove functions that are not used.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
* Deduplicate write_image
Merge writeimage,writeimage_int16,writeimage_fp32
as they share a lot of common code.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Test for CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE.
Signed-off-by: John Kesapides <john.kesapides@arm.com>
* Rename test_flags to img_flags
Signed-off-by: John Kesapides <john.kesapides@arm.com>
Signed-off-by: John Kesapides <john.kesapides@arm.com>