Added support for cl_ext_float_atomics in CBasicTestFetchAddSpecialFloats with atomic_double (#2388)

Related to #2142, according to the work plan, extending
CBasicTestFetchAddSpecialFloats with support for atomic_double.
This commit is contained in:
Marcin Hajder
2026-02-24 17:37:29 +01:00
committed by GitHub
parent 662e53b60d
commit 5673883005
3 changed files with 86 additions and 27 deletions

View File

@@ -77,6 +77,7 @@ extern int
extern cl_device_atomic_capabilities gAtomicMemCap,
gAtomicFenceCap; // atomic memory and fence capabilities for this device
extern cl_device_fp_config gDoubleFPConfig;
extern cl_device_fp_config gFloatFPConfig;
extern cl_device_fp_config gHalfFPConfig;
@@ -924,12 +925,15 @@ CBasicTest<HostAtomicType, HostDataType>::ProgramHeader(cl_uint maxNumDestItems)
+ ss.str() + "] = {\n";
ss.str("");
if constexpr (std::is_same_v<HostDataType, HOST_FLOAT>)
if constexpr (
std::is_same_v<
HostDataType,
HOST_ATOMIC_DOUBLE> || std::is_same_v<HostDataType, HOST_ATOMIC_FLOAT>)
{
if (std::isinf(_startValue))
ss << (_startValue < 0 ? "-" : "") << "INFINITY";
else if (std::isnan(_startValue))
ss << "0.0f / 0.0f";
ss << "0.0 / 0.0";
else
ss << std::setprecision(
std::numeric_limits<HostDataType>::max_digits10)