Commit Graph

100 Commits

Author SHA1 Message Date
Sven van Haastregt
9bb8a89bbd semaphore: fix Wformat warning (#2194)
`i` is an `int`, so shouldn't use the `%zu` specifier for printing.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-12-17 23:41:36 +05:30
Kévin Petit
be1278d5b2 Add utility macro to skip test when an extension is not supported (#2178)
Use in cl_khr_external_semaphore suite as an example.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-12-17 09:54:51 -08:00
gorazd-sumkovski-arm
96e3d7e669 Command buffer test adjustments (#2141)
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
Co-authored-by: Ewan Crawford <ewan.cr@gmail.com>
2024-11-26 09:26:04 -08:00
Marcin Hajder
a9be3cc0e8 Added semaphore test to cover out-of-order operations synchronized with barrier (#2068)
Fixes #1979 according to task description.
2024-11-19 08:41:22 -08:00
joshqti
239159fd26 Re-enable simple_semaphore_2 (#2123)
Re-enable a disabled external semaphore test.
Delete obsolete subtests that remain in comments.
2024-11-12 10:10:07 -08:00
Ahmed Hesham
10130a1261 Fix payload value query for external semaphores (#2127)
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>
2024-11-05 23:44:41 +05:30
xinjin01
e211470035 Fix CTS mutable_dispatch memory leak (#2129)
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>
2024-11-05 08:53:55 -08:00
Qichao Gu
ccd455040a Enable building OpenCL-CTS with Intel DPC++/C++ compiler ICX on Windows (#2088)
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.
2024-11-05 08:52:16 -08:00
Sven van Haastregt
8369028c92 cl_khr_semaphore: fix -Wformat warnings (#2124)
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>
2024-10-29 09:43:30 -07:00
Sven van Haastregt
6337d9be46 semaphore: fix mistyped "platform" in log messages (#2128)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-28 17:03:12 -07:00
gorazd-sumkovski-arm
6a2c0b1cff Fix bug in mutable_command_full_dispatch (#2082)
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>
2024-10-22 09:51:46 -07:00
gorazd-sumkovski-arm
1a17853e75 Command buffer testing fixes (#2081)
Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-10-22 09:50:20 -07:00
xinjin01
63ce937aac Fix bug in mutable_command_full_dispatch (#2118)
The test is missing clFinish after clEnqueueSVMUnmap. Add clFinish after
clEnqueueSVMUnmap.

Signed-off-by: Xin Jin <xin.jin@arm.com>
2024-10-17 07:39:38 -07:00
Ben Ashbaugh
c071db7637 fixes a narrowing warning (treated as an error) affecting some platforms (#2117)
Looks like https://github.com/KhronosGroup/OpenCL-CTS/pull/2063 has a
"narrowing" warning that is now treated as an error and is hence causing
CI builds to fail.

Applies the same fix as
https://github.com/KhronosGroup/OpenCL-CTS/pull/2107 to fix this
warning.
2024-10-16 09:18:59 +02:00
Marcin Hajder
2998463eb4 Added missing test cases for CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR queries (#2063)
According to comments from issue #1875

---------

Co-authored-by: Nikhil Joshi <nikhilj@nvidia.com>
2024-10-15 08:44:23 -07:00
Ahmed Hesham
1527c4e425 Fix warning now treated as error (#2107)
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>
2024-10-08 13:11:46 -07:00
Ewan Crawford
b64f429b4a Add new extensions to conformance csv files (#2096)
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.
2024-10-08 09:58:31 -07:00
Michal Babej
c40c8d56f6 a few fixes (thread safety & cl_khr_command_buffer UB) (#1840)
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.
2024-10-08 09:55:21 -07: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
Marcin Hajder
8c647c1cf4 Added new tests to verify negative results of clEnqueueSignalSemaphoresKHR (#2006)
According to work plan from issue
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691
2024-09-24 08:41:45 -07:00
Ben Ashbaugh
dd2117f5fc fix a few array-based mutable command buffer issues (#2074)
fixes a few minor issues introduced by #1984.

edit: Tested with the updated command buffer emulation layer on a device
that supports out-of-order queues and SVM and all of the
`test_cl_khr_mutable_dispatch` tests pass.
2024-09-17 09:34:17 -07:00
Sven van Haastregt
c32a76786c cl_khr_mutable_dispatch: fix -Wformat warnings (#2071)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-09-06 15:48:19 -07:00
Ben Ashbaugh
b57f90eeab Add properties parameter to all command-buffer commands (update) (#2072)
This is an update to #2050, with updates from the main branch.

---------

Co-authored-by: Ewan Crawford <ewan@codeplay.com>
2024-09-06 08:22:37 -07:00
Ewan Crawford
0bdc5d082f Array based clUpdateMutableCommandsKHR changes (#1984)
CTS changes to reflect the spec changes merged in
https://github.com/KhronosGroup/OpenCL-Docs/pull/1045 and requires
header updates from
https://github.com/KhronosGroup/OpenCL-Headers/pull/245

Tested using OCK implementation from
https://github.com/codeplaysoftware/oneapi-construction-kit/pull/501
2024-09-06 07:36:17 -07:00
Marcin Hajder
eb7a30ae42 Modernization of tests from test_semaphores.cpp to align with new SemaphoreTestBase infrastructure (#2029) 2024-09-03 22:53:22 +05:30
saurabhnv
7131f87974 Fix external semaphore test when exportability is not supported (#2045)
An implementation may not support exportable semaphore, subtests
available in cl_khr_external_semaphore assumes support for exportable
semaphore, resulting in failure on such implementation. Allow
implementations to use importable semaphore in such cases.
2024-09-03 10:18:39 -07:00
Marcin Hajder
d1434ae5aa Added new cl_khr_semaphore tests to verify clCreateSemaphoreWithPropertiesKHR negative results (#1962)
According to work plan from #1691, new clSemaphoreWrapper introduced to
avoid duplication of code
2024-08-06 22:48:45 +05:30
gorazd-sumkovski-arm
3c81548cba Fix issues in test_external_semaphores_cross_queues_io2 (#2036)
1. Fix memory leak by making `context2` use the context wrapper.
2. Create two separate events to associate with the two calls to
`clEnqueueSignalSemaphoresKHR()`, as events cannot be reused.

Also delete the unused helper function
`semaphore_external_cross_queue_helper()` (which was a duplicate of
`external_semaphore_cross_queue_helper()` anyway).
2024-08-06 09:33:30 -07:00
banan328
89a720d3f7 Added new tests for CL_MUTABLE_DISPATCH_ASSERT_NO_ADDITIONAL_WORK_GROUPS_KHR flag with mutable dispatch (#1991)
Added new tests for
CL_MUTABLE_DISPATCH_ASSERT_NO_ADDITIONAL_WORK_GROUPS_KHR with mutable
dispatch according to this test plan
https://github.com/KhronosGroup/OpenCL-CTS/issues/1897

Co-authored-by: Banan Ashkar <banan.ashkar@mobileye.com>
2024-08-06 09:19:49 -07:00
Marcin Hajder
7b0f4ee861 Added new cl_khr_semaphore tests to verify clReleaseSemaphoreKHR/clRetainSemaphoreKHR negative results (#1976)
According to work plan from issue #1691

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-07-16 20:38:28 +05:30
Ahmed Hesham
47546a5c4c Drop linking Vulkan directly (#2000)
The `vulkan-wrapper` helper library's purpose is to eliminate the need
to link targets directly to Vulkan, and load it dynamically instead at
runtime, using `dlopen` and `LoadLibrary`.

Remove the direct linking of the Vulkan library from targets that link
to `vulkan-wrapper`.

Fixes #1999

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-07-09 09:57:39 -07:00
Marcin Hajder
c1af7c3301 Added new tests to verify negative results of clGetSemaphoreInfoKHR (#1981)
According to work plan from issue #1691
2024-07-09 08:46:37 -07:00
Julia Jiang
6b4d57d85c Fix cts build error on mariner OS (#1872) 2024-07-02 09:40:42 -07:00
Michal Babej
769984b023 fix bugs in negative command_buffer tests (#1969)
- when calling command buffer APIs, test with `command_queue != NULL`
should return `CL_INVALID_VALUE` only if the device doesn't support
`cl_khr_command_buffer_multi_device` (added `Skip`)

- some tests enqueued commands with multiple invalid arguments, e.g.
`clCommandCopyImageToBufferKHR` with two images and invalid sync points.
AFAIK the order of argument checking is not defined, so implementation
can return any valid error value for such API calls, but the tests
assumed only one particular error would be returned. Fix the API calls
to be unambiguous.
2024-07-02 09:32:12 -07:00
Marcin Hajder
340b7c956a Added new cl_khr_semaphore tests to verify clEnqueueWaitSemaphoresKHR negative results (#1965)
According to work plan from
https://github.com/KhronosGroup/OpenCL-CTS/issues/1691

After consultations with @bashbaug I skipped this case:

`CL_INVALID_VALUE if any of the semaphore objects specified by
sema_objects requires a semaphore payload and sema_payload_list is NULL`
2024-07-02 08:43:52 -07:00
Sven van Haastregt
2b266434b7 cl_khr_kernel_clock: use create_single_kernel_helper (#1978)
`create_single_kernel_helper` invokes `clBuildProgram` and sets
`-cl-std` to the latest version supported by the context.

The vast majority of tests are using `create_single_kernel_helper`
instead of the `..._create_program` variant, so use the former for the
sake of consistency.

---------

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-06-18 09:44:40 -07:00
Kamil-Goras-Mobica
d379b58ab6 Added negative tests for clCommandCopy[Buffer, BufferRect, BufferToImage]KHR (#1941)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-06-11 08:42:29 -07:00
Marcin Hajder
806dd2fb61 Added new query for cl_khr_semaphore test to verify device handle list (#1942)
This PR addresses the first part of #1691 issue and #1875 issue.
2024-06-04 23:10:37 +05:30
Sven van Haastregt
75be6a3125 cl_khr_kernel_clock: fix builtin function names (#1968)
According to the
[specification](https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_C.html#kernel-clock-functions),
the work_group and sub_group variants have an `_` in them.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-05-29 15:14:17 -07:00
Kamil-Goras-Mobica
d53d7bc559 Added negative tests for clCommandFill[Buffer, Image]KHR (#1944)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-28 08:39:01 -07:00
Kamil-Goras-Mobica
d3e3bdabaa Negative tests clCommandSvmMem[cpy, Fill]KHR (#1956)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-22 09:18:36 +01: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
Kamil-Goras-Mobica
9500c30492 Negative tests for commandCopyImage[ToBuffer]KHR (#1943)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-21 08:40:08 -07:00
Kamil-Goras-Mobica
e6fec7417f Added negative tests for clCommandBarrierWithWaitListKHR (#1937)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-14 08:43:23 -07:00
Kamil-Goras-Mobica
5093ce5be5 Added negative test commandNDRangeKernel (#1936)
According to description
https://github.com/KhronosGroup/OpenCL-CTS/issues/1668
2024-05-14 08:42:46 -07:00
Kamil-Goras-Mobica
4c085dec4a Added negative tests for clEnqueueCommandBufferKHR (#1931)
* Added negative tests for clEnqueueCommandBufferKHR

* Added blocking the clEnqueueCommandBufferKHR call on a user event

* Added finalizing buffer before enqueuing
2024-04-21 23:45:33 -07:00
Kamil-Goras-Mobica
308fa6e78c Added negative tests for clRetainCommandBufferKHR, clReleaseCommandBu… (#1928)
* Added negative tests for clRetainCommandBufferKHR, clReleaseCommandBufferKHR, clFinalizeCommandBufferKHR

* Added blocking the clEnqueueCommandBufferKHR call on a user event

* Changed cl_event to clEventWrapper
2024-04-19 14:01:38 -07:00
Kamil-Goras-Mobica
7fa567c7a5 Corrections for negative tests for function CreateCommandBufferKHR (#1915) 2024-04-16 08:40:44 -07:00
joshqti
48b987827e Fix cross-context semaphore signals (#1886)
Multi-context test was not correctly
testing cross-context functionality.
Use semaphore import/export mechanism
to signal across contexts.
2024-04-09 08:59:49 -07:00