mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Revert "fix: remove compiler cache legacy implementation"
This reverts commit 864f42116c.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0ad5316f53
commit
9568ee47e7
@@ -20,7 +20,7 @@ namespace NEO {
|
||||
struct HardwareInfo;
|
||||
|
||||
struct CompilerCacheConfig {
|
||||
bool enabled = false;
|
||||
bool enabled = true;
|
||||
std::string cacheFileExtension;
|
||||
std::string cacheDir;
|
||||
size_t cacheSize = 0;
|
||||
|
||||
@@ -56,6 +56,18 @@ CompilerCacheConfig getDefaultCompilerCacheConfig() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.cacheDir = envReader.getSetting(ApiSpecificConfig::compilerCacheDir().c_str(), ApiSpecificConfig::compilerCacheLocation());
|
||||
|
||||
if (NEO::SysCalls::pathExists(ret.cacheDir)) {
|
||||
ret.enabled = true;
|
||||
ret.cacheSize = static_cast<size_t>(neoCacheMaxSizeDefault);
|
||||
ret.cacheFileExtension = ApiSpecificConfig::compilerCacheFileExtension();
|
||||
} else {
|
||||
ret.enabled = false;
|
||||
ret.cacheSize = 0u;
|
||||
ret.cacheFileExtension = ApiSpecificConfig::compilerCacheFileExtension();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||
for (const auto &prefix : prefixString) {
|
||||
std::string neoKey = prefix;
|
||||
neoKey += settingName;
|
||||
envValue = IoFunctions::getenvPtr(neoKey.c_str());
|
||||
envValue = strcmp(processName.c_str(), neoKey.c_str()) ? IoFunctions::getenvPtr(neoKey.c_str()) : IoFunctions::getenvPtr("cl_cache_dir");
|
||||
if (envValue) {
|
||||
keyValue.assign(envValue);
|
||||
type = prefixType[i];
|
||||
@@ -214,7 +214,7 @@ std::string RegistryReader::getSetting(const char *settingName, const std::strin
|
||||
std::string keyValue = value;
|
||||
|
||||
if (!(getSettingStringCommon(settingName, keyValue))) {
|
||||
const char *envValue = IoFunctions::getenvPtr(settingName);
|
||||
const char *envValue = strcmp(processName.c_str(), settingName) ? IoFunctions::getenvPtr(settingName) : IoFunctions::getenvPtr("cl_cache_dir");
|
||||
if (envValue) {
|
||||
keyValue.assign(envValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user