Commit 6e2e6e7f authored by Ramesh Errabolu's avatar Ramesh Errabolu
Browse files

Print the list of enabled ROCm devices

parent 1935cf86
...@@ -804,7 +804,7 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() { ...@@ -804,7 +804,7 @@ RocmBandwidthTest::RocmBandwidthTest(int argc, char** argv) : BaseTest() {
// Initialize version of the test // Initialize version of the test
version_.major_id = 2; version_.major_id = 2;
version_.minor_id = 3; version_.minor_id = 3;
version_.step_id = 10; version_.step_id = 11;
version_.reserved = 0; version_.reserved = 0;
bw_iter_cnt_ = getenv("ROCM_BW_ITER_CNT"); bw_iter_cnt_ = getenv("ROCM_BW_ITER_CNT");
......
...@@ -168,13 +168,14 @@ typedef enum Request_Type { ...@@ -168,13 +168,14 @@ typedef enum Request_Type {
REQ_WRITE = 2, REQ_WRITE = 2,
REQ_VERSION = 3, REQ_VERSION = 3,
REQ_TOPOLOGY = 4, REQ_TOPOLOGY = 4,
REQ_COPY_BIDIR = 5, REQ_LIST_DEVS = 5,
REQ_COPY_UNIDIR = 6, REQ_COPY_BIDIR = 6,
REQ_COPY_ALL_BIDIR = 7, REQ_COPY_UNIDIR = 7,
REQ_COPY_ALL_UNIDIR = 8, REQ_COPY_ALL_BIDIR = 8,
REQ_CONCURRENT_COPY_BIDIR = 9, REQ_COPY_ALL_UNIDIR = 9,
REQ_CONCURRENT_COPY_UNIDIR = 10, REQ_CONCURRENT_COPY_BIDIR = 10,
REQ_INVALID = 11, REQ_CONCURRENT_COPY_UNIDIR = 11,
REQ_INVALID = 12,
} Request_Type; } Request_Type;
...@@ -446,6 +447,7 @@ class RocmBandwidthTest : public BaseTest { ...@@ -446,6 +447,7 @@ class RocmBandwidthTest : public BaseTest {
uint32_t req_write_; uint32_t req_write_;
uint32_t req_version_; uint32_t req_version_;
uint32_t req_topology_; uint32_t req_topology_;
uint32_t req_list_devs_;
uint32_t req_copy_bidir_; uint32_t req_copy_bidir_;
uint32_t req_copy_unidir_; uint32_t req_copy_unidir_;
uint32_t req_copy_all_bidir_; uint32_t req_copy_all_bidir_;
......
...@@ -222,6 +222,12 @@ void RocmBandwidthTest::ValidateInputFlags(uint32_t pf_cnt, ...@@ -222,6 +222,12 @@ void RocmBandwidthTest::ValidateInputFlags(uint32_t pf_cnt,
return; return;
} }
// Input is requesting to print list of devices
// rocm_bandwidth_test -e
if (req_list_devs_ == REQ_LIST_DEVS) {
return;
}
// Input is for bidirectional bandwidth for some devices // Input is for bidirectional bandwidth for some devices
// rocm_bandwidth_test -b // rocm_bandwidth_test -b
if (req_copy_bidir_ == REQ_COPY_BIDIR) { if (req_copy_bidir_ == REQ_COPY_BIDIR) {
...@@ -336,7 +342,7 @@ void RocmBandwidthTest::ParseArguments() { ...@@ -336,7 +342,7 @@ void RocmBandwidthTest::ParseArguments() {
int opt; int opt;
bool status; bool status;
while ((opt = getopt(usr_argc_, usr_argv_, "hqtclvaAb:i:s:d:r:w:m:k:K:")) != -1) { while ((opt = getopt(usr_argc_, usr_argv_, "hqteclvaAb:i:s:d:r:w:m:k:K:")) != -1) {
switch (opt) { switch (opt) {
// Print help screen // Print help screen
...@@ -350,6 +356,12 @@ void RocmBandwidthTest::ParseArguments() { ...@@ -350,6 +356,12 @@ void RocmBandwidthTest::ParseArguments() {
req_version_ = REQ_VERSION; req_version_ = REQ_VERSION;
break; break;
// Print list of devices
case 'e':
num_primary_flags++;
req_list_devs_ = REQ_LIST_DEVS;
break;
// Print system topology // Print system topology
case 't': case 't':
num_primary_flags++; num_primary_flags++;
...@@ -508,7 +520,14 @@ void RocmBandwidthTest::ParseArguments() { ...@@ -508,7 +520,14 @@ void RocmBandwidthTest::ParseArguments() {
// Discover the topology of RocR agent in system // Discover the topology of RocR agent in system
DiscoverTopology(); DiscoverTopology();
// Print system topology if user option has "-t" // Print list of devices if user option is "-e"
if (req_list_devs_ == REQ_LIST_DEVS) {
PrintVersion();
PrintTopology();
exit(0);
}
// Print system topology if user option is "-t"
if (req_topology_ == REQ_TOPOLOGY) { if (req_topology_ == REQ_TOPOLOGY) {
PrintVersion(); PrintVersion();
PrintTopology(); PrintTopology();
......
...@@ -59,6 +59,7 @@ void RocmBandwidthTest::PrintHelpScreen() { ...@@ -59,6 +59,7 @@ void RocmBandwidthTest::PrintHelpScreen() {
std::cout << "\t -v Run the test in validation mode" << std::endl; std::cout << "\t -v Run the test in validation mode" << std::endl;
std::cout << "\t -l Run test to collect Latency data" << std::endl; std::cout << "\t -l Run test to collect Latency data" << std::endl;
std::cout << "\t -c Time the operation using CPU Timers" << std::endl; std::cout << "\t -c Time the operation using CPU Timers" << std::endl;
std::cout << "\t -e Prints the list of ROCm devices enabled on platform" << std::endl;
std::cout << "\t -i Initialize copy buffer with specified 'long double' pattern" << std::endl; std::cout << "\t -i Initialize copy buffer with specified 'long double' pattern" << std::endl;
std::cout << "\t -t Prints system topology and allocatable memory info" << std::endl; std::cout << "\t -t Prints system topology and allocatable memory info" << std::endl;
std::cout << "\t -m List of buffer sizes to use, specified in Megabytes" << std::endl; std::cout << "\t -m List of buffer sizes to use, specified in Megabytes" << std::endl;
......
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