From 7dcaf46158e7638339e9bd0ca92fbc67c3dd4c53 Mon Sep 17 00:00:00 2001 From: Gerardo Hernandez Date: Mon, 2 Jun 2025 11:41:31 +0100 Subject: [PATCH] SWDEV-535598 - reimplement ck::get_warp_size() using hipGetDeviceProperties() and not 'warpSize' --- include/ck/utility/get_id.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/ck/utility/get_id.hpp b/include/ck/utility/get_id.hpp index 77564c6130..c5bdfc8fb3 100644 --- a/include/ck/utility/get_id.hpp +++ b/include/ck/utility/get_id.hpp @@ -9,8 +9,13 @@ namespace ck { __host__ __device__ constexpr index_t get_warp_size() { - // warpSize is defined by HIP - return warpSize; + hipDeviceProp_t props; + hipError_t status = hipGetDeviceProperties(&props, get_device_id()); + + if(status != hipSuccess) + throw std::runtime_error("Failed to get device properties when trying to get warp size"); + + return props.warpSize; } __device__ index_t get_thread_local_1d_id() { return threadIdx.x; }