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.
This commit is contained in:
Marcin Hajder
2025-12-02 17:39:16 +01:00
committed by GitHub
parent 2bb364bb1d
commit 0cca0ee869
3 changed files with 102 additions and 25 deletions

View File

@@ -135,7 +135,10 @@ template <typename AtomicType, typename CorrespondingType>
CorrespondingType host_atomic_fetch_sub(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_DOUBLE> || std::is_same_v<AtomicType, HOST_ATOMIC_FLOAT>)
{
static std::mutex mx;
std::lock_guard<std::mutex> lock(mx);