GPU Index to use HSA AMD Agent Driver Node ID

Change-Id: Ia814f64419615f1d77fc09fc88f11bbaf75afd45


[ROCm/rocprofiler commit: 553a4c7ee7]
This commit is contained in:
Ammar ELWazir authored and Ammar Elwazir committed 2022-11-21 14:05:33 -05:00
1 parent be0c6a3380
commit c256910fe8
2 files changed
+14 -2

No files matched your search

@@ -366,7 +366,13 @@ const AgentInfo* HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) {
agent_info->vgpr_block_size = 4;
// Set GPU index
agent_info->dev_index = gpu_list_.size();
uint32_t driver_node_id;
status = hsa_api_.hsa_agent_get_info(
agent,
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_DRIVER_NODE_ID),
&driver_node_id);
CHECK_STATUS("hsa_agent_get_info(gpu hsa_driver_node_id)", status);
agent_info->dev_index = driver_node_id;
gpu_list_.push_back(agent_info);
gpu_agents_.push_back(agent);
}
@@ -355,7 +355,13 @@ const AgentInfo* HsaRsrcFactory::AddAgentInfo(const hsa_agent_t agent) {
CHECK_ITER_STATUS("hsa_amd_agent_iterate_memory_pools(gpu pool)", status);
// Set GPU index
agent_info->dev_index = gpu_list_.size();
uint32_t driver_node_id;
status = hsa_api_.hsa_agent_get_info(
agent,
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_DRIVER_NODE_ID),
&driver_node_id);
CHECK_STATUS("hsa_agent_get_info(gpu hsa_driver_node_id)", status);
agent_info->dev_index = driver_node_id;
gpu_list_.push_back(agent_info);
gpu_agents_.push_back(agent);
}