From f7772fb7041ca71c882823b0de4ca9d93f7e044b Mon Sep 17 00:00:00 2001 From: Ammar ELWazir Date: Fri, 2 Dec 2022 11:16:45 -0600 Subject: [PATCH] GPU ID issue Before, the GPU IDs were counted starting from zero, now CPU IDs are counted from zero and then GPU IDs from the last CPU_ID+1 Change-Id: I3f815195ad97933e02f249841e53b64b674370d9 [ROCm/rocprofiler commit: 6dda141e4b2555f401d9a77da1d0e837e3ac6f69] --- projects/rocprofiler/src/util/hsa_rsrc_factory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp index 50d4ec1eb6..cd4948ff66 100644 --- a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp @@ -415,12 +415,12 @@ uint32_t HsaRsrcFactory::GetCountOfCpuAgents() { return uint32_t(cpu_list_.size( bool HsaRsrcFactory::GetGpuAgentInfo(uint32_t idx, const AgentInfo** agent_info) { // Determine if request is valid uint32_t size = uint32_t(gpu_list_.size()); - if (idx >= size) { + if (idx-cpu_list_.size() >= size) { return false; } // Copy AgentInfo from specified index - *agent_info = gpu_list_[idx]; + *agent_info = gpu_list_[idx-cpu_list_.size()]; return true; }