Commit Graph

1411 Commits

Author SHA1 Message Date
Kévin Petit
0a1456d8f9 [RFC] Move logic for test registration to the test harness (#2151)
And use in device_timer suite.

Signed-off-by: Kévin Petit <kpet@free.fr>
2024-11-26 09:55:09 -08:00
Ahmed Hesham
df5e87bf97 Use the system package manager to install cross-compilers (#2158)
On Ubuntu, use the system's package manager, `apt`, to download and
install the cross-compilers for Arm and AArch64. This replaces
downloading the compilers as tarballs.

To ensure that the correct version of the compiler is used when calling
one without the version suffix, e.g. `aarch64-linux-gnu-gcc`, use
`update-alternatives`.

On Linux, the compilers for `x86_64`, `arm`, and `aarch64` will now
correctly use the filesystem root as their sysroots, i.e. `/usr/include`
will be used when searching for headers, instead of each compiler
providing its own.
2024-11-26 09:30:41 -08:00
Ahmed Hesham
5d85fb3e3b Use cl_uint in some SPIR-V tests to avoid UB (#2159)
The following tests under `spirv_new`:
* `op_branch_conditional`
* `op_phi`
* `op_selection_merge`

were using randomly generated `cl_int` values, and storing the
difference between them as a `cl_int`. If one of the generated values is
negative and large enough, while the other is positive and large enough,
the difference then becomes a larger value that cannot be represented
using `cl_int`.

Switch the tests to use `cl_uint` instead, and update the relevant
spvasm{32,64} files to use `OpULessThan` instead of `OpSLessThan`.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2024-11-26 09:29:27 -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
Sven van Haastregt
e360d2de5b Fix various Wformat warnings (#2135)
test_copy_1D.cpp: num_mip_levels is a cl_uint, so don't cast and just
print using `%u`.

test_pipe_info.cpp: arg_type_qualifier is a 64-bit wide bitfield, so
print in hexadecimal format using the correct length modifier.

test_device_partition.cpp: it is not clear what the bit width of
`cl_device_partition_property` should be, so cast the operands to align
with the format specifiers.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-11-26 09:25:38 -08:00
Sreelakshmi Haridas Maruthur
d3b9520adc printf: add fflush(stdout) at the end (#2103)
Some platforms (Windows in our case) seem to need this.
2024-11-26 09:25:01 -08:00
joshqti
1102e0bccf Fix snorm (#2033)
When comparing scanlines for SNORM images, take into account that -1.0
can be exactly represented in two different ways.

---------

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
2024-11-26 09:24:35 -08:00
Kamil-Goras-Mobica
feca4c6354 Removed usage of half types in CTS gl tests (#2147)
see #1982
2024-11-26 08:39:42 -08:00
Ben Ashbaugh
e9a248f555 add SPIR-V 1.4 testing for OpCopyLogical (#2136)
This PR adds targeted testing for the SPIR-V 1.4 instruction
OpCopyLogical.
2024-11-25 07:35:50 -08:00
Sven van Haastregt
2358b46553 [NFC] kernelHelpers: remove unused macros and prototypes (#2156)
None of these are referenced anywhere in the code, so remove them.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-11-22 11:41:15 -08:00
Michael Rizkalla
918d561c6c Refactor test copy from and to image to buffer (#2138)
This change refactors the following files:
1. test_imagearraycopy.cpp
2. test_arrayimagecopy.cpp

The purpose of refactoring is to allow passing different buffer and
image flags to the test function as well as passing customisable test
functions.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2024-11-19 10:11:58 -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
Kamil-Goras-Mobica
265cc18843 Corrected build under msvc compiler #1833 (#2121)
Fixes #1833 according to task description.
2024-11-12 08:55:57 -08:00
Ben Ashbaugh
b149060d52 add SPIR-V 1.4 testing for various miscellaneous additions (#2122)
This PR adds targeted testing for a few remaining miscellaneous SPIR-V
1.4 features:

* Variables in the Function storage class can have a NonWriteable
decoration.
* OpCopyMemorySized can have two optional memory operands.
* OpSelect can have composite operands that are not vectors.
2024-11-11 12:39:00 -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
joshqti
5d4b51b4f2 vulkan: Remove redundant negative testing (#2078)
- negative testing for semaphore functions is accomplished in semaphore
tests, as well as create image in the api test

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-11-05 23:41:52 +05:30
saurabhnv
ef73a1d1ae Import Vulkan resources via named NT handle (#1895)
Add coverage to import Vulkan resources (memory and semaphore) in
Windows via named NT handles.
If no name is given during resource creation, then use NT handles for
import.
If a name is given, have an option to either use that name or get the NT
handle and use that for import.
Resolves KhronosGroup/OpenCL-Docs#943
2024-11-05 10:09:07 -08:00
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
David Neto
040dc5f69e kernel_image_methods: Fix size checks in 1Dbuffer case (#2106)
Image height is initialized to 0. But the size calculation should assume
a height of 1.
2024-11-05 08:53:27 -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
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
Ben Ashbaugh
c4119f07c1 add SPIR-V 1.4 testing for UserSemantic (#2053)
This PR adds targeted testing for more SPIR-V 1.4 features.
Specifically, this PR adds testing for OpDecorateString,
OpMemberDecorateString, and the UserSemantic decoration.
2024-10-31 07:12:30 -07:00
Ben Ashbaugh
d8228f0d72 remove using namespace std and use std namespace explicitly (#2125)
Removes `using namespace std` and adds `std::` explicitly instead, which
is usually on calls to `min`.

This is generally best practice, and it also might be helpful when there
are the same function names in the std namespace and in the global
namespace (e.g. #1833).
2024-10-29 09:44:49 -07: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
Harald van Dijk
7d3e1f0b82 Fix check for CL_DEVICE_HALF_FP_CONFIG. (#2108)
When cl_khr_fp16 is not supported, this property is not available.

Note that the spec is different for
CL_DEVICE_{PREFERRED,NATIVE}_VECTOR_WIDTH_HALF: those properties are
always available and return 0 if cl_khr_fp16 is not supported, so those
checks are left as is.
2024-10-29 09:41:16 -07:00
tomasz-platek
66fd9e4742 Fix for out of bounds access (#2105)
Rounding up the clusters_results size to avoid out of bounds access when
subgroup_size is not a multiple of cluster_size.
2024-10-29 09:39:42 -07:00
Sven van Haastregt
dd2454685b [NFC] math_brute_force: use getAllowedUlpError for half (#2086)
Call `getAllowedUlpError` to obtain the allowed ULP error for all of the
half type (fp16) 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
Contributes to https://github.com/KhronosGroup/OpenCL-CTS/issues/1685

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-29 09:37:51 -07:00
Ben Ashbaugh
bc5f6cdfe8 add SPIR-V 1.4 testing for OpPtrEqual, OpPtrNotEqual, OpPtrDiff (#2054)
This PR adds targeted testing for the SPIR-V 1.4 instructions
OpPtrEqual, OpPtrNotEqual, and OpPtrDiff.
2024-10-29 09:36:26 -07:00
Kamil-Goras-Mobica
b1dfe8a640 Add testing for CL_KERNEL_LOCAL_MEM_SIZE #1235 (#2089)
#1235
2024-10-29 08:55:46 -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
joshqti
899cbf5cd2 vulkan: accept device selection (#2113)
- read CL_DEVICE_TYPE_ when specified like other conformance tests
- reject non-GPU device types

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-22 22:44:57 +05:30
Sven van Haastregt
5b3bfeeca8 [NFC] relationals: fix -Wformat-security warnings (#2084)
Fix a "format string is not a string literal (potentially insecure)"
warning.

There is no security issue here as the format string argument is
constructed using a stringstream right before. Fix this occurrence
anyway to allow enabling the warning globally.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-22 18:00:38 +01:00
gorazd-sumkovski-arm
e678277c93 Add testing of CL_UNORM_INT_2_101010_EXT (#2112)
All existing tests in `test_image_streams`, that are capable of testing
image formats using the `CL_UNORM_INT_2_101010_EXT` data type, do so.

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2024-10-22 09:54:46 -07:00
Aharon Abramson
482a6bcff0 Some events are not released in test_mem_host_flags (#2104)
In test_mem_host_flags, some events are not released. In fact, they are
not used, so they can be removed altogether.
2024-10-22 09:52:31 -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
joshqti
5026b1be00 vulkan: Use image row pitch (#2077)
When importing a Vulkan external image, query and
pass OpenCL a row pitch if OpenCL is assuming linear for the imported
external handle type. Additionally fix a bug where OpenCL is being told
to create mipmapped images at all times.

---------

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-22 09:48:41 -07:00
Ben Ashbaugh
ec6394488a add SPIR-V 1.4 testing for no integer wrap decorations (#2041)
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for the NoSignedWrap and NoUnsignedWrap
decorations.

We can reuse large parts of the testing for the
`cl_khr_spirv_no_integer_wrap_decoration` extension to test the SPIR-V
1.4 feature.
2024-10-22 09:47:57 -07:00
Ben Ashbaugh
94257defea add SPIR-V 1.4 testing for Image Operands and Loop Controls (#2034)
This PR adds targeted testing for SPIR-V 1.4 features. Specifically,
this PR adds testing for:

1. The new Image Operand for SignExtend and ZeroExtend.
2. The new Loop Controls MinIterations, MaxIterations,
IterationMultiple, PeelCount, and PartialCount.
2024-10-22 09:47:31 -07:00
Sven van Haastregt
d1fe1ec252 conversions: fix condition for adding -cl-denorms-are-zero (#2067)
Commit b6941b6c ("Add fp16 testing to conversions and bruteforce
(#1975)", 2024-06-18) introduced a behavioural change for non-half
tests. The `-cl-denorms-are-zero` option could be added for non-half
tests such as `char_rtn_float` even when `gForceFTZ` was `false`. Fix
the condition by also taking the input and output types into account.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-10-22 09:45:03 -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
joshqti
115068e2c4 vulkan: Choose where Shaders are generated (#2114)
- generate shader files in VULKAN_TEST_RESOURCES directory
- allows for outside CMakeLists to specify arbitrary destination

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-15 10:17:41 -07:00
joshqti
881635a187 vulkan: Propagate fix to multiImport diffCtx (#2075)
Vulkan descriptors are being programmed incorrectly, use fix from 1676
in other subtest

Co-authored-by: dcrawley <dcrawley@qti.qualcomm.com>
2024-10-15 10:09:56 -07:00
Qichao Gu
9f54727924 Fix integer overflow in 1D buffer image tests (#2092) 2024-10-15 10:01:36 -07: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