Commit Graph

1682 Commits

Author SHA1 Message Date
Ben Ashbaugh
2d538182ff SVM tests where the size is zero (#2431)
Here are some tests to check how SVM APIs behave when the size is zero,
see:

* https://github.com/KhronosGroup/OpenCL-Docs/issues/1403

These tests don't fail right now if some of the calls are unsuccessful.
This ensures that all sub-tests run on a given implementation.
2025-11-18 10:20:37 -08:00
Ben Ashbaugh
54008fbf84 Merge branch 'main' into cl_khr_unified_svm 2025-11-06 14:34:30 -08:00
Ben Ashbaugh
e641de99a5 add test for a NULL local work size and a required work-group size (#2514)
see #2501 

This tests the following scenarios:

1. Execute a kernel with a required work-group size, passing `NULL` as
the local work size.
2. Query the suggested work-group size for a kernel with a required
work-group size.
2025-11-04 08:50:30 -08:00
gorazd-sumkovski-arm
9abcd0054c Add ThreadSanitizer option (#2560)
Add the `SANITIZER_THREAD` CMake option which will add the
`-fsanitize=thread` flag to the compiler and linker when enabled.
2025-11-04 08:44:31 -08:00
Marcin Hajder
941f7edb95 Added coverage of using multiple kernels created from the same source program with different builds (#2537)
Fixes #2164 according to issue description
2025-11-04 08:41:26 -08:00
Ahmed Hesham
ba991c0152 Add negative test for AHB (#2539)
Add a wrapper around AHB for proper resource deallocation and refactor
existing tests to use the wrapper.
Add a negative test for AHB to test for error codes when calling
clCreateImageWithProperties and clCreateBufferWithProperties.

---------

Signed-off-by: Alex Davicenko <alex.davicenko@arm.com>
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Co-authored-by: Alex Davicenko <alex.davicenko@arm.com>
2025-10-28 23:00:30 +05:30
Ahmed
c6e0f416e7 Specify memory scope and memory order for the atomic operations in generic_address_space generic_atomics_variant generic_atomics_invariant (#2550)
Use the explicit version of the atomic_load/store and atomic_fetch_add
with memory order relaxed and memory scope workgroup to allow devices
that only support the minimum CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES which
are (CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP)
to run the tests.

The test should only require the relaxed ordering and memory scope
workgroup anyway.

From the specificiation:

"The non-explicit atomic_store function requires support for OpenCL C
2.0, or OpenCL C 3.0 or newer and both the
__opencl_c_atomic_order_seq_cst and __opencl_c_atomic_scope_device
features"

"The non-explicit atomic_load function requires support for OpenCL C 2.0
or OpenCL C 3.0 or newer and both the __opencl_c_atomic_order_seq_cst
and __opencl_c_atomic_scope_device features."

"The non-explicit atomic_fetch_key functions require support for OpenCL
C 2.0, or OpenCL C 3.0 or newer and both the
__opencl_c_atomic_order_seq_cst and __opencl_c_atomic_scope_device
features."
2025-10-28 09:04:51 -07:00
Sergiu Bogdan Popescu
d63cc8ce5d Modified kernel code to correspond to the Image declared format (CL_UNSIGNED_INT8) (#2512)
**For mutable_dispatch_image_1d_arguments &
mutable_dispatch_image_2d_arguments:**
As the images are created using CL_UNSIGNED_INT8, the kernel does not
use correct instructions, as they are designed for signed variable. This
fix consists of modifying the kernel code to use unsigned instructions
and auxiliary variables .
2025-10-28 09:01:42 -07:00
Jose Lopez
580fde7501 Replace unique_ptr for vectors in atomics_indexed_cases (#2557)
Use vectors instead of unique_ptr for buffers data
2025-10-28 08:55:41 -07:00
Jose Lopez
16cd0afe4f Add case for clSetKernelExecInfo with empty set (#2551)
Adds a special case to ensure that calling `clSetKernelExecInfo` with
`CL_KERNEL_EXEC_INFO_SVM_PTRS` and an empty set of pointers is valid
2025-10-28 08:54:41 -07:00
Daniel Crawley
39f961b71f Match spv and api version for Vulkan test (#2536)
- Vulkan api version is 1_1, so target env for shaders should be
vulkan1.1
2025-10-28 08:53:54 -07:00
Ahmed
1a4862e84e Use a more genuine kernel for the command buffer device enqueue negative test (#2532)
The current one has no arguments and does not enqueue any work.
2025-10-28 08:50:08 -07:00
Sreelakshmi Haridas Maruthur
74ebc67294 Fix channel count for RGBx (#2493)
RGBx is defined as a 4 channel format where the 4th channel is ignored
(5.3.1.1)
2025-10-28 08:49:14 -07:00
Marcin Hajder
d0aa95be2f Added support for cl_ext_float_atomics in CBasicTestFetchSub with atomic_float (#2367)
Related to #2142, according to the work plan, extending
CBasicTestFetchSub with support for atomic_float.
2025-10-28 08:41:24 -07:00
Marcin Hajder
52ba127f79 Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_double (#2361)
Related to #2142, according to the work plan, extending
CBasicTestFetchMin/CBasicTestFetchMax with support for atomic_double.
2025-10-28 08:40:13 -07:00
Marcin Hajder
62972418c3 Added support for cl_ext_float_atomics in CBasicTestFetchAdd with atomic_half (#2350)
Related to https://github.com/KhronosGroup/OpenCL-CTS/issues/2142,
according to the work plan, extending CBasicTestFetchAdd with support
for atomic_half.

I wasn't able to test that PR completely due to missing
`CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT`/`CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT`
capabilities for atomic_half. I appreciate reviewers' attention, thanks.
2025-10-22 07:01:48 -07:00
Xin Jin
79d98433cc Fix release call in AHB image read test (#2548)
Ensure clEnqueueReleaseExternalMemObjectsKHR targets imported_image
instead of the non-external opencl_image, matching the prior acquire
call.

Signed-off-by: Xin Jin <xin.jin@arm.com>
2025-10-21 18:40:35 +01:00
Ahmed
a1d8c3e419 Remove spir half vloada_half tests as this builtin does not exist in OpenCL (#2552)
The test was using vloada_half which does not exist for scalars.

Also removed the files test.vloada_half_*.* from half.zip.

For test.vloada_half3_global, changed the OpenCL kernel to use
vload_half instead of vloada_half.

Build failures will return a proper failure now, before, the test was
passing in this case.

More Info: https://github.com/KhronosGroup/OpenCL-Docs/issues/648
2025-10-21 09:59:13 -07:00
Marcin Hajder
940c8bb973 Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_half (#2357)
Related to #2142, according to the work plan, extending
CBasicTestFetchMin/CBasicTestFetchMax with support for atomic_half.
2025-10-21 08:43:05 -07:00
Ben Ashbaugh
089e02cdf7 add system SVM testing via clSVMAllocWithProperties (#2516)
This PR adds system SVM testing both using driver APIs
(`clSVMAllocWithPropertiesKHR`) and the system allocator directly (e.g.
`malloc`). This is done by finding all of the SVM capabilities that are
"system allocated" and duplicating them with a special "use system
allocator" pseudo-capability. When the "use system allocator"
pseudo-capability is not present, the system SVM type is treated the
same as all other unified SVM types and is tested using driver APIs.
When the "use system allocator" pseudo-capability is present, the system
SVM type is allocated using the system allocator directly, though this
also adds some limitations, for example the properties of the allocation
may not be queried using `clGetSVMPointerInfoKHR`.

See discussion in:
https://github.com/KhronosGroup/OpenCL-Docs/issues/1446
2025-10-14 10:07:32 -07:00
Kévin Petit
34745bd936 Disable {svm_,}atomic_fence tests (#2545)
As agreed in 2025/10/14 teleconference. See #2544.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2025-10-14 09:58:40 -07:00
Ewan Crawford
bfa96c77d8 CTS updates for reworked simultaneous use (#2477)
Actions test plan from
https://github.com/KhronosGroup/OpenCL-CTS/issues/2473 to update CTS
tests to reflect changes from cl_khr_command_buffer PR
https://github.com/KhronosGroup/OpenCL-Docs/pull/1411

* Adds new test in`command_buffer_pipelined_enqueue.cpp` for multiple
enqueues without blocking in-between, but serialized execution.
* Removed test for `CL_COMMAND_BUFFER_STATE_PENDING_KHR` state query.
* Remove negative test for `clEnqueueCommandBuffer` pending state error.
* Simplify `cl_khr_command_buffer` tests that stress simultaneous-use by
testing multiple serialized enqueues of the same command-buffer, which
doesn't now require the device imultaneous-use capability
* Remove simultaneous-use command-buffer creation in base class to off,
and require tests do it themselves if they require it.
* Rewrite mutable dispatch simultaneous test to test updating both
pipelined enqueues, and updating the new definition of simultaneous-use

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
2025-10-14 09:15:20 -07:00
Ahmed
eded89cdd6 add cl_khr_command_buffer_mutable_memory_commands to the list of known extensions (#2531) 2025-10-14 08:50:55 -07:00
Karol Herbst
a0e32ea64f Fix listing tests in gl testing (#2530) 2025-10-14 08:50:10 -07:00
Michael Rizkalla
a31589412f Implement negative tests for cl_command_queue functions (#2505)
This change adds negative tests to `cl_command_queue`-related APIs:
- clCreateCommandQueue
- clCreateCommandQueueWithProperties
- clSetDefaultDeviceCommandQueue
- clRetainCommandQueue
- clReleaseCommandQueue
- clGetCommandQueueInfo
- clSetCommandQueueProperty

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Co-authored-by: Chetankumar Mistry <chetan.mistry@arm.com>
Co-authored-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-10-14 08:48:20 -07:00
Yilong Guo
3871149208 commonfns: Fix max_error initialization and improve test output (#2500)
Before this change, `max_error` was initialized to `0.0f`, which caused
issues
when the actual maximum `error` was also `0.0f`. In such cases,
`max_val` would
never be updated, leading to misleading test output showing `NaN`
values:

```
  degrees: Max error 0.000000 ulps at 0: *nan vs 0x1.9802318e8abefp+21
```

This fix initializes `max_error` to `-INFINITY` to ensure `max_val` is
always
updated at least once. Additionally, the log output now includes the
input
value for better debugging:

```
  degrees: Max error 0.000000 ulps at 0, input 0x1.c7bffcp+15: *0x1.9802318e8abefp+21 vs 0x1.9802318e8abefp+21
```

This makes the test output more informative and eliminates confusing
`NaN` values in the summary.
2025-10-14 08:47:59 -07:00
Grzegorz Wawiorko
d733c2b802 c11_atomics: Fix verification loop (#2543)
Looks like bug. @shajder Could you look at this fix? Thanks
2025-10-14 08:39:54 -07:00
Marcin Hajder
51445f3743 Added support for cl_ext_float_atomics in CBaseTestFetchAdd with atomic_double (#2347)
Related to https://github.com/KhronosGroup/OpenCL-CTS/issues/2142,
according to the work plan, extending CBasicTestFetchAdd with support
for atomic_double.
2025-10-07 08:42:02 -07:00
Harald van Dijk
93c37f17fc One last file path fix for test_compiler. (#2534)
Although run_conformance.py runs from test_conformance, it will change
the current working directory before launching each individual test.
Adjust the path accordingly.

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2025-10-06 11:11:22 -07:00
David Neto
e92140f82d Add helper to wrap result of std::filesystem::path::u8string() (#2535)
In C++17 the return type of std::filesystem::path::u8string() is
std::string, but in C++20 the return type changed to std::u8string.

Add a helper to copy a std::u8string to a std::string, to be used when a
std::string is required. This fixes the build for C++20.
2025-10-01 13:40:43 -07:00
Ahmed Hesham
ac673e5e8c Fix file paths in test_compiler (#2523)
Add a command line argument to override the SPIR-V file paths if needed,
similar to `test_spirv_new`. Set the default path to the one required by
`run_conformance.py`, which assumes the current working directory to be
`<build_dir>/test_conformance`.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-09-24 10:28:33 +01:00
Ben Ashbaugh
217ba80e32 invoke the python executable explicitly to assemble SPIR-V files (#2528)
On some platforms (e.g. Windows), we need to explicitly invoke the
python executable when assembling SPIR-V files.
2025-09-17 11:04:53 -07:00
Marcin Hajder
4e8aa9d3e2 Added test to verify negative result of clSetKernelArg with CL_INVALID_SAMPLER and sampler argument (#2453)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-09-17 09:25:12 -07:00
Marcin Hajder
aa950deaf1 Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_SIZE and sampler argument (#2452)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-09-17 08:14:30 -07:00
Ben Ashbaugh
56802afb17 clean up unified SVM memory fill test (#2518)
Removes unused code from the unified SVM memory fill test.

Adds an informational message when a unified SVM capability combination
is skipped for memcpy and memfill.
2025-09-16 11:37:49 -07:00
Jose Lopez
7412973dc9 Add tests for cl_khr_external_semaphore_dx_fence (#2482)
- Add tests to import DirectX 12 fences as semaphores.
- Add tests to export semaphores as DirectX 12 fences.
- Add queries tests.
- Add negative tests.

Fixes: https://github.com/KhronosGroup/OpenCL-CTS/issues/2480
2025-09-16 23:11:49 +05:30
Marcin Hajder
c2baafae3f Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_SIZE (#2448)
Related to #2282, according to work plan related to CL_INVALID_ARG_SIZE
result
2025-09-16 08:45:22 -07:00
Ben Ashbaugh
f308540828 switch to the upstream headers for unified SVM CI testing (#2526)
Since we have added support for unified SVM in the upstream headers, we
no longer need to build CI from the unified SVM header branch.
2025-09-15 11:44:56 -07:00
John Kesapides
704ffd012e Unified SVM Memcpy and check_for_common_memory_type (#2524)
* Refactor check_for_common_memory_type to only check for device access.
* rename check_for_common_memory_type to caps_compatibility_check
* Update test_unified_svm_mem_cpy and test_unified_svm_mem_fill.

fixes #2517

Signed-off-by: John Kesapides <john.kesapides@arm.com>
2025-09-15 10:08:56 -07:00
Ben Ashbaugh
629b6fa032 Merge branch 'main' into cl_khr_unified_svm 2025-09-09 17:39:11 -07:00
Karol Herbst
87fcb5b45c Make subgroup tests run on devices without non uniform work groups (#2513)
This allows implementors to support `cl_khr_subgroup_ballot` and
`cl_khr_subgroup_non_uniform_vote` without requiring non uniform
workgroup support.
2025-09-09 08:54:19 -07:00
Yilong Guo
3f6dd3c333 Fix buffer overflow in MutableDispatchWorkDim test (#2511)
The test had critical buffer overflow issues:

1. Buffer size was calculated incorrectly: used update_elements (4)
instead
   of total work items. For 3D kernels, this meant allocating 16 bytes
   when 64*4=256 bytes were needed for the updated 4x4x4 grid.

2. Original 2x2x2 grid writes 8 elements (32 bytes) but buffer was only
   16 bytes, causing overflow on first execution.

3. Updated 4x4x4 grid writes 64 elements (256 bytes) with massive
   overflow into adjacent memory.

4. Verify function only checked one dimension instead of total elements
   in the 3D grid.

Fixed by:
- Calculating total work items as product of all dimensions
- Using update_total_elements (64) for buffer allocation
- Updating Verify calls to check correct number of elements
- Adding constants for original_total_elements and update_total_elements
2025-09-09 08:53:13 -07:00
Starla Huang
4fc861358e Resolve #852 issue (#1220)
There are two changes in total. The first one to fix a small issue of
current working directory so that second change can be applied. And the
second one is for resolving #852 Removing hard-coded SPIR-V binaries in
clUnloadPlatformCompiler tests.

Fixes #852

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Signed-off-by: Xing Huang <xing.huang@arm.com>
2025-09-09 08:50:19 -07:00
Marcin Hajder
df61cad39f Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_float (#2353)
Related to #2142, according to the work plan, extending
`CBasicTestFetchMin`/`CBasicTestFetchMax` with support for atomic_float.
2025-09-09 08:45:35 -07:00
Marcin Hajder
a0bd81d574 Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_SIZE and memory object argument (#2450)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-09-09 08:44:35 -07:00
Marcin Hajder
1aeca1360b Added support for cl_ext_float_atomics in CBasicTestFetchSub with atomic_half (#2366)
Related to #2142, according to the work plan, extending
CBasicTestFetchSub with support for atomic_half.

I wasn't able to test that PR entirely due to missing
CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT/CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT
capabilities for atomic_half. I appreciate reviewers' attention, thanks.
2025-09-09 08:40:50 -07:00
Harald van Dijk
913e6e4388 Fix test_api negative_set_read_write_image_arg. (#2510)
When the implementation does not have image support, the functions used
are not required to be defined and the test should be skipped.
2025-09-02 09:48:51 -07:00
Romaric Jodin
8e125bd2e8 Refactor wimpy feature (#2507)
- Make it a common parameter in harness using either '-w', '--wimpy' or
'CL_WIMPY_MODE' environment variable.
- Remove all test specific wimpy variable.

---------

Co-authored-by: Kévin Petit <kpet@free.fr>
2025-09-02 09:47:44 -07:00
Ewan Crawford
096a227afd Extra mutable dispatch coverage (#2499)
Adds tests to cover points 2 & 3 from the questions asked about
cl_khr_command_buffer_mutable_dispatch in
https://github.com/KhronosGroup/OpenCL-Docs/issues/1437

* New test for point 2 from issue, `mutable_dispatch_updates_persist`,
testing multiple enqueues of a command-buffer after update, and that the
updated argument persists for all of them.
* New test for point 3 pseudocode from issue in test
`mutable_dispatch_set_kernel_arg`
2025-09-02 09:45:54 -07:00
Karol Herbst
1562bcf03c Fix OOB read in negative_set_immutable_memory_to_writeable_kernel_arg (#2481)
The image was created with 4 channels, but the initialization data only
accounted for a single channel.
2025-09-02 09:44:46 -07:00