Commit Graph

1419 Commits

Author SHA1 Message Date
Michael Rizkalla
e61da21cd6 Fix using incorrect free function in arrayimagecopy and imagearraycopy basic tests' unique_ptr (#2177)
This change addresses a free function mis-match issue where `delete` is
used to free memory allocated via `malloc` within `create_random_data`
and in the test function.

The change involves the following tests:
1. arrayimagecopy
2. arrayimagecopy3d
3. imagearraycopy
4. imagearraycopy3d

This should address #2173

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2024-12-17 09:30:48 +01:00
Ahmed Hesham
7d9ecaaf73 Migrate vectors suite to the new test registration framework (#2190)
Contributes to #2181
2024-12-13 16:47:01 +00:00
Ahmed Hesham
2fe382ec8a Migrate atomics suite to the new test registration framework (#2189)
Contributes to #2181
2024-12-13 16:33:56 +00:00
Kévin Petit
5b7af4b36d [NFC] Change the name of the default device provided by the new registration framework (#2186)
The code base uses a mix of 'device' and 'deviceID'. I suggest we
standardise on 'device' which is shorter and slightly more prevalent.

Contributes to #2181

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2024-12-12 13:24:04 -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
Ben Ashbaugh
d99b302f90 switch SVM tests to the new test registration framework (#2168)
Switches the SVM tests to the new test registration framework.

The first commit is the best to review and contains the actual changes.
The second commit purely has formatting changes.

Note that several of these changes were a bit more than mechanical
because many of the SVM tests create a new context vs. using the context
provided by the harness and passed to each test function. The previous
code named the context provided by the harness differently, and hence
could use the name "context" in each test function, but with the new
test registration framework this is no longer possible. Instead, I am
creating the new context using the name "contextWrapper" and then
assigning it to the "context" passed to the test function, which seems
like the best way to avoid using the wrong context unintentionally. I am
open to suggestions to do this differently.

I have verified that the same calls are made before and after these
changes, and specifically that there are no context leaks.
2024-12-03 14:51:23 -08:00
Ahmed Hesham
e361b387d9 Add Android to the CI build matrix (#2165)
Support building for Android on Arm and AArch64 platforms.

Modify the build matrix to add to new variations. Both variants
download, extract and setup the Android Native Development Kit (NDK) on
a Linux runner. Each variant specifies a `android_arch_abi`, which is
passed to CMake during configuration as its `CMAKE_ANDROID_ARCH_ABI`
option.

The CMake toolchain file provided by the NDK is used when building for
Android. The NDK version used is r27c, which is the latest Long-Term
Support (LTS) version. `ANDROID_PLATFORM` is intentionally not set, so
the NDK can default to the minimum supported version, which is 21. The
compiler (Clang) version used by this NDK is 18.0.3.

The NDK ships with its own sysroot, which has the Linux kernel headers
of version 6.8.0, or `LINUX_VERSION_CODE 395264`.

CMake
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#id23
https://cmake.org/cmake/help/latest/variable/CMAKE_ANDROID_ARCH_ABI.html

NDK
https://developer.android.com/ndk/downloads
2024-12-03 08:56:46 -08:00
Sreelakshmi Haridas Maruthur
3bdd2f99b5 cl_fill_image: Use CL_DEVICE_VERSION instead of CL_DEVICE_NUMERIC_VER… (#2043)
…SION

CL_DEVICE_NUMERIC_VERSION is only available from OpenCL 3.0 Use
CL_DEVICE_VERSION instead.
2024-12-03 08:55:37 -08:00
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