From fad5a4bafbf62c10224e028f96f1034a6d716372 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:22:01 +0200 Subject: [PATCH] GPU: launch bound helpers for Metal Metal has no launch bounds, so the thread and warp count helpers pass the value through rather than deriving it from a kernel attribute. Metal also lacks variadic arguments for C functions, so one need to implement that using templates. --- GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h b/GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h index 8a54ab2163eab..6dcd5c19d9863 100644 --- a/GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h +++ b/GPU/GPUTracking/Definitions/GPUDefParametersWrapper.h @@ -28,8 +28,8 @@ namespace o2::gpu { #if defined(GPUCA_GPUCODE) && !defined(GPUCA_GPUCODE_NO_LAUNCH_BOUNDS) - GPUhdi() static constexpr uint32_t GPUCA_GET_THREAD_COUNT(uint32_t val, ...) { return val; } - GPUhdi() static constexpr uint32_t GPUCA_GET_WARP_COUNT(uint32_t val, ...) { return val / GPUCA_WARP_SIZE; } + template GPUhdi() static constexpr uint32_t GPUCA_GET_THREAD_COUNT(uint32_t val, Args...) { return val; } + template GPUhdi() static constexpr uint32_t GPUCA_GET_WARP_COUNT(uint32_t val, Args...) { return val / GPUCA_WARP_SIZE; } #else static constexpr uint32_t GPUCA_WARP_SIZE = 1; // On the host, a thread is a block is a warp, and we run 1 "device thread" per block. #define GPUCA_GET_THREAD_COUNT(...) 1 // This must be a define not a constexpr function