Fix dumping of cl_cache

- change creatOsReader and constructor of RegistryReader
- move body of constructors of RegistryReader from .h to .cpp

Change-Id: I57cbf51a57cb1cb7f9cd2473af766a79cf2035d2
This commit is contained in:
Katarzyna Cencelewska
2018-11-30 11:51:49 +01:00
committed by sys_ocldev
parent fe228ea5f7
commit a99939b08f
4 changed files with 16 additions and 17 deletions

View File

@@ -53,8 +53,9 @@ const std::string BinaryCache::getCachedFileName(const HardwareInfo &hwInfo, con
}
BinaryCache::BinaryCache() {
std::unique_ptr<SettingsReader> settingsReader(SettingsReader::createOsReader(CL_CACHE_LOCATION));
clCacheLocation = settingsReader->getSetting(settingsReader->appSpecificLocation("cl_cache_dir"), static_cast<std::string>(CL_CACHE_LOCATION));
std::string keyName = "cl_cache_dir";
std::unique_ptr<SettingsReader> settingsReader(SettingsReader::createOsReader(keyName));
clCacheLocation = settingsReader->getSetting(settingsReader->appSpecificLocation(keyName), static_cast<std::string>(CL_CACHE_LOCATION));
};
BinaryCache::~BinaryCache(){};
@@ -64,7 +65,6 @@ bool BinaryCache::cacheBinary(const std::string kernelFileHash, const char *pBin
return false;
}
std::string filePath = clCacheLocation + PATH_SEPARATOR + kernelFileHash + ".cl_cache";
std::lock_guard<std::mutex> lock(cacheAccessMtx);
if (writeDataToFile(
filePath.c_str(),