From e98a5122d4fa831710775163888ab38a28403968 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Fri, 25 Sep 2026 10:32:37 +0200 Subject: [PATCH] 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. --- .../TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx index 693ee4dd78e8d..902c04e6e92f3 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx @@ -25,7 +25,18 @@ using namespace o2::gpu::tpccf; #include "CfConsts.h" #include "CfUtils.h" #include "ClusterAccumulator.h" +#ifdef __METAL__ +namespace o2::OrtDataType +{ +struct Float16_t { + half v; + Float16_t() = default; + Float16_t(float f) : v(f) {} +}; +} // namespace o2::OrtDataType +#else #include "ML/3rdparty/GPUORTFloat16.h" +#endif #if !defined(GPUCA_GPUCODE) #include "GPUHostDataTypes.h"