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.
This commit is contained in:
Marcin Hajder
2025-09-02 17:38:56 +02:00
committed by GitHub
parent d417d7670d
commit fbba22770d
4 changed files with 253 additions and 42 deletions

View File

@@ -74,9 +74,11 @@ extern int
gMaxDeviceThreads; // maximum number of threads executed on OCL device
extern cl_device_atomic_capabilities gAtomicMemCap,
gAtomicFenceCap; // atomic memory and fence capabilities for this device
extern cl_half_rounding_mode gHalfRoundingMode;
extern bool gFloatAtomicsSupported;
extern cl_device_fp_atomic_capabilities_ext gHalfAtomicCaps;
extern cl_device_fp_atomic_capabilities_ext gFloatAtomicCaps;
extern const char *
get_memory_order_type_name(TExplicitMemoryOrderType orderType);
@@ -174,6 +176,13 @@ public:
{
return false;
}
virtual bool
IsTestNotAsExpected(const HostDataType &expected,
const std::vector<HostAtomicType> &testValues,
cl_uint whichDestValue)
{
return expected != testValues[whichDestValue];
}
virtual bool GenerateRefs(cl_uint threadCount, HostDataType *startRefValues,
MTdata d)
{
@@ -1449,7 +1458,7 @@ int CBasicTest<HostAtomicType, HostDataType>::ExecuteSingleTest(
startRefValues.size() ? &startRefValues[0] : 0, i))
break; // no expected value function provided
if (expected != destItems[i])
if (IsTestNotAsExpected(expected, destItems, i))
{
std::stringstream logLine;
logLine << "ERROR: Result " << i