This change provides partial test coverage for
KhronosGroup/OpenCL-Docs#1280
Adding CTS tests for:
1. clEnqueueMapBuffer, clEnqueueMapImage.
2. Command buffer negative tests.
3. clSetKernelArgs negative tests.
The bulk of the tests is to make sure that the CL driver does not allow
writing to a memory object that is created with `CL_MEM_IMMUTABLE_EXT`
flag when used with the above APIs.
---------
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Fix all `-Wformat` warnings in the basic test suite, and re-enable the
warning.
---------
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Fix warnings such as:
test_vloadstore.cpp:330:49: error: format string is not a string literal
(potentially insecure)
There were no security issues here as the format string arguments do not
contain any conversion specifiers and are never written to. Make that
latter fact explicit to avoid the warnings.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This PR fixes the validation logic for cases where the data type is not
half. Because the variable nan_test is always false, types like float
never trigger a validation failure.
This commit links to issue (#2234).
When cross-compiling for AArch64, using gcc 13.3, you encounter three
warnings types that turn into errors:
- maybe-uninitialized
- stringop-truncation
- strict-aliasing
This commit fixes all the warnings found, in regards to the first two
rules. To resolve the warnigns due to strict-aliasing, I am editing the
CMake build system.
Signed-off-by: Antonios Christidis <a-christidis@ti.com>
Move the global `-Wno-format` compiler option to the individual tests
that still trigger Wformat warnings. The majority of the tests now
compile cleanly with `-Wformat` enabled.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This change addresses a free function mis-match issue where `delete` is
used to free memory allocated via `malloc` within `create_random_data`
and in the test function.
The change involves the following tests:
1. arrayimagecopy
2. arrayimagecopy3d
3. imagearraycopy
4. imagearraycopy3d
This should address #2173
Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
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