Skip to content

Commit

Permalink
Fix parsing backend string (#936)
Browse files Browse the repository at this point in the history
Nothing major, just any invalid value was parsed as OpenMP instead of
triggering an error.

Also removed an unused variable.
  • Loading branch information
al42and committed Jan 26, 2023
1 parent 1c86a13 commit 2498022
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/runtime/settings.cpp
Expand Up @@ -49,7 +49,6 @@ std::istream &operator>>(std::istream &istr, std::vector<rt::backend_id> &out) {
// have to copy, as otherweise might be interpreted as failing, although everything is fine.
std::istringstream istream{str};

size_t offset = 0;
std::string name;
while(std::getline(istream, name, ';')) {
if(name.empty())
Expand All @@ -62,7 +61,7 @@ std::istream &operator>>(std::istream &istr, std::vector<rt::backend_id> &out) {
out.push_back(rt::backend_id::hip);
} else if (name == "ze") {
out.push_back(rt::backend_id::level_zero);
} else if("omp") {
} else if (name == "omp") {
// looking for this, even though we have to allow it always.
out.push_back(rt::backend_id::omp);
} else {
Expand Down

0 comments on commit 2498022

Please sign in to comment.