Added support for cl_ext_float_atomics in CBasicTestFetchMin/Max with atomic_float (#2353)

Related to #2142, according to the work plan, extending
`CBasicTestFetchMin`/`CBasicTestFetchMax` with support for atomic_float.
This commit is contained in:
Marcin Hajder
2025-09-09 17:45:35 +02:00
committed by GitHub
parent a0bd81d574
commit df61cad39f
4 changed files with 348 additions and 64 deletions

View File

@@ -24,8 +24,9 @@
#include "CL/cl_half.h"
#include <vector>
#include <iomanip>
#include <sstream>
#include <vector>
#define MAX_DEVICE_THREADS (gHost ? 0U : gMaxDeviceThreads)
#define MAX_HOST_THREADS GetThreadCount()
@@ -892,14 +893,15 @@ 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_HALF)
ss << _startValue;
else
== 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)));
else
ss << _startValue;
for (cl_uint i = 0; i < maxNumDestItems; i++)
{
if (aTypeName == "atomic_flag")