This PR adds targeted testing for a few remaining miscellaneous SPIR-V
1.4 features:
* Variables in the Function storage class can have a NonWriteable
decoration.
* OpCopyMemorySized can have two optional memory operands.
* OpSelect can have composite operands that are not vectors.
When creating a CL semaphore object from a Vulkan semaphore one, we
explicitly pass `-1` as the file descriptor value in the case of
`VULKAN_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD`. According to the CL
specification:
> The special value -1 for fd is treated like a valid sync file
> descriptor referring to an object that has already signaled. The
> import operation will succeed and the semaphore will have a
> temporarily imported payload as if a valid file descriptor had
> been provided.
The test currently checks that the semaphore payload is unsignalled,
unconditionally, which is incorrect.
Changed the test to check for the correct expected payload value.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
- negative testing for semaphore functions is accomplished in semaphore
tests, as well as create image in the api test
Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
Add coverage to import Vulkan resources (memory and semaphore) in
Windows via named NT handles.
If no name is given during resource creation, then use NT handles for
import.
If a name is given, have an option to either use that name or get the NT
handle and use that for import.
ResolvesKhronosGroup/OpenCL-Docs#943
Current class wrapper of the CTS test framework allows getting the
pointer of the private member object. This puts the object at risk of
losing its original value if the pointer gets reassigned, causing a
memory leak and potentially other problems.
This happens to the "clMemWrapper kernel" used by
mutable_command_work_groups tests, where the "clMemWrapper kernel" gets
initialised by the default basic setup function and then it gets
reassigned by the build_program_create_kernel_helper() helper function
through pointer.
This patch fixes this issue by updating mutable_command_work_groups
tests: instead of calling basic setup function and then initialise the
"clMemWrapper kernel" object again in the helper function, it now
overrides the basic setup function to make sure the "clMemWrapper
kernel" will be assigned only once.
Signed-off-by: Xin Jin <xin.jin@arm.com>
Currently Intel® C++ Compiler Classic (ICC) is supported to build
OpenCL-CTS on Windows. This compiler has been discontinued since the
second half of 2023. Instead, Intel recommends that users transition to
use the LLVM-based Intel® oneAPI DPC++/C++ Compiler (ICX).
This change is to enable users to build OpenCL-CTS with ICX on Windows.
This PR adds targeted testing for more SPIR-V 1.4 features.
Specifically, this PR adds testing for OpDecorateString,
OpMemberDecorateString, and the UserSemantic decoration.
Removes `using namespace std` and adds `std::` explicitly instead, which
is usually on calls to `min`.
This is generally best practice, and it also might be helpful when there
are the same function names in the std namespace and in the global
namespace (e.g. #1833).
Add a `format` parameter to the macro, to be able to specify how to
print the expected and actual parameter values.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
When cl_khr_fp16 is not supported, this property is not available.
Note that the spec is different for
CL_DEVICE_{PREFERRED,NATIVE}_VECTOR_WIDTH_HALF: those properties are
always available and return 0 if cl_khr_fp16 is not supported, so those
checks are left as is.
Fix a "format string is not a string literal (potentially insecure)"
warning.
There is no security issue here as the format string argument is
constructed using a stringstream right before. Fix this occurrence
anyway to allow enabling the warning globally.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
All existing tests in `test_image_streams`, that are capable of testing
image formats using the `CL_UNORM_INT_2_101010_EXT` data type, do so.
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
This test did not pass the `-cl-std=` flag when building the program. As
a result, for an OpenCL 3.0 device, the program will be "compiled using
the highest OpenCL C 1.x language version supported" by the device.
However this will force uniform work-group sizes which leads to a
`CL_INVALID_WORK_GROUP_SIZE` error.
To fix this, use the `create_single_kernel_helper()` helper function
which will automatically get the device version and pass that to
`-cl-std=` when building the program.
---------
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
When importing a Vulkan external image, query and
pass OpenCL a row pitch if OpenCL is assuming linear for the imported
external handle type. Additionally fix a bug where OpenCL is being told
to create mipmapped images at all times.
---------
Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for the NoSignedWrap and NoUnsignedWrap
decorations.
We can reuse large parts of the testing for the
`cl_khr_spirv_no_integer_wrap_decoration` extension to test the SPIR-V
1.4 feature.
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for:
1. The new Image Operand for SignExtend and ZeroExtend.
2. The new Loop Controls MinIterations, MaxIterations,
IterationMultiple, PeelCount, and PartialCount.
Commit b6941b6c ("Add fp16 testing to conversions and bruteforce
(#1975)", 2024-06-18) introduced a behavioural change for non-half
tests. The `-cl-denorms-are-zero` option could be added for non-half
tests such as `char_rtn_float` even when `gForceFTZ` was `false`. Fix
the condition by also taking the input and output types into account.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
Following the re-enablement of narrowing warnings, this fixes a
compilation error when running the `ubuntu 22.04 arm` GitHub action.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
The extension tests in `test_conformance/extensions` have not matching
entries in the `opencl_conformance_tests_*.csv` files. This means that
they are missed from conformance runs by vendors who use these files.
I've included the new extensions in the full and quick CSV files as they
don't have vast combinations of tests to run like bruteforce or
conversions.
I've put `cl_khr_dx9_media_sharing` in the
`test_conformance/opencl_conformance_tests_d3d.csv` CSV as like the
other tests there the test binary is conditional built only on a Windows
platform.
I've created a new `opencl_conformance_tests_vulkan.csv ` file for
testing the `cl_khr_external_semaphore` extension, as creation of the
binary is conditional on the Vulkan SDK being enabled environment. Any
other tests that require the Vulkan SDK in future can also be added
there.
some fixes we've been carrying in our CTS fork:
* fix UB in `command_buffer_event_sync.cpp`: enqueue of two commands in
two separate queues, with both using the same buffer argument, and no
synchronization between the commands.
* fix UB in `command_buffer_test_barrier.cpp`: missing synchronization
between zeroing command and command-buffer using two separate queues
* make `test_thread_dimensions.cpp` thread-safe to avoid spurious
errors.
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>
Replace the occurrences of 0.0f == test' with 0.0f == HTF(test)'. The
types of 0.0f and test are not the same, so the equality comparison will
get undesired result when the test represents a -0.0h (i.e., test is
32768=0x8000). In this situation, 0.0f == test will be false, but 0.0f
== HTF(test) will be true.
Revise each if-statement to match the OpenCL s7.5.3 Item 4, specifically
modify to check that the result is subnormal instead of checking that it
is zero. "If the result of 3. is a sub-normal before rounding, the
result may be flushed to zero"
Co-authored-by: tnimburk <tnimburk@qti.qualcomm.com>
Comparing test (of type cl_half) with 0.0f is incorrect because cl_half
is a typedef of uint16_t (or unsigned short in c)
Co-authored-by: Tejswini Nimburkar <tnimburk@qti.qualcomm.com>
fixes several issues:
* `generic_address_space` test: add check for program scope variables.
The test uses both generic AS and program-scope variables, however it
only checked the generic-AS presence in `clGetDeviceInfo`.
* `compiler/test_compiler_defines_for_extensions.cpp`: add
`cl_khr_command_buffer_multi_device` to the list of recognized
extensions
* `command_buffer_event_sync.cpp`: add delays for testing
`clSetEventCallback` - according to specification, these can be executed
asynchronously (in a separate thread) by the OpenCL implementation,
hence the event callback is not quaranteed to be called before
`clFinish()` returns. Existing test `events/test_callbacks.cpp` also
waits for callback with loops of usleep.
* `images/kernel_image_methods/test_1D_buffer.cpp`: fix allocation size
being too small for the 1D buffer backing the image
---------
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
It was disabled because lack of reference implementation. However the
reference implementation exists. Then no reason to start testing these
functions.
Adds test to confirm that the timestamp returned from
clGetEventProfilingInfo for an event on a device and a device
timestamp queried from the same device are in the same timebase.
Fixes#753
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>
---------
Signed-off-by: Ellen Norris-Thompson <ellen.norris-thompson@arm.com>