Commit Graph

1408 Commits

Author SHA1 Message Date
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
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
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
Harald van Dijk
d0b0bd9570 Fix -list option in test_spir (#2509)
This handles the case where test_spir is called without arguments.
2025-09-02 09:23:50 -07:00
Marcin Hajder
8a2b91c715 Added test to verify negative result of clSetKernelArg with CL_INVALID_KERNEL (#2460)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-09-02 08:40:11 -07:00
Marcin Hajder
fbba22770d Added support for cl_ext_float_atomics in CBasicTestFetchAdd with atomic_float (#2345)
Related to #2142, according to the work plan, extending
CBasicTestFetchAdd with support for atomic_float.
2025-09-02 08:38:56 -07:00
Ben Ashbaugh
e936977934 remove checks for the command-buffer pending state (#2504)
This is a very small subset of the changes in #2477 to get things
building again, since the command-buffer pending state is no longer in
the spec or headers.
2025-08-27 11:43:29 +01:00
Jose Lopez
b0245f1a28 Rename Version major and minor getters (#2451)
Both these functions cause a conflict when using an old version of the
GNU C Library with the header file sys/sysmacros.h where major() and
minor() are defined as a macro
2025-08-26 09:35:48 -07:00
Ahmed
c0f5c4e271 Fix basic progvar_prog_scope_init and progvar_prog_scope_uninit (#2497)
The test was mapping a memory object using CL_MAP_READ but then writing
to its host_ptr using memset.
2025-08-26 09:27:33 -07:00
Romaric Jodin
0633af21c1 mutable_command_info: remove unnecessary Skip function (#2498)
The check implementated by that Skip function is already implemented in
'InfoMutableCommandBufferTest::Skip()'.

Also this is trying to get the extension_version before checking whether
the extension is supported, leading to false negative for device not
supporting the extension.
2025-08-20 11:21:46 -07:00
Karol Herbst
909095f60a test_vulkan: Fix some VVL errors (#2486)
Fixes the following VVL errors:

```
Validation Error: [ VUID-VkExternalSemaphoreProperties-sType-sType ] | MessageID = 0x160be1e8
vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(): pExternalSemaphoreProperties->sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES.
The Vulkan spec states: sType must be VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES (https://docs.vulkan.org/spec/latest/chapters/capabilities.html#VUID-VkExternalSemaphoreProperties-sType-sType)
```

```
Validation Error: [ VUID-VkImportSemaphoreFdInfoKHR-handleType-07307 ] | MessageID = 0x1b609443
vkImportSemaphoreFdKHR(): pImportSemaphoreFdInfo->handleType is VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT so VK_SEMAPHORE_IMPORT_TEMPORARY_BIT must be set, but flags is VkSemaphoreImportFlags(0).
The Vulkan spec states: If handleType refers to a handle type with copy payload transference semantics, flags must contain VK_SEMAPHORE_IMPORT_TEMPORARY_BIT (https://docs.vulkan.org/spec/latest/chapters/synchronization.html#VUID-VkImportSemaphoreFdInfoKHR-handleType-07307)
```

```
Validation Error: [ VUID-VkPhysicalDeviceExternalBufferInfo-None-09500 ] | MessageID = 0x8434cf
vkGetPhysicalDeviceExternalBufferPropertiesKHR(): pExternalBufferInfo->usage is zero.
The Vulkan spec states: If the pNext chain does not include a VkBufferUsageFlags2CreateInfo structure, usage must not be 0 (https://docs.vulkan.org/spec/latest/chapters/capabilities.html#VUID-VkPhysicalDeviceExternalBufferInfo-None-09500)
```
2025-08-19 18:06:37 +01:00
Karol Herbst
e51fadbbb1 Properly handle NaN when comparing images in Vulkan interop testing (#2484)
I was considering reusing other code where NaN gets taken into account,
but all the other places are a mess. The kernel read write tests are
just doing it within loops. Other places only compare raw values as
outside of kernel functions it seems to be fine to expect NaN to not
mess up results.

However the vulkan interop testing does run kernels and does operate on
NaN float values, so we need to special case this there.
2025-08-19 18:06:22 +01:00
Romaric Jodin
cef3ef6b59 Update '-list' option (#2457)
'-list' option is used to print all sub-tests. But some test do not
support it at all. And all test do not display it the same way, making
it quite complicated for external tools to extract them.

That CL clean the usage so that tests:
- Print the sub-tests list with either '-list' (to prevent breaking
legacy usage) or '--list' (to match other options)
- Do not print anything else when the option is used
2025-08-19 17:48:03 +01:00
Karol Herbst
7f01a861d8 Add feature_macro test for cl_ext_image_unorm_int_2_101010 (#2420) 2025-08-19 09:47:20 -07:00
Ahmed Hesham
e778fa8380 Update D3D10 and D3D11 interop tests (#2479)
Both tests depend on a very old DirectX SDK (August 2009) and expect it
to be extracted to an {NV_TOOLS} environment variable. They additionally
require definining {ARCH} as a CMake configuration option, which is not
needed.

Update both projects to use DirectX libraries provided by the Windows
SDK and drop the unneeded configuration options.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-08-19 17:37:47 +01:00
Ben Ashbaugh
555b7cd383 tests for cl_khr_spirv_queries (#2409)
See: https://github.com/KhronosGroup/OpenCL-Docs/pull/1385
2025-08-13 08:11:10 +01:00
Romaric Jodin
86634c07f9 fix test_api min_max_image_buffer_size (#2342)
print a `log_info` and use the minimum value (`1`) for `pixelBytes`
instead of printing an error and returning with an error value.
It allows device exposing a big CL_DEVICE_IMAGE_MAX_BUFFER_SIZE (more
than CL_DEVICE_MAX_MEM_ALLOC_SIZE/2) to pass test_api
min_max_image_buffer_size

Fix #2245
2025-08-12 08:46:59 -07:00
Sreelakshmi Haridas Maruthur
aef863afa2 Support building for Windows on 64-bit Arm (#2355)
Support to build for Windows on Arm.
2025-08-12 08:46:23 -07:00
Marcin Hajder
4115d04ae0 Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_INDEX (#2458)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-08-12 08:40:13 -07:00
Marcin Hajder
2e0f803699 Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_SIZE and local qalified argument (#2449)
Related to #2282, according to work plan from
[here](https://github.com/KhronosGroup/OpenCL-CTS/issues/2282#issuecomment-3069182773)
2025-08-08 14:06:15 -07:00
Ahmed Hesham
3fd572dec4 Fix compilation errors cl_khr_external_memory_ahb (#2475)
Update the test to use
`CL_EXTERNAL_MEMORY_HANDLE_ANDROID_HARDWARE_BUFFER_KHR` instead of
`CL_EXTERNAL_MEMORY_HANDLE_AHB_KHR` to match the headers.

Handle missing format in switch statement.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-08-07 20:49:06 +01:00
Ahmed Hesham
ac63117231 Fix compiler warnings in test_vulkan (#2474)
Use the correct print format specifiers for `uint64_t` and fix loop
index type to address sign warning.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-08-07 15:12:27 +01:00
Karol Herbst
e2580bded2 Use CL_KERNEL_WORK_GROUP_SIZE more often (#2435)
Drivers _may_ choose to advertise values for
`CL_DEVICE_MAX_WORK_GROUP_SIZE` or `CL_DEVICE_MAX_WORK_ITEM_SIZES` that
kernels without a `reqd_work_group_size` are not able to be launched
with.

The CTS should therefore make sure that the local_size passed to
`clEnqueueNDRangeKernel` does not exceed `CL_KERNEL_WORK_GROUP_SIZE`

This fixes it up in two places I've noticed this not happening.
2025-08-05 14:40:11 -07:00
dcrawleyqti
086a6c67fb cl_khr_external_memory_ahb test (#2413)
Android AHardwareBuffer test. Initial testing for buffers and image.

---------

Co-authored-by: joselope <joselope@qti.qualcomm.com>
2025-08-05 17:32:02 +01:00
Ahmed
4c54ecbd1f Fix printf vector for RTZ devices (#2459)
The failure is :

7)testing printf("%.1v4hla",(0.25f,0.5f,1.f,1.5f))
verifyOutputBuffer failed with kernel:
__kernel void test14(void)
{
float4 tmp = (float4)(0.25f,0.5f,1.f,1.5f); printf("%.1v4hla\n",tmp);}
 expected: 0x1p-2,0x1p-1,0x1p+0,0x1.8p+0
 got: 0x1.0p-2,0x1.0p-1,0x1.0p+0,0x1.8p+0

%.1 requires 1 decimal.
2025-08-05 09:19:37 -07:00
Ewan Crawford
9809cc931a Test for mutable-dispatch original work-dim (#2438)
New test following on from OpenCL-Docs Issues discussion
https://github.com/KhronosGroup/OpenCL-Docs/issues/1390#issuecomment-3023818903

Noting that we have no test coverage for using the original value of
`work_dim` during command-buffer update. All of our current CTS testing
uses `0` for the `work_dim` to signify no update from the original
value, however this test explicitly uses the original value.
2025-08-05 09:15:04 -07:00
Yilong Guo
466049474c Fix buffer size for mutable dispatch command buffer test (#2437) 2025-08-05 09:14:35 -07:00
Yilong Guo
e7e753f1a9 Fix data race in mutable command buffer simultaneous execution test (#2434)
Prior to this change, both `clEnqueueReadBuffer` calls before and after
updating the command buffer were writing to the same `output_buffer`,
causing a data race condition and the first call's result to be
overwritten. This commit introduces separate destination vectors
(`output_buffer` and `updated_output_buffer`) for these operations and
verifies both results independently to ensure test integrity.
2025-08-05 09:13:05 -07:00
Yilong Guo
dacb944cf3 Retain output memory objects for simultaneous command buffer tests (#2429)
Memory objects created in `EnqueueSimultaneousPass()` are used by
kernels
that don't execute until the user event is signaled. Without retaining
these objects, they would be destroyed before the deferred kernel
execution occurs.
2025-08-05 09:12:25 -07:00
Yilong Guo
da1008c5da Fix interger overflow for work-group size calculation (#2455) 2025-08-05 09:11:07 -07:00
Karol Herbst
678ad78233 Remove semaphores_simple_2 and external_semaphores_simple_2 tests (#2447)
While the cl_khr_semaphore extension spec does state that are no
implicit dependencies between already enqueued commands and the
clEnqueueSignalSemaphoresKHR, it's nothing special as this is already
true for any other event that's not a barrier or marker.

Also, the CTS can't reliably assume implementations to reorder events
even in an out of order queue as this is highly implementation defined
behavior and implementations may or may not choose to reorder events in
a specific order.

I don't see a reason why this should be tested for semaphores, but not
for any other commands, especially as it imposes a restriction on how to
implement out of order queues that wasn't enforced before.

Closes: https://github.com/KhronosGroup/OpenCL-CTS/issues/2439
2025-08-05 09:10:00 -07:00
Marcin Hajder
c7abbe57a4 Added test to verify negative result of clSetKernelArg with CL_INVALID_ARG_VALUE (#2445)
Related to #2282, according to work plan with mismatched read/write only
qualifier for image_t objects
2025-08-05 09:09:16 -07:00
Wenju He
e15c6eb760 Fix 'fpclassify: ambiguous call' compile fail in MSVC 2022 (#2426)
Similar to #2219, we see "'fpclassify': ambiguous call" error in
test_conformance\basic\test_fpmath.cpp
due to missing constexpr at
https://github.com/KhronosGroup/OpenCL-CTS/blob/9265cbb2c274/test_conformance/basic/test_fpmath.cpp#L104
This PR fixes the issue by moving utility function isnan_fp in
testHarness.h and use it.
Note this PR doesn't modify use of isnan in many tests where only
float/double values are checked.
2025-08-05 09:08:04 -07:00
Ahmed Hesham
9ca0126c54 Fix warnings treated as errors in Vulkan tests. (#2461)
Unused variables and mismatched sign comparisons.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-08-04 11:06:18 +01:00
Ben Ashbaugh
2507f7de84 add cl_khr_spirv_queries to list of known extensions (#2463)
While #2409 is under review, could we please add "cl_khr_spirv_queries"
to the list of known extensions? This will prevent test "failures" for
implementations that support the extension.
2025-08-01 21:37:16 +01:00
Ahmed Hesham
430727cc8d Enable -Wnarrowing in Vulkan test suite (#2469) 2025-07-31 12:24:51 +01:00
Ahmed Hesham
dae998ff9d Enable -Wnarrowing in spirv_new test suite (#2468) 2025-07-31 12:24:30 +01:00
Ahmed Hesham
044e0be653 Enable -Wnarrowing for the basic test suite (#2467)
Fixes #1156

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-07-31 12:24:03 +01:00
Ahmed Hesham
77a987d547 Enable -Wnarrowing in integer_ops test suite (#2465)
Fixes #1158

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-07-30 18:51:54 +01:00
Ahmed Hesham
7c530dafa6 Enable -Wnarrowing for conversions test suite (#2466)
No code changes required.

Fixes #1157

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-07-30 18:51:05 +01:00