diff --git a/catch/hipTestMain/hip_test_context.cc b/catch/hipTestMain/hip_test_context.cc index 520ce9b09a..c2af3aa603 100644 --- a/catch/hipTestMain/hip_test_context.cc +++ b/catch/hipTestMain/hip_test_context.cc @@ -37,7 +37,8 @@ std::string TestContext::substringFound(std::vector list, std::stri std::string TestContext::getCurrentArch() { #if HT_LINUX - const char* cmd = "/opt/rocm/bin/rocm_agent_enumerator | sort -u | xargs | sed -e 's/ /;/g'"; + const char* cmd = + "/opt/rocm/bin/rocm_agent_enumerator | awk '$0 != \"gfx000\"' | xargs | sed -e 's/ /;/g'"; std::array buffer; std::string result; std::unique_ptr pipe(popen(cmd, "r"), pclose); @@ -50,12 +51,6 @@ std::string TestContext::getCurrentArch() { result = res; } - result.erase(std::remove(result.begin(), result.end(), '\n'), result.end()); - size_t pos = result.find("gfx000"); - if (pos != std::string::npos) { - result.erase(pos, 7); - } - std::string s_visible_devices = TestContext::getEnvVar("HIP_VISIBLE_DEVICES"); auto parser = [](std::string input, char c) -> std::vector {