92 Commits

Author SHA1 Message Date
Krzysztof Gibala
5af0e74ef4 Add cl_khr_icd_unloadable to the list of known_extensions (#2605)
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>

Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
2026-01-20 09:59:56 -08:00
Romaric Jodin
6b20272159 fix compiler/options_build_optimizations (#2595)
We need to define -cl-std when compiling with option not in 1.0.
2025-12-16 17:23:37 +00:00
Jose Lopez
5b2c1acd78 Add clFinish to compiler multiple_build_program test before building again (#2574)
[clBuildProgram](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clBuildProgram)
has the next error condition:

>
[CL_INVALID_OPERATION](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_INVALID_OPERATION)
if there are kernel objects attached to program.

The test needs to wait for the NDRangeKernel to finish in order to build
the program again. If not, kernel0 might still have references and
therefore still be attached to program.
2025-11-26 16:24:03 -08:00
Romaric Jodin
df46a38e31 Better support for -cl-uniform-work-group-size (#2564)
Add support for build options available only after a certain version:
- -cl-uniform-work-group-size after 2.0
- -cl-no-subgroup-ifp after 2.1

Add specific test for cl-uniform-work-group-size
- Check that test can be executed when work group size is uniform.
- Check that test returns the proper error code when work group size is
not uniform.

Ref #2563
2025-11-26 16:19:33 -08:00
Marcin Hajder
6b59cae6e9 Added test to verify process of building a kernel with long name (#2559)
Closes #2422 according to issue description
2025-11-18 08:52:03 -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
eded89cdd6 add cl_khr_command_buffer_mutable_memory_commands to the list of known extensions (#2531) 2025-10-14 08:50:55 -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
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
Karol Herbst
7f01a861d8 Add feature_macro test for cl_ext_image_unorm_int_2_101010 (#2420) 2025-08-19 09:47:20 -07: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
08738a6954 Add cl_khr_unified_svm to the list of known extensions in the compiler defines for extension test. (#2433)
Adds cl_khr_unified_svm to the list of known extensions in the compiler
defines for extension test.
2025-07-08 09:59:47 -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
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
Kévin Petit
9fc0d23b4c Define SubDevicesScopeGuarded in the harness and remove duplicate copies (#2379)
Signed-off-by: Kévin Petit <kpet@free.fr>
2025-04-21 11:16:17 +01:00
Marcin Hajder
004bc4a82d Cleanup corrections for get_program_info_mult_devices test (#2305) 2025-04-01 08:46:18 -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
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
Marcin Hajder
a7c4d7f4c7 Added test to verify program queries after rebuilding (#2253)
Fixes #2163 according to issue description
2025-02-26 09:55:38 -08:00
Marcin Hajder
a90a8194bc Added object comparability verification for program devices query (#2237)
Fixes #1485 according to work plan from issue description.
2025-02-25 08:43:12 -08:00
Ahmed Hesham
485964d87c Add CMake installation rules (#2184)
Add installation rules for all the binary targets.

Targets are installed under `<CMAKE_INSTALL_PREFIX>/bin/<CONFIG>` where
`<CONFIG>` is `CMAKE_BUILD_TYPE` for single-config generators, e.g. Unix
Makefiles and Ninja, or the build configuration for multi-config
generators, e.g. Ninja Multi-Config and Visual Studio.

This creates the target `install` on Unix and `INSTALL` on Windows.
2025-02-18 20:47:56 -08:00
Sven van Haastregt
7693ffe0a5 Fix more 32-bit Wformat warnings (#2185)
This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-12-17 09:55:37 -08:00
Sven van Haastregt
56d383b2e9 Fix more Wformat warnings related to size_t (#2166)
Printing of a `size_t` requires the `%zu` specifier.

This fixes occurrences where the previous wrong specifier appears to
work in a typical 64-bit build, but causes a Wformat warning in 32-bit
builds.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-12-10 09:13:58 -08:00
Marcin Hajder
6563c9062c Added test to verify required features coupling (#2115)
Fixes #1366 according to task description.
2024-11-05 08:38:45 -08:00
ellnor01
617e7cb233 Re-enabling narrowing errors (#1144)
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>
2024-10-08 09:54:32 -07:00
Michal Babej
2be73b2be1 fix generic_address_space, command_buffer_event_sync, test_compiler and images/test_1D_buffer (#2062)
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>
2024-10-01 09:26:39 -07:00
Ahmed
cdf8d5e35e Add cl_khr_kernel_clock tests (#1960)
Adds cl_khr_kernel_clock test.

Also fixes failure in the compiler defines for extension compiler
subtest when cl_khr_kernel_clock is supported.
2024-05-21 08:49:49 -07:00
Sven van Haastregt
46255db86f compiler: fix memory leak (#1950)
The `test_compiler compiler_defines_for_extensions` test did not free
all `malloc`'ed memory.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-04-26 16:32:03 +02:00
Sven van Haastregt
e0a31a03fc Fix -Wformat warnings in various tests (#1868)
All of these warnings stem from printing `size_t` types, which should
be done using the `z` length modifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-02-27 09:59:39 -08:00
Sven van Haastregt
0bdd0fd2fa compiler: fix grammar in error message (#1877)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-01-17 08:05:10 -08:00
Aharon Abramson
60fc7fc844 Update test_compile.cpp (#1812)
* Update test_compile.cpp

Prevent the error:
"variable 'temp' is uninitialized when used here"

Since one of the generated kernels starts with:

__kernel void sample_test(__global float *src, __global int *dst)
{
    float temp;
    int  tid = get_global_id(0);
    dst[tid] = dst[tid] + temp;

* Update test_compile.cpp

clang format

* Update test_compile.cpp

Change the "0.0" literal to "0.0f" for devices that don't support FP64.
2023-10-10 09:18:22 -07:00
Nora
3c1f2814b8 add cl_khr_expect_assume to test_compiler_defines_for_extensions (#1735) 2023-07-18 16:07:17 -07:00
Sven van Haastregt
2e88013b34 compiler: fix memory leak from unnecessary strdup (#1761)
The result of the `strdup` was never freed.  The string duplication
isn't necessary, so remove it.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-06-21 22:08:21 -07:00
paulfradgley
5297ecd673 Add compiler test external memory/semaphore extensions (#1662)
The OpenCL Headers have cl_khr_external_memory_dx, cl_khr_external_memory_dma_buf and cl_khr_external_semaphore_dx_fence as extension strings, but CTS Compiler fails if an implementation says that it supports them.
2023-03-07 09:54:15 -08:00
Stuart Brady
a25b9c4948 Partial clean up of test_compiler_defines_for_extensions (#1577)
Replace repetitions of extensions_supported[num_of_supported_extensions]
with a single pointer variable.

Replace character-by-character comparisons with a new string_has_prefix
function.

Signed-off-by: Stuart Brady <stuart.brady@arm.com>

Signed-off-by: Stuart Brady <stuart.brady@arm.com>
2022-12-13 09:48:35 -08:00
Stuart Brady
133834615e Improve logging of unknown extensions (#1556)
Add missing newlines, and log all unknown extensions instead of logging
only the first unknown extension found.
2022-11-04 11:26:19 -07:00
Nikhil Joshi
86d5ee5414 Update extension list of test_compiler (#1507)
* Update extension list of test_compiler

Upate extension list of test_compiler
with missing external memory and semaphore
extensions
2022-09-20 09:07:14 -07:00
Sven van Haastregt
6554c49018 [NFCI] Remove unused variables and enable -Wunused-variable (#1483)
Remove unused variables throughout the code base and enable the
`-Wunused-variable` warning flag globally to prevent new unused
variable issues being introduced in the future.

This is mostly a non-functional change, with one exception:

 - In `test_conformance/api/test_kernel_arg_info.cpp`, an error check
   of the clGetDeviceInfo return value was added.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-09-08 12:54:36 +01:00
Ewan Crawford
7caa4c4421 Update known extensions in compiler define test (#1480)
Add
[cl_khr_command_buffer_mutable_dispatch](https://github.com/KhronosGroup/OpenCL-Docs/pull/819),
[cl_khr_subgroup_rotate](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_subgroup_rotate),
and [cl_khr_extended_async_copies](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_Ext.html#cl_khr_extended_async_copies)
to the list of known extensions used in
`test_compiler_defines_for_extensions`
2022-09-01 15:13:01 -07:00
Kévin Petit
bd03e17a56 Add missing external memory/sync extensions to list of known khr extensions (#1455)
Signed-off-by: Kévin Petit <kpet@free.fr>
2022-08-01 10:18:53 +01:00
Ahmed
f1c051afb1 Added missing tests for integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed on feature_macro compiler test. (#1432)
* Added integer_dot_product_input_4x8bit and integer_dot_product_input_4x8bit_packed tests to feature_macro_test

* clang formatting

* Now the test checks whether the array of optional features returned by clGetDeviceInfo contains the standard optional features we are testing.

* Update test_conformance/compiler/test_feature_macro.cpp

Added printing the missing standard feature it it is not found inside the optional features array returned by clGetDeviceInfo.

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2022-06-14 08:48:59 -07:00
jansol
7c65afc4e7 test_compiler_defines_for_extensions: fix overflow (#1430)
GCC 11.2.0 warns about a possible string overflow (when
num_not_supported_extensions+num_of_supported_extensions == 0)
since no space would be allocated for the terminating
null byte that string manipulation fns expect to find.

This unconditionally adds an extra byte to the allocation to silence
the warning and fix building with -Werror.
2022-06-07 08:55:43 -07:00
Ewan Crawford
73d71b6a76 Add cl_khr_command_buffer to list of extensions (#1365)
cl_khr_command_buffer is now public as a provisional khr extension
which implementations may report.
2021-12-08 16:08:15 +00:00
marcat03
3cd906aa9b Fix missing cl_khr_semaphore extensions in compiler tests (#1357)
* Added missing extensions related to cl_khr_semaphore

Signed-off-by: Marco Cattani <marco.cattani@arm.com>
2021-11-16 16:07:43 +00:00
Grzegorz Wawiorko
e27a97fbd8 Add cl_khr_integer_dot_product to known extensions in test compiler. (#1316) 2021-08-31 15:53:55 +01:00
Grzegorz Wawiorko
bd3135dd01 Extend list of known extensions (#1262) 2021-05-27 09:05:27 +01:00
James Price
baa226a779 Remove compiler options that are specific to Apple (#1114)
These are causing test failures for non-Apple implementations of
OpenCL running on macOS.
2021-04-06 16:42:46 +01:00