Added device-name removal code to handle POCL naming convention

CLBlast-300-incorrect-reference-for-GEMMK1-on-AMD
Cedric Nugteren 2018-07-13 21:20:27 +02:00
parent 08b1417956
commit 3621639b63
2 changed files with 13 additions and 0 deletions

View File

@ -43,6 +43,11 @@ const std::unordered_map<std::string, std::string> kDeviceNames {
// Empty
};
// Things to remove from device names (low-level)
const std::vector<std::string> kDeviceRemovals {
"pthread-"
};
// =================================================================================================
} // namespace device_mapping
} // namespace clblast

View File

@ -477,6 +477,14 @@ std::string GetDeviceName(const Device& device) {
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; }
}
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;
}