diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-02-07 11:59:30 +0100 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-02-07 11:59:30 +0100 |
commit | 00be6f7530a16eb17f367b45d498e1e483b61b8d (patch) | |
tree | 47da8a24c723a0c1a583400af95d657d5b7ada59 /src | |
parent | c76f1d9dbb77746012c688a8d60ed45559ad0a4a (diff) |
Added dictionary with short and long OpenCL vendor names to fix issues with Intel having multiple names
Diffstat (limited to 'src')
-rw-r--r-- | src/database.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/database.cc b/src/database.cc index 7f5ac6eb..ba0a56d9 100644 --- a/src/database.cc +++ b/src/database.cc @@ -77,15 +77,23 @@ Database::Parameters Database::Search(const std::string &this_kernel, const std::string &this_vendor, const std::string &this_device, const Precision this_precision) const { - for (auto &db: database) { + // Set the short vendor name + auto this_short_vendor = this_vendor; + for (auto &combination : kVendorNames) { + if (this_vendor == combination.first) { + this_short_vendor = combination.second; + } + } + // Selects the right kernel + for (auto &db: database) { if (db.kernel == this_kernel && db.precision == this_precision) { // Searches for the right vendor and device type, or selects the default if unavailable. This // assumes that the default vendor / device type is last in the database. for (auto &vendor: db.vendors) { - if ((vendor.name == this_vendor || vendor.name == kDeviceVendorAll) && - (vendor.type == this_type || vendor.type == kDeviceTypeAll)) { + if ((vendor.name == this_short_vendor || vendor.name == kDeviceVendorAll) && + (vendor.type == this_type || vendor.type == kDeviceTypeAll)) { // Searches for the right device. If the current device is unavailable, selects the vendor // default parameters. This assumes the default is last in the database. |