Added device-name removal code to handle POCL naming convention
parent
08b1417956
commit
3621639b63
|
@ -43,6 +43,11 @@ const std::unordered_map<std::string, std::string> kDeviceNames {
|
||||||
// Empty
|
// Empty
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Things to remove from device names (low-level)
|
||||||
|
const std::vector<std::string> kDeviceRemovals {
|
||||||
|
"pthread-"
|
||||||
|
};
|
||||||
|
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
} // namespace device_mapping
|
} // namespace device_mapping
|
||||||
} // namespace clblast
|
} // namespace clblast
|
||||||
|
|
|
@ -477,6 +477,14 @@ std::string GetDeviceName(const Device& device) {
|
||||||
for (auto &find_and_replace : device_mapping::kDeviceNames) { // replacing to common names
|
for (auto &find_and_replace : device_mapping::kDeviceNames) { // replacing to common names
|
||||||
if (device_name == find_and_replace.first) { device_name = find_and_replace.second; }
|
if (device_name == find_and_replace.first) { device_name = find_and_replace.second; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto &removal : device_mapping::kDeviceRemovals) { // removing certain things
|
||||||
|
if (device_name.find(removal) != std::string::npos) {
|
||||||
|
auto start_position_to_erase = device_name.find(removal);
|
||||||
|
device_name.erase(start_position_to_erase, removal.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return device_name;
|
return device_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue