From ab97440eba603edd6ebd3333bf82bfd2f8821563 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Sun, 16 Jan 2022 08:43:57 -0600 Subject: [PATCH] Retrieve cache line size from KFD topology. Change-Id: I16ddd9d9888bb973eccf3c562619894c88c7df15 [ROCm/ROCR-Runtime commit: 21291b48c693e41c79d6bd7978622f10c1eb8efc] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 2230b96fcf..e28b99e4ae 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -924,9 +924,12 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { *((uint32_t*)value) = properties_.DeviceId; break; case HSA_AMD_AGENT_INFO_CACHELINE_SIZE: - // TODO: hardcode for now. - // GCN whitepaper: cache line size is 64 byte long. - *((uint32_t*)value) = 64; + for (auto& cache : cache_props_) { + if (cache.CacheLineSize != 0) { + *((uint32_t*)value) = cache.CacheLineSize; + break; + } + } break; case HSA_AMD_AGENT_INFO_COMPUTE_UNIT_COUNT: *((uint32_t*)value) =