From 14977e4dc142c413da814c51fe5d09218dac1442 Mon Sep 17 00:00:00 2001 From: gobhardw Date: Tue, 14 Mar 2023 10:19:25 +0530 Subject: [PATCH] SWDEV-374072 : rocprof gpu selector fix Change-Id: I155e63a5dc1ecbacd76d80b0df76da99b645ed9f --- test/tool/tool.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/tool/tool.cpp b/test/tool/tool.cpp index 16a9fbb5f7..5bd7412df6 100644 --- a/test/tool/tool.cpp +++ b/test/tool/tool.cpp @@ -49,6 +49,7 @@ THE SOFTWARE. #include #include #include +#include #include "inc/rocprofiler.h" #include "util/hsa_rsrc_factory.h" @@ -1168,6 +1169,12 @@ extern "C" PUBLIC_API void OnLoadToolProp(rocprofiler_settings_t* settings) // Getting GPU indexes gpu_index_vec = new std::vector; get_xml_array(xml, "top.metric", "gpu_index", ",", gpu_index_vec, " "); + + // Skipping cpu count to get to correct gpu index + const uint32_t cpu_count = HsaRsrcFactory::Instance().GetCountOfCpuAgents(); + std::transform(gpu_index_vec->begin(), gpu_index_vec->end(), + gpu_index_vec->begin(), + [&](int count) { return count + cpu_count; }); // Getting kernel names kernel_string_vec = new std::vector;