SWDEV-515261 - Fixed getMatchingConfigFile for heterogeneous archs (#54)

Preserve order and duplicate entries in rocm_agent_enumerator output
before filtering visible devices. This ensures alignment with
the expected indexing in HIP_VISIBLE_DEVICES.
Este commit está contenido en:
Assiouras, Ioannis
2025-05-28 12:17:22 +01:00
cometido por GitHub
padre 0653734882
commit 355d97fec4
+2 -7
Ver fichero
@@ -37,7 +37,8 @@ std::string TestContext::substringFound(std::vector<std::string> 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<char, 1024> buffer;
std::string result;
std::unique_ptr<FILE, decltype(&pclose)> 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<std::string> {