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.
This commit is contained in:
Marcin Hajder
2025-10-07 17:42:02 +02:00
committed by GitHub
parent 93c37f17fc
commit 51445f3743
4 changed files with 97 additions and 22 deletions

View File

@@ -99,7 +99,10 @@ template <typename AtomicType, typename CorrespondingType>
CorrespondingType host_atomic_fetch_add(volatile AtomicType *a, CorrespondingType c,
TExplicitMemoryOrderType order)
{
if constexpr (std::is_same_v<AtomicType, HOST_ATOMIC_FLOAT>)
if constexpr (
std::is_same_v<
AtomicType,
HOST_ATOMIC_FLOAT> || std::is_same_v<AtomicType, HOST_ATOMIC_DOUBLE>)
{
static std::mutex mx;
std::lock_guard<std::mutex> lock(mx);