Commit Graph

32 Commits

Author SHA1 Message Date
Yilong Guo
119af24d54 c11_atomics: unify host half representation and conversion with wrapper class (#2503)
Introduce `HostHalf` wrapper class to eliminate explicit
`cl_half_from_float`
and `cl_half_to_float` conversions throughout the test code. The wrapper
provides semantic value constructors/operators and automatic
conversions,
simplifying half-precision arithmetic operations.

Key improvements:
- `HostHalf` class with operator overloading for arithmetic and
comparisons
- Type traits `is_host_atomic_fp_v` and `is_host_fp_v` for generic FP
handling
- Unified floating-point atomic operations (add/sub/min/max/exchange)
- Removed 300+ lines of half-specific conditional branches
- Consistent calculation for all FP types
2025-12-16 08:37:33 -08:00
Marcin Hajder
0cca0ee869 Added support for cl_ext_float_atomics in CBasicTestFetchSub with atomic_double (#2368)
Related to #2142, according to the work plan, extending
CBasicTestFetchSub with support for atomic_double.
2025-12-02 08:39:16 -08:00
Marcin Hajder
d0aa95be2f Added support for cl_ext_float_atomics in CBasicTestFetchSub with atomic_float (#2367)
Related to #2142, according to the work plan, extending
CBasicTestFetchSub with support for atomic_float.
2025-10-28 08:41:24 -07:00
Marcin Hajder
52ba127f79 Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_double (#2361)
Related to #2142, according to the work plan, extending
CBasicTestFetchMin/CBasicTestFetchMax with support for atomic_double.
2025-10-28 08:40:13 -07:00
Marcin Hajder
62972418c3 Added support for cl_ext_float_atomics in CBasicTestFetchAdd with atomic_half (#2350)
Related to https://github.com/KhronosGroup/OpenCL-CTS/issues/2142,
according to the work plan, extending CBasicTestFetchAdd with support
for atomic_half.

I wasn't able to test that PR completely due to missing
`CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT`/`CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT`
capabilities for atomic_half. I appreciate reviewers' attention, thanks.
2025-10-22 07:01:48 -07:00
Marcin Hajder
940c8bb973 Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_half (#2357)
Related to #2142, according to the work plan, extending
CBasicTestFetchMin/CBasicTestFetchMax with support for atomic_half.
2025-10-21 08:43:05 -07:00
Kévin Petit
34745bd936 Disable {svm_,}atomic_fence tests (#2545)
As agreed in 2025/10/14 teleconference. See #2544.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2025-10-14 09:58:40 -07:00
Grzegorz Wawiorko
d733c2b802 c11_atomics: Fix verification loop (#2543)
Looks like bug. @shajder Could you look at this fix? Thanks
2025-10-14 08:39:54 -07:00
Marcin Hajder
51445f3743 Added support for cl_ext_float_atomics in CBaseTestFetchAdd with atomic_double (#2347)
Related to https://github.com/KhronosGroup/OpenCL-CTS/issues/2142,
according to the work plan, extending CBasicTestFetchAdd with support
for atomic_double.
2025-10-07 08:42:02 -07:00
Marcin Hajder
df61cad39f Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_float (#2353)
Related to #2142, according to the work plan, extending
`CBasicTestFetchMin`/`CBasicTestFetchMax` with support for atomic_float.
2025-09-09 08:45:35 -07:00
Marcin Hajder
1aeca1360b Added support for cl_ext_float_atomics in CBasicTestFetchSub with atomic_half (#2366)
Related to #2142, according to the work plan, extending
CBasicTestFetchSub with support for atomic_half.

I wasn't able to test that PR entirely due to missing
CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT/CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT
capabilities for atomic_half. I appreciate reviewers' attention, thanks.
2025-09-09 08:40:50 -07:00
Marcin Hajder
fbba22770d Added support for cl_ext_float_atomics in CBasicTestFetchAdd with atomic_float (#2345)
Related to #2142, according to the work plan, extending
CBasicTestFetchAdd with support for atomic_float.
2025-09-02 08:38:56 -07:00
Marcin Hajder
550b14cd25 Added support for cl_ext_float_atomics in c11_atomics exchange test along with atomic_half type (#2337)
Related to #2142, according to the work plan, extending
CBasicTestExchange with support for atomic_half.
2025-06-24 08:37:50 -07:00
Marcin Hajder
b79a8a2f42 Added support for cl_ext_float_atomics in c11_atomics load test along with atomic_half type (#2297)
Related to #2142, according to the work plan, extending CBasicTestLoad
with support for atomic_half.
2025-06-10 08:43:02 -07:00
Marcin Hajder
dec5644112 Added support for cl_ext_float_atomics in c11_atomics store test along with atomic_half type (#2293)
Related to #2142, according to the work plan extended `CBasicTestStore`
with support for `atomic_half`.

Optimization remark: in tests related to `CBasicTestStore` kernel source
code is mostly composed with arguments following similar pattern:

`__kernel void test_atomic_kernel(uint threadCount, uint numDestItems,
__global int *finalDest, __global int *oldValues, volatile __local
atomic_int *destMemory)`

`oldValues` buffer is initialized with a host pointer, after kernel
execution it is read back to the host pointer but it is unused in
neither of the kernels I verified.
2025-05-27 08:51:36 -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
Sreelakshmi Haridas Maruthur
c8ebba8699 c11_atomics: Reduce the loopcounter for sequential consistency tests (#1853)
Reduce the loop from 1000000 to 500000 since the former value
makes the test run too long and cause system issues on certain
platforms
2023-12-12 09:38:14 -08:00
Sven van Haastregt
d7f24a7986 Fix more -Wsign-compare warnings (#1779)
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2023-09-14 11:00:30 +01:00
Finlay
691a45d605 c11 atomic fence: relaxed requirements for an auxiliary atomic_store (#1603) 2023-01-31 09:47:47 -08:00
Sven van Haastregt
8bb69ef665 Fix -Wformat-extra-args warnings (#1533)
Fix a few instances where an incorrect number of arguments was
supplied when calling (v)log_error.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2022-11-01 13:09:48 -07:00
Ahmed
388944c01c Minimum 2 non atomic variables per thread for the c11 atomic fence test for embedded profile devices. (#1452)
* Minimum 2 Non atomic variables per thread for an embedded profile device - https://github.com/KhronosGroup/OpenCL-CTS/issues/1274

* Formatting
2022-09-06 09:53:12 -07:00
Jeremy Kemp
1f26e1d8ba Fix memory model issue in atomic_flag. (#1283)
* Fix memory model issue in atomic_flag.

In atomic_flag sub-tests that modify local memory, compilers may re-order memory accesses between the local and global address spaces which can lead to incorrect test failures.

This commit ensures that both local and global memory operations are fenced to prevent this re-ordering from occurring.

Fixes #134.

* Clang format changes.

* Added missing global acquire which is necessary for the corresponding global release.

Thanks to @jlewis-austin for spotting.

* Clang format changes.

* Match the condition for applying acquire/release fences.
2021-09-07 12:47:44 +01:00
Alastair Murray
8894e7f046 Add memory_scope_all_devices testing (#999)
* Add memory_scope_all_devices testing

This duplicats memory_scope_all_svm_devices testing, but it seems pretty quick
so I don't think it hurts.

Fixes #990

* Address clang-format failures

* Address a further clang-format failure
2020-10-30 15:01:48 +00:00
Jack Frankland
61cfb505ae Skip atomic_flag Test on for OpenCL-3.0 not Supporting Device Scope (#954)
* The `atomic_flag` test assumes support for the `atomic_scope_device`
scope in the global scope test case. Since `atomic_scope_device` is
optional on an OpenCL-3.0 driver, this test should check for support and
skip otherwise.
2020-09-22 09:26:05 -07:00
Jack Frankland
9178524d02 Change Behaviour of C11 Atomic Tests for OpenCL-3.0 (#944)
* Change setup code in `KernelCode()` to use `_explicit` builtin
variants that are common to both OpenCL-2.X and OpenCL-3.0.

* Only test optional supported builtin variants (`_explicit` signature
 memory_order/scope) for OpenCL-3.0.

* Disable program scope global variable and generic address space tests
for a OpenCL-3.0 driver which does not optionally support these
features.
2020-09-22 09:08:32 -07:00
Jeremy Kemp
1e411b888f Memory consistency model optionality (#907)
* Test minimum memory consistency capabilities for a device reporting >= 3.0.

Skip tests where unsupported memory consistency capabilities are being requested.

* Pass nullptr as program build option.

Allows the CTS framework to select an appropriate CL C version.

* Removed redundant braces.
2020-08-31 15:12:10 -07:00
Jeremy Kemp
a83f7c3ed8 c11_atomics: do not overallocate local memory for embedded devices #690. (#691)
The spec states that the minimum amount of local memory for embedded devices is 1KB. This change clamps work group sizes to 1024 for embedded devices, and sets the number of local variables per thread to 1.

Fixes #690.
2020-03-26 17:56:26 +00:00
Kevin Petit
ef832c330c Stop using ../../test_common to include common headers
Fixes #395.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2019-08-01 18:41:12 +01:00
Wenju He
e7586a7a78 c11_atomics: fix ambiguous call atomic_fetch_add (#361)
Cast operand type to AddSubOperandType.
2019-07-05 11:37:00 +01:00
Radek Szymanski
07196c351a cl22: Use single array for function list (#148)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
2019-04-10 12:30:38 +01:00
Kevin Petit
95b040bec2 Synchronise with Khronos-private Gitlab branch
The maintenance of the conformance tests is moving to Github.

This commit contains all the changes that have been done in
Gitlab since the first public release of the conformance tests.

Signed-off-by: Kevin Petit kevin.petit@arm.com
2019-03-05 16:24:50 +00:00
Kedar Patil
2821bf1323 Initial open source release of OpenCL 2.2 CTS. 2017-05-16 18:44:33 +05:30