Files
compute-runtime/opencl/source/compiler_interface/default_cache_config.cpp
Diedrich, Kamil 26ca64bb28 Add process safety to cl_cache on Linux
Current flow will be to have one synchronization point
config.file. Read remains unblocking, only write(caching)
operation will be blocking (lock on config.file)

Related-To: NEO-4262

Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com>
2023-04-25 17:35:40 +02:00

36 lines
914 B
C++

/*
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/compiler_interface/default_cache_config.h"
#include "shared/source/helpers/constants.h"
#include "shared/source/utilities/debug_settings_reader.h"
#include "opencl/source/os_interface/ocl_reg_path.h"
#include "config.h"
#include "os_inc.h"
#include <string>
namespace NEO {
CompilerCacheConfig getDefaultCompilerCacheConfig() {
CompilerCacheConfig ret;
std::string keyName = oclRegPath;
keyName += "cl_cache_dir";
std::unique_ptr<SettingsReader> settingsReader(SettingsReader::createOsReader(false, keyName));
ret.cacheDir = settingsReader->getSetting(settingsReader->appSpecificLocation(keyName), static_cast<std::string>(CL_CACHE_LOCATION));
ret.cacheSize = MemoryConstants::gigaByte;
ret.cacheFileExtension = ".cl_cache";
return ret;
}
} // namespace NEO