From eddcdabf2ab522883ab69cacc0ceb74361c1d345 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 24 Mar 2021 00:48:21 -0500 Subject: [PATCH] fixing gfx10 gfxip name Change-Id: Ie58768d64117a616b1896489b505790cfa993054 [ROCm/rocprofiler commit: 64bdcaddc7f88e0d311ecd784d77083beca73a2a] --- projects/rocprofiler/src/util/hsa_rsrc_factory.cpp | 5 +++-- projects/rocprofiler/test/util/hsa_rsrc_factory.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp index c8ea6c784f..737a6d1624 100644 --- a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp @@ -336,8 +336,9 @@ const AgentInfo* HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) { agent_info->dev_id = agent; agent_info->dev_type = HSA_DEVICE_TYPE_GPU; hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_NAME, agent_info->name); - strncpy(agent_info->gfxip, agent_info->name, 4); - agent_info->gfxip[4] = '\0'; + const int gfxip_label_len = strlen(agent_info->name) - 2; + strncpy(agent_info->gfxip, agent_info->name, gfxip_label_len); + agent_info->gfxip[gfxip_label_len] = '\0'; hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_WAVEFRONT_SIZE, &agent_info->max_wave_size); hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_QUEUE_MAX_SIZE, &agent_info->max_queue_size); hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_PROFILE, &agent_info->profile); diff --git a/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp index 7bf78d7aae..3cbb4b33e4 100644 --- a/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp @@ -330,8 +330,9 @@ const AgentInfo* HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) { agent_info->dev_id = agent; agent_info->dev_type = HSA_DEVICE_TYPE_GPU; hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_NAME, agent_info->name); - strncpy(agent_info->gfxip, agent_info->name, 4); - agent_info->gfxip[4] = '\0'; + const int gfxip_label_len = strlen(agent_info->name) - 2; + strncpy(agent_info->gfxip, agent_info->name, gfxip_label_len); + agent_info->gfxip[gfxip_label_len] = '\0'; hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_WAVEFRONT_SIZE, &agent_info->max_wave_size); hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_QUEUE_MAX_SIZE, &agent_info->max_queue_size); hsa_api_.hsa_agent_get_info(agent, HSA_AGENT_INFO_PROFILE, &agent_info->profile);