Commit Graph

1520 Commits

Author SHA1 Message Date
Ben Ashbaugh
3f15fcab9e add tests for clGetSVMPointerInfoKHR with a non-USVM pointer (#2280)
Note, this PR is setup to merge to the `cl_khr_unified_svm` branch.

Querying a non-USVM pointer should return default values and should not
return an error. This is the next item on the `cl_khr_unified_svm` test
plan.
2025-03-18 10:51:39 -07:00
Ben Ashbaugh
debc466d40 Merge branch 'main' into cl_khr_unified_svm 2025-03-16 14:12:26 -07:00
Ben Ashbaugh
e96b510aa0 Merge branch 'main' into cl_khr_unified_svm 2025-03-16 13:58:54 -07:00
Kévin Petit
bb604702a5 Migrate workgroups suite to the new test registration framework (#2308)
Contributes to #2181

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-03-11 22:00:38 +00:00
Ahmed Hesham
641ffeaa67 Migrate half suite to the new test registration framework (#2329)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-11 22:00:23 +00:00
Ahmed Hesham
ba95285a0e Migrate contractions suite to the new test registration framework (#2321)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-11 21:58:52 +00:00
Ahmed Hesham
c4fa48db05 Migrate events suite to the new test registration framework (#2324)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-11 21:57:59 +00:00
Ahmed Hesham
bb331c2c92 Migrate device_execution suite to the new test registration framework (#2323)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-11 21:54:22 +00:00
Ahmed Hesham
671ea7b286 Migrate computeinfo suite to the new test registration framework (#2320)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-11 21:52:28 +00:00
Kévin Petit
13b82d1833 Migrate non_uniform_work_group suite to the new test registration framework (#2317)
Contributes to #2181

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-03-11 21:48:14 +00:00
Kévin Petit
132ba21a3c Migrate mem_host_flags suite to the new test registration framework (#2314)
Contributes to #2181

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-03-11 21:47:58 +00:00
Kévin Petit
c4179d0f6a Migrate thread_dimensions suite to the new test registration framework (#2309)
Contributes to #2181

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-03-11 21:46:38 +00:00
Kévin Petit
3a275fe81b Always enable beta extensions (#2330)
`CL_ENABLE_BETA_EXTENSIONS` was just introduced in
https://github.com/KhronosGroup/OpenCL-Headers/pull/276
to guard provisional and other experimental extensions. The CTS
currently assumes
all definitions are always present.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2025-03-11 11:40:29 -07:00
Kévin Petit
30f9a5eb21 Remove .gitattributes (#2310)
We don't use git lfs. We have no .7z files in the repo.

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-03-10 22:16:21 -07:00
Ahmed Hesham
2d0fda0179 Migrate c11_atomics suite the new test registration framework (#2318)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-10 09:55:24 +00:00
Ahmed Hesham
fbeebac9d5 Migrate buffers suite to the new test registration framework (#2315)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-09 09:59:01 +00:00
Ahmed Hesham
3f7774b089 Migrate subgroups suite to the new test registration framework (#2313)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-09 09:53:47 +00:00
Ahmed Hesham
aed6c3a214 Migrate relationals suite to the new test registration framework (#2312)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-09 09:49:24 +00:00
Ahmed Hesham
6eb1aa1d0a Migrate printf suite to the new test registration framework (#2311)
Contributes to #2181.

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-09 09:44:59 +00:00
Ahmed Hesham
5b47d4b19f Migrate pipes suite to the new test registration framework (#2302)
Contributes to #2181

Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
2025-03-09 09:42:10 +00:00
Ahmed Hesham
521d067083 Migrate device_partition suite to the new test registration framework (#2301)
Contributes to #2181
2025-03-08 22:37:04 +00:00
Romaric Jodin
11db332281 fix error message in work_item_functions_out_of_range (#2303)
The value printed in the error message is not the correct one (used in
the comparison statement)
2025-03-07 23:43:00 +00:00
Ben Ashbaugh
637deb0011 add missing Float16 capability (#2304)
A recent improvement to the SPIR-V validator added checks to ensure the
**Float16** capability is declared when directly operating on fp16
values, which identified issues in one of our SPIR-V test files. This PR
fixes the SPIR-V files to add the missing capability.
2025-03-07 10:08:58 -08:00
Ben Ashbaugh
6a36bd9d5c add SPIR-V 1.6 testing for UniformDecoration decorations (#2254)
Adds a basic test for the SPIR-V 1.6 UniformDecoration decorations.
Specifically:

* Tests both the Uniform and UniformId decorations.
* Tests the decorations on constants, function parameters, and
variables.
2025-03-05 08:29:26 -08:00
Michael Rizkalla
9a5041a25b Fix inconsistent variable name in REGISTER_TEST and REQUIRE_EXTENSION (#2296)
Both `REGISTER_TEST` and `REQUIRE_EXTENSION` expect cl_device_id
variable but the variable name is inconsistent which makes both macros
unusable together.

This change renames `deviceID` in `REQUIRE_EXTENSION` to `device` to be
consistent with `REGISTER_TEST`.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-04 16:53:50 -08:00
Sven van Haastregt
733cc78c39 spirv_new: ensure int64 printf test uses 64 bits (#2295)
The `extinst_printf_operands_scalar_int64` test could fail on 32-bit
platforms with `CL_INVALID_ARG_SIZE`, because the helper function was
not guaranteed to be instantiated using a 64-bit integer template type.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-03-04 16:53:25 -08:00
Sven van Haastregt
7feb93cdd7 math_brute_force: treat reciprocal as unary function (#2281)
Treat reciprocal as a unary function, instead of handling it through the
binary function testing mechanism and special-casing it there.

This addresses two shortcomings of the previous implementation:

- Testing took significantly longer as the entire input domain was
tested many times (e.g. fp16 reciprocal has only 2^16 possible input
values, but binary function testing iterates over 2^16 * 2^16 input
values).

- The reciprocal test kernel was identical to the divide kernel. Thus
the device compiler would see a regular divide operation instead of a
reciprocal operation and would be unlikely to emit a specialized
reciprocal sequence.

This reverts all of the changes in binary_operator*.cpp made by
bcfa1f7c2 ("Added corrections to re-enable reciprocal test in
math_brute_force suite for relaxed math mode (#2221)", 2025-02-04).

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-03-04 16:52:28 -08:00
Michael Rizkalla
5167d7202b Fix signalling and waiting on semaphore from two queues (#2271)
`semaphores_ooo_ops_cross_queue` uses two OOO command queues to run the
test. In one queue, a semaphore is signalled and the semahpore is waited
on in the other queue.

The CL specification requires the application to synchronize the queues
if objects are shared.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-03-04 16:51:18 -08:00
Ahmed Hesham
5a65278613 Fix compilation failure caused by DMA heaps (#2292)
Project fails to build on systems with a kernel version older than 5.6.0
because of `-Wunused-function` combined with `-Werror`.

Expand the conditional compilation guard to include the offending code.
2025-02-27 07:30:08 -08: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
Ahmed Hesham
9ba6f062d4 Add support for allocating DMA buffers (#2170)
This adds support for allocating DMA buffers on systems that support it,
i.e. Linux and Android.

On mainline Linux, starting version 5.6 (equivalent to Android 12),
there is a new kernel module framework available called [DMA-BUF
Heaps](https://github.com/torvalds/linux/blob/master/drivers/dma-buf/dma-heap.c).
The goal of this framework is to provide a standardised way for user
applications to allocate and share memory buffers between different
devices, subsystems, etc. The main feature of interest is that the
framework provides device-agnostic allocation; it abstracts away the
underlying hardware, and provides a single IOCTL,
`DMA_HEAP_IOCTL_ALLOC`. Mainline implementation provides two heaps that
act as character devices that can allocate DMA buffers; system, which
uses the buddy allocator, and cma, which uses the
[CMA](https://developer.toradex.com/software/linux-resources/linux-features/contiguous-memory-allocator-cma-linux/)
(Contiguous Memory Allocator). Both of these are [kernel configuration
options](https://github.com/torvalds/linux/blob/master/drivers/dma-buf/heaps/Kconfig)
that need to be enabled when building the Linux kernel. Generally, any
kernel module implementing this framework is made available under
/dev/dma_heaps/<heap_name>, e.g. /dev/dma_heaps/system.

The implementation currently only supports one type of DMA heaps;
`system`, the default device path for which is `/dev/dma_heap/system`.
The path can be overridden at runtime using an environment variable,
`OCL_CTS_DMA_HEAP_PATH_SYSTEM`, if needed. Extending this in the future
should be trivial (subject to platform support), by adding an entry to
the enum `dma_buf_heap_type`, and an appropriate default path and
overriding environment variable name.

The proposed implementation will conditionally compile if the conditions
are met (i.e. building for Linux or Android, using kernel headers >=
5.6.0), and will provide a compile-time warning otherwise, and return
`-1` as the DMA handle in runtime if not.

To demonstrate the functionality, a new test is added for the
`cl_khr_external_memory_dma_buf` extension. If the extension is
supported by the device, a DMA buffer will be allocated and used to
create a CL buffer, that is then used by a simple kernel.

This should provide a way forward for adding more tests that depend on
DMA buffers.

---------

Signed-off-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
Co-authored-by: Gorazd Sumkovski <gorazd.sumkovski@arm.com>
2025-02-26 09:51:22 -08:00
Sreelakshmi Haridas Maruthur
6419744d76 printf: Fix the format specifier for %A to add the decimal point (#2290) 2025-02-25 12:54:53 -08:00
Ahmed
803e665683 Correct reference for fma for RTZ devices for half (#2269)
The reference was always being calculated using round to nearest even
for fma when testing half precision.

Fixes https://github.com/KhronosGroup/OpenCL-CTS/issues/2224
2025-02-25 12:54:26 -08:00
Marcin Hajder
c84b712366 Added object comparability verification for program devices query (#2237)
Fixes #1485 according to work plan from issue description.
2025-02-25 08:48:05 -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
Marcin Hajder
0ddfbbe673 Added object comparability verification for context devices query (#2176)
Fixes #1485 according to work plan, point `CL_CONTEXT_DEVICES`
2025-02-25 08:42:09 -08:00
Sreelakshmi Haridas Maruthur
32361e1d89 bruteforce: Check both input values for nan (#2270) 2025-02-18 20:51:36 -08:00
zzk0
bdd0eb0b7e bugfix nan test for basic fpmath (#2268)
This PR fixes the validation logic for cases where the data type is not
half. Because the variable nan_test is always false, types like float
never trigger a validation failure.
2025-02-18 20:51:19 -08:00
Michael Rizkalla
6d3d199b42 Deduplicate create_image from Copy/Fill image tests (#2262)
1. Remove duplicate `create_image` code that is in both clFillImage and
clCopyImage test directories.
2. Unify how pitch buffer's memory is deallocated; The buffer can be
allocated with either `malloc` or `align_malloc` and the free function
is pre-set in `pitch_buffe_data`'s member variable `free_fn` and used
when the buffer is deallocated. With this, the change removes
`is_aligned` conditional variable that was used to select the
appropriate free function.

Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>
2025-02-18 20:50:43 -08:00
Romaric Jodin
84fd99da76 fix profiling execute_multipass (#2239)
- fix clGetDeviceInfo(CL_DEVICE_MAX_WORK_ITEM_SIZES) by using the proper
size

- clamp localThreads[2] as for localThreads[0] and localThreads[2]

- clamp all localThreads elements in regard of CL_MAX_WORK_GROUP_SIZE

- fix the size using to create/read the output buffer

Fix #2238
v2025-02-19-00
2025-02-18 20:49:12 -08:00
Sreelakshmi Haridas Maruthur
8c298b1c3b printf: Fix printf 'mixed_format_random' (#2236)
%a or %A with printf on MSVC platforms have a default precision of 13,
which is in contrast to OpenCL C specification for printf which only
allows for exact digits required if precision is not specified.
2025-02-18 20:48:26 -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
Kévin Petit
9216c81855 Migrate test_vulkan to the new registration framework (#2278)
Signed-off-by: Kévin Petit <kpet@free.fr>
2025-02-19 00:24:03 +05:30
Kévin Petit
24597e0145 Report external sharing tests as skipped instead of failed when not supported (#2277)
Throwing an exception in the constructor for VulkanTestBase was always
reported as an error.

Signed-off-by: Kévin Petit <kpet@free.fr>
2025-02-19 00:22:44 +05:30
Sven van Haastregt
46dcf18a18 spirv_new: print build log in get_program_with_il (#2274)
Print the build log when building the program in `get_program_with_il`
fails, to make it easier to investigate spirv_new test failures.

Factor out a global helper function `OutputBuildLog` for printing the
build log for a single device.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-18 09:13:01 -08:00
Sven van Haastregt
ea934a7648 basic: fix size_t Wformat warnings (#2264)
Printing of a `size_t` requires the `%zu` specifier.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-18 09:11:32 -08:00
Ben Ashbaugh
9c5999bc1d add SPIR-V 1.6 testing for Nontemporal Image Operand (#2249)
Adds a basic test for reading from and writing to an image with the
optional Nontemporal image operand.
2025-02-18 09:10:09 -08:00
Ben Ashbaugh
9b247c06be fix several compile issues with Visual Studio toolchains (#2219)
Fixes several compile issues I am seeing for my version of Visual Studio
related to an ambiguous call to `fpclassify`, which is called by `isnan`
and other similar functions, specifically for the `cl_half` type:

```
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): error C2668: 'fpclassify': ambiguous call to overloaded function
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(298,31): message : could be 'int fpclassify(long double) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(293,31): message : or       'int fpclassify(double) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(288,31): message : or       'int fpclassify(float) throw()'
19>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\corecrt_math.h(401,1): message : while trying to match the argument list '(_Ty)'
```

Some of these issues seem like differences in compiler behavior, but at
least one appears to have identified a legitimate bug.

Specifically, this change:

* Removes the special-case checks for finite half numbers for commonfns,
since this is already handled by `UlpFn`. (test with: `test_commonfns
degrees radians`)
* Assigns to temporary variables to eliminate the ambiguous function
call for relationals. (test with: `test_relationals relational*`)
* Properly converts from half to float when checking for NaNs for
select. This is the one that seems like a legitimate bug. (test with:
`test_select select_half_ushort select_half_short`)
* Uses `std::enable_if` to disambiguate a function call for spirv_new.
(test with: `test_spirv_new decorate_saturated*`)

If it's helpful, my specific Visual Studio version is:

```
Microsoft Visual Studio Professional 2019
Version 16.11.20
VisualStudio.16.Release/16.11.20+32929.386
```

I also have the Windows Software Development Kit 10.0.19041.685
installed.
2025-02-18 09:09:17 -08:00
Sven van Haastregt
9f63decb9c basic: add missing newline at end of error messages (#2275)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2025-02-13 07:24:51 -08:00
Ben Ashbaugh
d08eea3b1e Merge branch 'main' into cl_khr_unified_svm 2025-02-11 13:14:23 -08:00