From 6837312da446bba9ce094badebb011c979f151c0 Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Wed, 31 Jul 2019 17:04:31 -0400 Subject: [PATCH] Don't use a hardcoded warp size, since it can be dynamically changed. Query it from the runtime instead. [ROCm/hip commit: fd3b6263864bcc3e57ba5d72ed6a9d29a2d83042] --- projects/hip/tests/src/deviceLib/hip_mbcnt.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/hip/tests/src/deviceLib/hip_mbcnt.cpp b/projects/hip/tests/src/deviceLib/hip_mbcnt.cpp index 343d6069d4..cd4bfa5daa 100644 --- a/projects/hip/tests/src/deviceLib/hip_mbcnt.cpp +++ b/projects/hip/tests/src/deviceLib/hip_mbcnt.cpp @@ -59,12 +59,12 @@ int main() { cout << "hip Device prop succeeded " << endl; - constexpr unsigned int wave_size = 64; constexpr unsigned int num_waves_per_block = 2; - constexpr unsigned int num_threads_per_block = wave_size * num_waves_per_block; - constexpr unsigned int num_blocks = 2; - constexpr unsigned int num_threads = num_threads_per_block * num_blocks; - constexpr size_t buffer_size = num_threads * sizeof(unsigned int); + const unsigned int wave_size = devProp.warpSize; + const unsigned int num_threads_per_block = wave_size * num_waves_per_block; + const unsigned int num_blocks = 2; + const unsigned int num_threads = num_threads_per_block * num_blocks; + const size_t buffer_size = num_threads * sizeof(unsigned int); HIP_ASSERT(hipMalloc((void**)&device_mbcnt_lo, buffer_size)); HIP_ASSERT(hipMalloc((void**)&device_mbcnt_hi, buffer_size));