Skip to content

Commit 42e7264

Browse files
committed
GPUTracking: give Metal its own Float16_t at the conversion site
Rather than trying to adapt Ort::Float16_t to work on Metal, we simply alias it to Metal native type, which is bit-to-bit equivalent to the CUDA half implementation and differs from the software one only in the sign of NaN.
1 parent dccd039 commit 42e7264

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,18 @@ using namespace o2::gpu::tpccf;
2525
#include "CfConsts.h"
2626
#include "CfUtils.h"
2727
#include "ClusterAccumulator.h"
28+
#ifdef __METAL__
29+
namespace o2::OrtDataType
30+
{
31+
struct Float16_t {
32+
half v;
33+
Float16_t() = default;
34+
Float16_t(float f) : v(f) {}
35+
};
36+
} // namespace o2::OrtDataType
37+
#else
2838
#include "ML/3rdparty/GPUORTFloat16.h"
39+
#endif
2940

3041
#if !defined(GPUCA_GPUCODE)
3142
#include "GPUHostDataTypes.h"

0 commit comments

Comments
 (0)