Skip to content

Commit

Permalink
Account for topology/thread_siblings_list using different separator c…
Browse files Browse the repository at this point in the history
…haracters.
  • Loading branch information
lostsquirrel1 committed Feb 16, 2025
1 parent 48cadac commit d93561f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rts/System/Platform/Linux/CpuTopology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ std::vector<int> get_thread_siblings(int cpu) {
if (file) {
std::string line;
std::getline(file, line);
std::stringstream ss(line);
std::string token;
while (std::getline(ss, token, ',')) {
siblings.push_back(std::stoi(token));
std::istringstream ss(line);
int sibling;
char sep;
while (ss >> sibling) {
siblings.push_back(sibling);
ss >> sep; // Skip separator (comma or other)
}
}
return siblings;
Expand Down Expand Up @@ -109,7 +111,7 @@ void collect_intel_affinity_masks(std::bitset<MAX_CPUS> &eff_mask,
}
}

// Collect CPU affinity masks for AMD using CPUID 0x8000001E
// Collect CPU affinity masks for AMD
void collect_amd_affinity_masks(std::bitset<MAX_CPUS> &eff_mask,
std::bitset<MAX_CPUS> &perf_mask,
std::bitset<MAX_CPUS> &low_ht_mask,
Expand Down

0 comments on commit d93561f

Please sign in to comment.