Unverified Commit b147d2a3 authored by Ramesh Errabolu's avatar Ramesh Errabolu Committed by GitHub
Browse files

Merge pull request #69 from RadeonOpenCompute/print_UUID_Topology

Print UUID of device as part of platform topology
parents 6a5217d7 26d40c2c
...@@ -68,6 +68,7 @@ typedef struct agent_info { ...@@ -68,6 +68,7 @@ typedef struct agent_info {
hsa_agent_t agent_; hsa_agent_t agent_;
hsa_device_type_t device_type_; hsa_device_type_t device_type_;
char name_[64]; // Size specified in public header file char name_[64]; // Size specified in public header file
char uuid_[24]; // Unique ID of the device
char bdf_id_[16]; // Bus (8-bits), Device (5-bits), Function (3-bits) char bdf_id_[16]; // Bus (8-bits), Device (5-bits), Function (3-bits)
} agent_info_t; } agent_info_t;
......
...@@ -164,6 +164,10 @@ void RocmBandwidthTest::PrintTopology() { ...@@ -164,6 +164,10 @@ void RocmBandwidthTest::PrintTopology() {
std::cout << ""; std::cout << "";
std::cout.width(format); std::cout.width(format);
std::cout << " Device BDF: " << node.agent.bdf_id_ << std::endl; std::cout << " Device BDF: " << node.agent.bdf_id_ << std::endl;
std::cout.width(format);
std::cout << "";
std::cout.width(format);
std::cout << " Device UUID: " << node.agent.uuid_ << std::endl;
} }
// Print pool info // Print pool info
...@@ -297,6 +301,7 @@ void RocmBandwidthTest::PrintAgentsList() { ...@@ -297,6 +301,7 @@ void RocmBandwidthTest::PrintAgentsList() {
} else if (HSA_DEVICE_TYPE_GPU == node.agent.device_type_) { } else if (HSA_DEVICE_TYPE_GPU == node.agent.device_type_) {
std::cout << " Device Type: GPU" << std::endl; std::cout << " Device Type: GPU" << std::endl;
std::cout << " Device BDF: " << node.agent.bdf_id_ << std::endl; std::cout << " Device BDF: " << node.agent.bdf_id_ << std::endl;
std::cout << " Device UUID: " << node.agent.uuid_ << std::endl;
} }
} }
std::cout << std::endl; std::cout << std::endl;
......
...@@ -191,7 +191,14 @@ hsa_status_t AgentInfo(hsa_agent_t agent, void* data) { ...@@ -191,7 +191,14 @@ hsa_status_t AgentInfo(hsa_agent_t agent, void* data) {
status = hsa_agent_get_info(agent, status = hsa_agent_get_info(agent,
(hsa_agent_info_t)HSA_AMD_AGENT_INFO_PRODUCT_NAME, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_PRODUCT_NAME,
(void *)&agent_info.name_[0]); (void *)&agent_info.name_[0]);
// Aqcuire GPU specific properties
// - BDF (a 32-bit integer)
// - UUID (a 21 char string including nil)
if (device_type == HSA_DEVICE_TYPE_GPU) { if (device_type == HSA_DEVICE_TYPE_GPU) {
status = hsa_agent_get_info(agent,
(hsa_agent_info_t)HSA_AMD_AGENT_INFO_UUID,
agent_info.uuid_);
uint32_t bdf_id = 0; uint32_t bdf_id = 0;
status = hsa_agent_get_info(agent, status = hsa_agent_get_info(agent,
(hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID, (hsa_agent_info_t)HSA_AMD_AGENT_INFO_BDFID,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment