Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
rocm_bandwidth_test
Commits
b147d2a3
Unverified
Commit
b147d2a3
authored
Feb 08, 2021
by
Ramesh Errabolu
Committed by
GitHub
Feb 08, 2021
Browse files
Merge pull request #69 from RadeonOpenCompute/print_UUID_Topology
Print UUID of device as part of platform topology
parents
6a5217d7
26d40c2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
rocm_bandwidth_test.hpp
rocm_bandwidth_test.hpp
+1
-0
rocm_bandwidth_test_print.cpp
rocm_bandwidth_test_print.cpp
+5
-0
rocm_bandwidth_test_topology.cpp
rocm_bandwidth_test_topology.cpp
+7
-0
No files found.
rocm_bandwidth_test.hpp
View file @
b147d2a3
...
@@ -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
;
...
...
rocm_bandwidth_test_print.cpp
View file @
b147d2a3
...
@@ -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
;
...
...
rocm_bandwidth_test_topology.cpp
View file @
b147d2a3
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment