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.
This commit is contained in:
Marcin Hajder
2025-06-10 17:43:02 +02:00
committed by GitHub
parent 3233d2089f
commit b79a8a2f42
2 changed files with 54 additions and 6 deletions

View File

@@ -164,7 +164,10 @@ CorrespondingType host_atomic_load(volatile AtomicType *a,
TExplicitMemoryOrderType order)
{
#if defined( _MSC_VER ) || (defined( __INTEL_COMPILER ) && defined(WIN32))
return InterlockedExchangeAdd(a, 0);
if (sizeof(CorrespondingType) == 2)
auto prev = InterlockedOr16(reinterpret_cast<volatile SHORT *>(a), 0);
else
return InterlockedExchangeAdd(reinterpret_cast<volatile LONG *>(a), 0);
#elif defined(__GNUC__)
return __sync_add_and_fetch(a, 0);
#else