Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_half (#2357)

Related to #2142, according to the work plan, extending
CBasicTestFetchMin/CBasicTestFetchMax with support for atomic_half.
This commit is contained in:
Marcin Hajder
2025-10-21 17:43:05 +02:00
committed by GitHub
parent 34745bd936
commit 940c8bb973
4 changed files with 167 additions and 25 deletions

View File

@@ -894,15 +894,16 @@ CBasicTest<HostAtomicType, HostDataType>::ProgramHeader(cl_uint maxNumDestItems)
header += std::string("__global volatile ") + aTypeName + " destMemory["
+ ss.str() + "] = {\n";
ss.str("");
if (CBasicTest<HostAtomicType, HostDataType>::DataType()._type
== TYPE_ATOMIC_FLOAT)
ss << std::setprecision(10) << _startValue;
else if (CBasicTest<HostAtomicType, HostDataType>::DataType()._type
== TYPE_ATOMIC_HALF)
ss << static_cast<HostDataType>(
cl_half_to_float(static_cast<cl_half>(_startValue)));
ss << cl_half_to_float(static_cast<cl_half>(_startValue));
else
ss << _startValue;
for (cl_uint i = 0; i < maxNumDestItems; i++)
{
if (aTypeName == "atomic_flag")