diff --git a/projects/aqlprofile/src/core/pm4_factory.h b/projects/aqlprofile/src/core/pm4_factory.h index f9317a86f2..cfa5ca58f9 100644 --- a/projects/aqlprofile/src/core/pm4_factory.h +++ b/projects/aqlprofile/src/core/pm4_factory.h @@ -412,11 +412,13 @@ inline bool Pm4Factory::CheckConcurrent(const profile_t* profile) { // Return GPU id for a given agent inline gpu_id_t Pm4Factory::GetGpuId(std::string_view gfx_ip) { + // More specific GPU IDs must come before less specific IDs. std::vector> gfxip_map = { {"gfx908", MI100_GPU_ID}, {"gfx90a", MI200_GPU_ID}, {"gfx900", GFX9_GPU_ID}, {"gfx902", GFX9_GPU_ID}, {"gfx906", GFX9_GPU_ID}, {"gfx94", MI300_GPU_ID}, - {"gfx95", MI350_GPU_ID}, {"gfx10", GFX10_GPU_ID}, {"gfx11", GFX11_GPU_ID}, - {"gfx115", GFX115X_GPU_ID}, {"gfx12", GFX12_GPU_ID}, + {"gfx95", MI350_GPU_ID}, {"gfx10", GFX10_GPU_ID}, + {"gfx115", GFX115X_GPU_ID}, {"gfx11", GFX11_GPU_ID}, + {"gfx12", GFX12_GPU_ID}, }; for (const auto& [name, id] : gfxip_map) { diff --git a/projects/aqlprofile/src/util/hsa_rsrc_factory.cpp b/projects/aqlprofile/src/util/hsa_rsrc_factory.cpp index 8288c1b10f..1bae0adc22 100644 --- a/projects/aqlprofile/src/util/hsa_rsrc_factory.cpp +++ b/projects/aqlprofile/src/util/hsa_rsrc_factory.cpp @@ -46,11 +46,11 @@ // Callback function to get available in the system agents hsa_status_t HsaRsrcFactory::GetHsaAgentsCallback(hsa_agent_t agent, void* data) { - hsa_status_t status = HSA_STATUS_ERROR; HsaRsrcFactory* hsa_rsrc = reinterpret_cast(data); - const AgentInfo* agent_info = hsa_rsrc->AddAgentInfo(agent); - if (agent_info != NULL) status = HSA_STATUS_SUCCESS; - return status; + // AddAgentInfo may return NULL for unsupported agent types (e.g., NPU). + // We should continue iterating regardless. + hsa_rsrc->AddAgentInfo(agent); + return HSA_STATUS_SUCCESS; } // This function checks to see if the provided diff --git a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp index 0647ca08ef..44ce9d3d83 100644 --- a/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/src/util/hsa_rsrc_factory.cpp @@ -73,11 +73,11 @@ static const char* cpp_demangle(const char* symname) { // Callback function to get available in the system agents hsa_status_t HsaRsrcFactory::GetHsaAgentsCallback(hsa_agent_t agent, void* data) { - hsa_status_t status = HSA_STATUS_ERROR; HsaRsrcFactory* hsa_rsrc = reinterpret_cast(data); - const AgentInfo* agent_info = hsa_rsrc->AddAgentInfo(agent); - if (agent_info != nullptr) status = HSA_STATUS_SUCCESS; - return status; + // AddAgentInfo may return NULL for unsupported agent types (e.g., NPU). + // We should continue iterating regardless. + hsa_rsrc->AddAgentInfo(agent); + return HSA_STATUS_SUCCESS; } // This function checks to see if the provided diff --git a/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp b/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp index e3f4221efd..41b9c0c439 100644 --- a/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp +++ b/projects/rocprofiler/test/util/hsa_rsrc_factory.cpp @@ -56,11 +56,11 @@ static const char* cpp_demangle(const char* symname) { // Callback function to get available in the system agents hsa_status_t HsaRsrcFactory::GetHsaAgentsCallback(hsa_agent_t agent, void* data) { - hsa_status_t status = HSA_STATUS_ERROR; HsaRsrcFactory* hsa_rsrc = reinterpret_cast(data); - const AgentInfo* agent_info = hsa_rsrc->AddAgentInfo(agent); - if (agent_info != NULL) status = HSA_STATUS_SUCCESS; - return status; + // AddAgentInfo may return NULL for unsupported agent types (e.g., NPU). + // We should continue iterating regardless. + hsa_rsrc->AddAgentInfo(agent); + return HSA_STATUS_SUCCESS; } // This function checks to see if the provided