From cf3b29716f564277d6cbe8e475f3dc232af8e8fd Mon Sep 17 00:00:00 2001 From: AuroraPerego Date: Thu, 17 Oct 2024 11:21:25 +0200 Subject: [PATCH] generalize warp size in pixel clustering --- .../SiPixelClusterizer/plugins/alpaka/PixelClustering.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h index 1674b56c2e97a..90b70d87c538f 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h @@ -182,8 +182,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering { TrackerTraits::maxPixInModule, TrackerTraits::clusterBits, uint16_t>; +#if defined(__HIP_DEVICE_COMPILE__) + constexpr auto warpSize = __AMDGCN_WAVEFRONT_SIZE; +#else + constexpr auto warpSize = 32; +#endif auto& hist = alpaka::declareSharedVar(acc); - auto& ws = alpaka::declareSharedVar(acc); + auto& ws = alpaka::declareSharedVar(acc); for (uint32_t j : cms::alpakatools::independent_group_elements(acc, Hist::totbins())) { hist.off[j] = 0; } @@ -254,7 +259,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering { } } alpaka::syncBlockThreads(acc); // FIXME this can be removed - for (uint32_t i : cms::alpakatools::independent_group_elements(acc, 32u)) { + for (uint32_t i : cms::alpakatools::independent_group_elements(acc, warpSize)) { ws[i] = 0; // used by prefix scan... } alpaka::syncBlockThreads(acc);