mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Improve driverstore compatibility checker
make checker case-insensitive handle HostDriverStore scenarios Related-To: NEO-5182, NEO-6025 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
bcf93a6aeb
commit
294045071b
@@ -70,13 +70,21 @@ std::string DriverInfoWindows::getVersion(std::string defaultVersion) {
|
||||
};
|
||||
|
||||
bool DriverInfoWindows::isCompatibleDriverStore() const {
|
||||
auto currentLibraryPath = getCurrentLibraryPath();
|
||||
auto toLowerAndUnifyDriverStore = [](std::string &input) -> std::string {
|
||||
std::transform(input.begin(), input.end(), input.begin(), [](unsigned char c) { return std::tolower(c); });
|
||||
auto hostDriverStorePos = input.find("\\hostdriverstore\\");
|
||||
if (hostDriverStorePos != std::string::npos) {
|
||||
input.erase(hostDriverStorePos + 1, 4);
|
||||
}
|
||||
return input;
|
||||
};
|
||||
auto currentLibraryPath = toLowerAndUnifyDriverStore(getCurrentLibraryPath());
|
||||
auto openclDriverName = registryReader.get()->getSetting("OpenCLDriverName", std::string{});
|
||||
if (openclDriverName.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto driverStorePath = registryReader.get()->getSetting("DriverStorePathForComputeRuntime", currentLibraryPath);
|
||||
auto driverStorePath = toLowerAndUnifyDriverStore(registryReader.get()->getSetting("DriverStorePathForComputeRuntime", currentLibraryPath));
|
||||
return currentLibraryPath.find(driverStorePath.c_str()) == 0u;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user