mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 00:09:02 +00:00
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.
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "harness/testHarness.h"
|
||||
#include <mutex>
|
||||
|
||||
#include "CL/cl_half.h"
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -136,7 +135,15 @@ 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_HALF>)
|
||||
if constexpr (std::is_same_v<AtomicType, HOST_ATOMIC_FLOAT>)
|
||||
{
|
||||
static std::mutex mx;
|
||||
std::lock_guard<std::mutex> lock(mx);
|
||||
CorrespondingType old_value = *a;
|
||||
*a -= c;
|
||||
return old_value;
|
||||
}
|
||||
else if constexpr (std::is_same_v<AtomicType, HOST_ATOMIC_HALF>)
|
||||
{
|
||||
static std::mutex mx;
|
||||
std::lock_guard<std::mutex> lock(mx);
|
||||
|
||||
Reference in New Issue
Block a user