1715 Commits

Author SHA1 Message Date
Harald van Dijk
73f22aa23f Allow building with cmake --compile-no-warning-as-error. (#2401)
In CMake 3.24+, there is built-in support for adding -Werror that does
not require adding -Werror explicitly, and allows it to be downgraded to
a warning if the user wants that. Use this, to account for warnings that
have false positives.
2025-07-01 13:00:34 -07:00
Michael Rizkalla
9265cbb2c2 Refactor buffer ReadWrite and Copy tests (#2259)
This change refactors the following tests to use RAII to clean-up
allocated resources on exit, and adds additional changes as mentioned
below:

- test_arrayreadwrite
    - Allow different `cl_mem_flags` to be passed to the test.
- test_bufferreadwriterect:
    - Allow different `cl_mem_flags` to be passed to the test.
    - Customisable copy, read and write functions.
- test_buffer_copy
- Fill the destination buffer with `invalid_ptr` instead of `out_ptr` if
created with `CL_MEM_(USE/COPY)_HOST_PTR`.
- test_buffer_partial_copy
- Fill the destination buffer with `invalid_ptr` instead of `out_ptr` if
created with `CL_MEM_(USE/COPY)_HOST_PTR`.

---------

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-06-24 15:27:37 -07:00
Michael Rizkalla
880bce6047 Fix memory leaks in api test suite (#2363)
This commit fixes three tests that have memory leaks due to unreleased
CL objects.
- `kernel_local_memory_size`
- `multi_queue_flush_on_release`
- `queue_flush_on_release`

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-06-24 15:27:15 -07:00
Ben Ashbaugh
3345ea5af3 fixes test_opencl_c_versions logic error (#2377)
Found while developing #2376.

Parts of "test_opencl_c_versions" were intending to build programs for
different OpenCL C versions, but unfortunately the helper function the
test was calling only created the program and did not build it. Switch
to a helper function that builds the program, instead.
2025-06-24 15:26:34 -07:00
Marcin Hajder
550b14cd25 Added support for cl_ext_float_atomics in c11_atomics exchange test along with atomic_half type (#2337)
Related to #2142, according to the work plan, extending
CBasicTestExchange with support for atomic_half.
2025-06-24 08:37:50 -07:00
Michael Rizkalla
8701acfa90 Add tests for cl_ext_immutable_memory_objects (#2286)
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>
2025-06-17 10:19:11 -07:00
joshqti
e622512301 test_vulkan: switch defaults on device local memory (#2365)
Switch the test_vulkan default to use device local memory
2025-06-17 10:17:26 -07:00
Ben Ashbaugh
26f8b3a7e8 add missing image support checks to a few SPIR-V tests (#2411)
The tests for new image operands should not run on devices that do not
support images.
2025-06-11 09:46:31 -07:00
Marcin Hajder
b79a8a2f42 Added support for cl_ext_float_atomics in c11_atomics load test along with atomic_half type (#2297)
Related to #2142, according to the work plan, extending CBasicTestLoad
with support for atomic_half.
2025-06-10 08:43:02 -07:00
Marcin Hajder
3233d2089f Added comparability verification for GL associated devices query (#2231)
Fixes #1485 according to work plan from issue description.
2025-06-10 08:41:20 -07:00
Ahmed
f209922722 Add cl_khr_external_memory_android_hardware_buffer to the list of known compiler test extensions (#2407)
Fixes compiler_defines_for_extensions failure when the extension is
supported.
2025-06-03 14:38:39 -07:00
Sven van Haastregt
2d165eee74 conversions: remove timing functionality (#2394)
Remove the test timing functionality from the conversions test, because
it

 - is not advertised in the help,

- is not supported on all platforms, triggering warnings during the
build,

 - goes beyond the core purpose of the conformance test suite.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-05-30 23:50:17 +01:00
Marcin Hajder
f30a191978 Corrected procedure to collect proper size of image from VkImageCreateInfo (#2289)
Fixes #2155 according to issue description

Additional remark: The image size was previously calculated based on the
memory size, which seems unusual. Due to Vulkan's configuration
capabilities, the size of memory allocated for a specific texture may
differ from what would be expected based on the texture dimensions.
Thus, calculating the image dimensions back from the memory size of a
Vulkan texture can be challenging.
2025-05-27 10:17:14 -07:00
Ahmed Hesham
3ab4d8aab2 Test image formats of cl_ext_image_unsigned_10x6_12x4_14x2 (#2375)
This change add the following image formats to the supported image
formats:
1. CL_UNSIGNED_INT10X6_EXT
2. CL_UNSIGNED_INT12X4_EXT
3. CL_UNSIGNED_INT14X2_EXT
4. CL_UNORM_INT10X6_EXT
5. CL_UNORM_INT12X4_EXT
6. CL_UNORM_INT14X2_EXT

For reference, the specification for
`cl_ext_image_unsigned_10x6_12x4_14x2` can be found here:
https://github.com/KhronosGroup/OpenCL-Docs/pull/1352

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
Co-authored-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-05-27 08:57:34 -07:00
Marcin Hajder
dec5644112 Added support for cl_ext_float_atomics in c11_atomics store test along with atomic_half type (#2293)
Related to #2142, according to the work plan extended `CBasicTestStore`
with support for `atomic_half`.

Optimization remark: in tests related to `CBasicTestStore` kernel source
code is mostly composed with arguments following similar pattern:

`__kernel void test_atomic_kernel(uint threadCount, uint numDestItems,
__global int *finalDest, __global int *oldValues, volatile __local
atomic_int *destMemory)`

`oldValues` buffer is initialized with a host pointer, after kernel
execution it is read back to the host pointer but it is unused in
neither of the kernels I verified.
2025-05-27 08:51:36 -07:00
Kévin Petit
110799bb67 Add missing coverage to api::zero_sized_enqueue (#2378)
- Cases with a NULL global_work_size were not tested
- The specification states that zero-sized enqueues behave similarly to
marker commands. Test that events for NDRange kernel commands have the
correct CL_COMMAND_NDRANGE_KERNEL command type to guard against
implementations naively using a marker command.
- Tidy up the code a bit and add missing error checking.

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-05-13 03:51:43 +01:00
Michael Rizkalla
b011fb26d9 Add test_spir installation target (#2359)
`test_spir` and its data are not installed correctly when building the
installation target.
This change makes sure both the binary and the test data are installed
correctly to `${CMAKE_INSTALL_BINDIR}/$<CONFIG>`.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-05-06 09:45:01 -07:00
Kévin Petit
455c7b0504 ci: move contents of presubmit.sh to workflow file (#2380)
Signed-off-by: Kévin Petit <kpet@free.fr>
2025-05-06 09:43:38 -07:00
AlexGalazin-IMG
d3b043a891 Update README after PR 2200 (#2381)
PR2200 made the presence of spirv-as and spirv-val mandatory.

Reflect this fact in the Readme and update the example build
instructions
2025-05-06 09:41:41 -07:00
Romaric Jodin
3f7889bdbd Remove CL_DEVICE_HALF_FP_CONFIG when cl_khr_fp16 is not supported (#2354)
Specification does not require to return an error when querying
CL_DEVICE_HALF_FP_CONFIG and cl_khr_fp16 is not supported.

Fix #2339
2025-05-06 09:33:34 -07:00
Sven van Haastregt
9917ed2790 [NFC] math_brute_force: use getAllowedUlpError for double (#2351)
Call `getAllowedUlpError` to obtain the allowed ULP error for all of the
double type (fp64) tests. The aim is to standardise obtaining the
desired ULP requirement and pave the way for adding the Embedded Profile
ULP errors.

Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/867

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-05-06 09:32:31 -07:00
Marcin Hajder
8aa47754de Added object comparability verification for CL_DEVICE_PLATFORM query (#2225)
Fixes #1485 according to work plan, point CL_DEVICE_PLATFORM
2025-05-06 08:40:18 -07:00
Kévin Petit
9fc0d23b4c Define SubDevicesScopeGuarded in the harness and remove duplicate copies (#2379)
Signed-off-by: Kévin Petit <kpet@free.fr>
v2025-04-21-00
2025-04-21 11:16:17 +01:00
Ahmed Hesham
90524879e4 Migrate extensions suites to the new test registration framework (#2334)
This covers:
* cl_ext_cxx_for_opencl
* cl_khr_command_buffer
* cl_khr_command_buffer/cl_khr_command_buffer_mutable_dispatch
* cl_khr_dx9_media_sharing
* cl_khr_external_semaphore
* cl_khr_kernel_clock
* cl_khr_semaphore

Contributes to #2181.

---------

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
v2025-04-16-00
2025-04-16 11:14:34 +01:00
gorazd-sumkovski-arm
33846e6673 Refactor external semaphore scaffolding (#2300)
Remove the `CREATE_OPENCL_SEMAPHORE` macro and use derived class
instantiations of the `clExternalSemaphore` class, rather than base
pointers to derived class objects.

Remove the default argument for `queryParamName` in
`check_external_semaphore_handle_type()`.

Move `check_external_semaphore_handle_type()` checks to constructors of
`clExternalImportableSemaphore` and `clExternalExportableSemaphore`,
rather than manually making the check before creating an external
semaphore.

---------

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
Co-authored-by: Kévin Petit <kpet@free.fr>
Co-authored-by: Kevin Petit <kevin.petit@arm.com>
2025-04-16 09:11:38 +05:30
Sven van Haastregt
4ce3d8968a conversions: use C++17 to avoid Wformat warnings (#2369)
Using C++17's `if constexpr` avoids Wformat warnings in this template
function, as it is now made explicit that the various format strings are
only used with appropriate types.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-04-15 18:28:47 +01:00
Kévin Petit
829e91663a Stop using optimally-tiled images in external memory tests (#2349)
Support for optimally-tiled images and tiling inference in general is
implementation-defined. It should not be relied upon in the CTS.

Also build the code base as C++17 for std::optional. Many Khronos
projects are now using C++17 and the transition in the CTS is IMO
overdue.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2025-04-15 22:58:35 +05:30
Kévin Petit
e96edaef8b Require C++17 (#2356)
This enables many useful newer C++ features. C++17 is already required
by many components of the Khronos ecosystem.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
v2025-04-14-00
2025-04-08 09:50:33 -07:00
Sven van Haastregt
0abec2f49a spirv_new: remove invalid Aligned 0 decorations (#2360)
After https://github.com/KhronosGroup/SPIRV-Tools/pull/6027 spirv-val is
now rejecting `Aligned 0` Memory Operands. This causes the spirv_new
test binary to no longer build with a recent SPIRV-Tools version.

Mechanically remove all occurrences of `Aligned 0` in the SPIR-V
assembly files.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-04-08 17:49:00 +01:00
Grzegorz Wawiorko
051b82b7e9 SPIR-V tests for scalar printf - fix for Windows OS (#2358) 2025-04-04 08:52:05 -07:00
Grzegorz Wawiorko
42b4bca510 Fix test_printf - any nan format is allowed by OpenCL C spec (#2298)
OpenCL C says that printing nan is implementation-defined for
floating-point numbers -
https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#printf-format-string
2025-04-01 13:44:39 -07:00
Michael Rizkalla
5930d45fc6 Refactor clCopyImage and clFillImage tests (#2283)
This change mainly extends `clFillImage` and `clCopyImage` test function
to include memory flags to be used during creating the image instead of
hard-coding these values. The memory flags are also different parameters
for source and destination images in `clCopyImage` tests.

---------

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-04-01 09:53:37 -07:00
Sreelakshmi Haridas Maruthur
78bd3ddece allocations: Scale number of work-items in relation to input size (#2336)
Make the number of work-items proportional to size of the allocation so
we launch more work-items and do less work per work-item as buffer sizes
go up with device capabilities.

To test:
test_allocations multiple 5 buffer
test_allocations single 5 buffer
2025-04-01 09:53:21 -07:00
Grzegorz Wawiorko
a429ce771e Test printf - set more precisely printing floating point numbers (#2299)
We noticed such issue 
expected: ^(K{C, -30304.8, -22634.574219, 24476.882812, E4929EC2,
1467582223, 96vL.+
got: ^(K{C, -30304.8, -22634.574219, 24476.882813, E4929EC2, 1467582223,
96vL.+
The input value is 24476.882812 and cannot be precisely represented as a
single-floating point, so compilers are allowed to round it to the
nearest representable value. In this case, the closest representable
value to 24476.882812 is 24476.8828125, which rounds to 24476.882813.
Even some versions of MSVC prints that value as 24476.882813 and some
24476.882812 : https://godbolt.org/z/5GhEf8KPT
The proposal is to set precisely how many number should be displayed to
avoid rounding.
2025-04-01 09:52:19 -07:00
Marcin Hajder
4e00778b93 Modernization of semaphores_negative_create_invalid_device related to creating sub-devices (#2307)
Due to the improvements developed during work on #2237 with @bashbaug
2025-04-01 08:47:59 -07:00
Marcin Hajder
88953edf6c Modernization of semaphores_negative_create_multi_device_property related to creating sub-devices (#2306)
Due to the improvements developed during work on #2237 with @bashbaug
2025-04-01 08:47:27 -07:00
Marcin Hajder
004bc4a82d Cleanup corrections for get_program_info_mult_devices test (#2305) 2025-04-01 08:46:18 -07:00
Sven van Haastregt
b6924adfb2 basic: fix Wformat warnings (#2343)
Fix all `-Wformat` warnings in the basic test suite, and re-enable the
warning.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-03-25 09:45:18 -07:00
Marcin Hajder
1cbb548e27 Added support to run the CTS with Vulkan validation layers (#2246)
Fixes #2116 according to task description.

As approved 25Mar25
2025-03-25 08:43:28 -07:00
Marcin Hajder
81f33190e2 Added test to verify program queries after recompiling and relinking (#2272)
Fixes #2163 according to issue description

As approved 25Mar25
2025-03-25 08:41:04 -07:00
Michael Rizkalla
e36da9798e Migrate integer_ops suite to the new test registration framework (#2332)
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/2181.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-23 15:12:34 +00:00
Ahmed Hesham
a9507ce33f Migrate images suite to the new test registration framework (#2328)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-23 15:02:29 +00:00
Michal Babej
36178cf6e3 add tests for cl_ext_buffer_device_address (#2192) 2025-03-19 14:08:17 -07:00
Ahmed Hesham
e88e5be93e Migrate basic suite to the new test registration framework (#2316)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-18 17:32:58 +00:00
Ahmed Hesham
b39eff86c5 Migrate math_brute_force to the new test registration framework (#2327)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-18 17:25:14 +00:00
Ahmed Hesham
11db5e5d62 Migrate multiple_device_context suite to the new test registration framework (#2325)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-18 17:22:11 +00:00
Ahmed Hesham
e52f6a732b Migrate conversions suite to the new test registration framework (#2322)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-18 17:15:28 +00:00
Michael Rizkalla
ac38405a62 Migrate geometrics suite to the new test registration framework (#2335)
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/2181.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-18 17:13:35 +00:00
Michael Rizkalla
7cd13e1e93 Migrate generic_address_space suite to the new test registration framework (#2333)
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/2181.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-18 17:11:43 +00:00
Ahmed Hesham
2131aff0e9 Migrate compiler suite to the new test registration framework (#2319)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-18 17:10:21 +00:00