From b5f9d2f8183ff3b461b60fd16a97b28ec16d993e Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Fri, 8 May 2020 11:08:08 -0400 Subject: [PATCH] Correct HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK query We should be returning the max workgroup size calculated by the compiler. Change-Id: If86590efbb9b291f470bdbe87e5df992e661c539 --- hipamd/rocclr/hip_module.cpp | 3 +-- hipamd/rocclr/hip_platform.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hipamd/rocclr/hip_module.cpp b/hipamd/rocclr/hip_module.cpp index 95c6fc6475..a26249eabb 100755 --- a/hipamd/rocclr/hip_module.cpp +++ b/hipamd/rocclr/hip_module.cpp @@ -317,8 +317,7 @@ hipError_t hipFuncGetAttribute(int* value, hipFunction_attribute attrib, hipFunc *value = static_cast(wrkGrpInfo->localMemSize_); break; case HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: - *value = static_cast(wrkGrpInfo->wavefrontPerSIMD_ - * wrkGrpInfo->wavefrontSize_); + *value = static_cast(wrkGrpInfo->size_); break; case HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: *value = 0; diff --git a/hipamd/rocclr/hip_platform.cpp b/hipamd/rocclr/hip_platform.cpp index b7768b7330..c250daef57 100755 --- a/hipamd/rocclr/hip_platform.cpp +++ b/hipamd/rocclr/hip_platform.cpp @@ -313,7 +313,7 @@ bool ihipGetFuncAttributes(const char* func_name, amd::Program* program, hipFunc func_attr->localSizeBytes = wginfo->privateMemSize_; func_attr->sharedSizeBytes = wginfo->localMemSize_; func_attr->maxDynamicSharedSizeBytes = wginfo->availableLDSSize_ - wginfo->localMemSize_; - func_attr->maxThreadsPerBlock = wginfo->wavefrontSize_; + func_attr->maxThreadsPerBlock = wginfo->size_; func_attr->numRegs = wginfo->usedVGPRs_; return true;