Skip to content

Commit

Permalink
Added device-name removal code to handle POCL naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
CNugteren committed Jul 13, 2018
1 parent 08b1417 commit 3621639
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utilities/device_mapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/utilities/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3621639

Please sign in to comment.