From d6c16c16406ee480a4baeac8dcb025009536caff Mon Sep 17 00:00:00 2001 From: Weronika Kapusta Date: Mon, 6 May 2024 16:20:13 +0000 Subject: [PATCH] fix: remove compiler cache legacy implementation Related-To: NEO-10679 Signed-off-by: Weronika Kapusta --- CMakeLists.txt | 1 - cmake/run_aub_test_target.cmake | 1 - cmake/run_ult_target.cmake | 2 - config.h.in | 1 - .../source/helpers/api_specific_config_l0.cpp | 8 --- .../helper/api_specific_config_l0_tests.cpp | 8 --- opencl/doc/FAQ.md | 4 -- .../helpers/api_specific_config_ocl.cpp | 8 --- .../helpers/api_specific_config_ocl_tests.cpp | 8 --- .../default_cache_config_tests.cpp | 2 +- programmers-guide/COMPILER_CACHE.md | 2 +- .../compiler_interface/compiler_cache.h | 2 +- .../default_cache_config.cpp | 19 ++----- .../windows/debug_registry_reader.cpp | 4 +- .../compiler_cache_tests.cpp | 1 + .../linux/default_cl_cache_config_tests.cpp | 50 ++++--------------- .../windows/default_cl_cache_config_tests.cpp | 32 +++--------- .../os_interface/debug_env_reader_tests.cpp | 6 --- .../windows/registry_reader_tests.cpp | 20 -------- .../windows/registry_reader_tests.h | 1 - 20 files changed, 26 insertions(+), 154 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3dd4836e5..f1cc7feb15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -613,7 +613,6 @@ endif() # Miscs options option(IGDRCL_GCOV "generate gcov report" OFF) -set(CL_CACHE_LOCATION "cl_cache" CACHE STRING "OpenCL program binary cache location") option(NEO_SHOW_VERBOSE_ULT_RESULTS "Use the default/verbose test output" OFF) diff --git a/cmake/run_aub_test_target.cmake b/cmake/run_aub_test_target.cmake index 3d0c0e18e2..d44a8d0aa7 100644 --- a/cmake/run_aub_test_target.cmake +++ b/cmake/run_aub_test_target.cmake @@ -60,7 +60,6 @@ if(NOT NEO_SKIP_OCL_UNIT_TESTS OR NOT NEO_SKIP_L0_UNIT_TESTS) COMMAND ${CMAKE_COMMAND} -E remove_directory ${TargetDir}/${product}_aub/${revision_id} COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id} COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id}/aub_out - COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id}/cl_cache ) endif() diff --git a/cmake/run_ult_target.cmake b/cmake/run_ult_target.cmake index 8062288828..e5d1f82688 100644 --- a/cmake/run_ult_target.cmake +++ b/cmake/run_ult_target.cmake @@ -60,8 +60,6 @@ if(NOT NEO_SKIP_OCL_UNIT_TESTS) POST_BUILD COMMAND WORKING_DIRECTORY ${TargetDir} COMMAND echo Running igdrcl_tests ${target} ${slices}x${subslices}x${eu_per_ss} in ${TargetDir} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${outputdir}/cl_cache - COMMAND ${CMAKE_COMMAND} -E make_directory ${outputdir}/cl_cache COMMAND echo Cmd line: ${GTEST_ENV} ${NEO_RUN_INTERCEPTOR_LIST} $ --product ${product} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} ${GTEST_EXCEPTION_OPTIONS} --gtest_repeat=${GTEST_REPEAT} ${GTEST_SHUFFLE} ${GTEST_OUTPUT} ${NEO_TESTS_LISTENER_OPTION} ${GTEST_FILTER_OPTION} --rev_id ${revision_id} COMMAND ${GTEST_ENV} ${NEO_RUN_INTERCEPTOR_LIST} $ --product ${product} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} ${GTEST_EXCEPTION_OPTIONS} --gtest_repeat=${GTEST_REPEAT} ${GTEST_SHUFFLE} ${GTEST_OUTPUT} ${NEO_TESTS_LISTENER_OPTION} ${GTEST_FILTER_OPTION} --rev_id ${revision_id} ) diff --git a/config.h.in b/config.h.in index efd7e80922..706fab11cc 100644 --- a/config.h.in +++ b/config.h.in @@ -8,7 +8,6 @@ #ifndef CONFIG_H #define CONFIG_H -#cmakedefine CL_CACHE_LOCATION "${CL_CACHE_LOCATION}" #cmakedefine NEO_ARCH "${NEO_ARCH}" #endif /* CONFIG_H */ diff --git a/level_zero/core/source/helpers/api_specific_config_l0.cpp b/level_zero/core/source/helpers/api_specific_config_l0.cpp index 26844772a4..77a93fc30d 100644 --- a/level_zero/core/source/helpers/api_specific_config_l0.cpp +++ b/level_zero/core/source/helpers/api_specific_config_l0.cpp @@ -78,14 +78,6 @@ bool ApiSpecificConfig::isSharedAllocPrefetchEnabled() { (NEO::debugManager.flags.EnableBOChunkingPrefetch.get() && ((NEO::debugManager.flags.EnableBOChunking.get()) != -1) && ((NEO::debugManager.flags.EnableBOChunking.get()) & 0x1))); } -std::string ApiSpecificConfig::compilerCacheDir() { - return "l0_cache_dir"; -} - -std::string ApiSpecificConfig::compilerCacheLocation() { - return "l0_cache"; -} - std::string ApiSpecificConfig::compilerCacheFileExtension() { return ".l0_cache"; } diff --git a/level_zero/core/test/unit_tests/sources/helper/api_specific_config_l0_tests.cpp b/level_zero/core/test/unit_tests/sources/helper/api_specific_config_l0_tests.cpp index c6555fd3d2..462c39fc34 100644 --- a/level_zero/core/test/unit_tests/sources/helper/api_specific_config_l0_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/helper/api_specific_config_l0_tests.cpp @@ -79,14 +79,6 @@ TEST(ImplicitScalingApiTests, givenLevelZeroApiUsedThenSupportEnabled) { EXPECT_TRUE(ImplicitScaling::apiSupport); } -TEST(ApiSpecificConfigL0Tests, WhenGettingCompilerCacheDirThenReturnProperDirString) { - EXPECT_EQ(0, strcmp("l0_cache_dir", ApiSpecificConfig::compilerCacheDir().c_str())); -} - -TEST(ApiSpecificConfigL0Tests, WhenGettingCompilerCacheLocationThenReturnProperLocationString) { - EXPECT_EQ(0, strcmp("l0_cache", ApiSpecificConfig::compilerCacheLocation().c_str())); -} - TEST(ApiSpecificConfigL0Tests, WhenGettingCompilerCacheFileExtensionThenReturnProperFileExtensionString) { EXPECT_EQ(0, strcmp(".l0_cache", ApiSpecificConfig::compilerCacheFileExtension().c_str())); } diff --git a/opencl/doc/FAQ.md b/opencl/doc/FAQ.md index c95ff5d1cf..976af7d852 100644 --- a/opencl/doc/FAQ.md +++ b/opencl/doc/FAQ.md @@ -40,10 +40,6 @@ See the enabling [guide](cl_intel_va_api_media_sharing.md). ## Feature: cl_cache -Originally, compute-runtime had an experimental cache implementation, which was replaced -in Q2'23 with a more robust approach. Legacy solution is now considered deprecated and the -old experimental controls explained below will be removed by EOY 2023. - ### What is cl_cache? This is a mechanism to cache binary representations of OpenCL kernels provided in text form by diff --git a/opencl/source/helpers/api_specific_config_ocl.cpp b/opencl/source/helpers/api_specific_config_ocl.cpp index 863ab9c39a..fcbbac769d 100644 --- a/opencl/source/helpers/api_specific_config_ocl.cpp +++ b/opencl/source/helpers/api_specific_config_ocl.cpp @@ -69,14 +69,6 @@ const StackVec &ApiSpecificConfig::getPrefixTypes() { return validClPrefixTypes; } -std::string ApiSpecificConfig::compilerCacheDir() { - return "cl_cache_dir"; -} - -std::string ApiSpecificConfig::compilerCacheLocation() { - return "cl_cache"; -} - std::string ApiSpecificConfig::compilerCacheFileExtension() { return ".cl_cache"; } diff --git a/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp b/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp index 0fcb55eddd..9a57528a6c 100644 --- a/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp +++ b/opencl/test/unit_test/helpers/api_specific_config_ocl_tests.cpp @@ -71,14 +71,6 @@ TEST(ApiSpecificConfigOclTests, givenEnableStatelessCompressionWhenProvidingPrin EXPECT_TRUE(NEO::CompressionSelector::preferCompressedAllocation(properties)); } -TEST(ApiSpecificConfigOclTests, WhenGettingCompilerCacheDirThenReturnProperDirString) { - EXPECT_EQ(0, strcmp("cl_cache_dir", ApiSpecificConfig::compilerCacheDir().c_str())); -} - -TEST(ApiSpecificConfigOclTests, WhenGettingCompilerCacheLocationThenReturnProperLocationString) { - EXPECT_EQ(0, strcmp("cl_cache", ApiSpecificConfig::compilerCacheLocation().c_str())); -} - TEST(ApiSpecificConfigOclTests, WhenGettingCompilerCacheFileExtensionThenReturnProperFileExtensionString) { EXPECT_EQ(0, strcmp(".cl_cache", ApiSpecificConfig::compilerCacheFileExtension().c_str())); } diff --git a/opencl/test/unit_test/offline_compiler/default_cache_config_tests.cpp b/opencl/test/unit_test/offline_compiler/default_cache_config_tests.cpp index 6b92bc01c1..982142ea65 100644 --- a/opencl/test/unit_test/offline_compiler/default_cache_config_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/default_cache_config_tests.cpp @@ -12,5 +12,5 @@ TEST(CompilerCache, GivenDefaultCacheConfigThenValuesAreProperlyPopulated) { auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); EXPECT_STREQ("ocloc_cache", cacheConfig.cacheDir.c_str()); EXPECT_STREQ(".ocloc_cache", cacheConfig.cacheFileExtension.c_str()); - EXPECT_TRUE(cacheConfig.enabled); + EXPECT_FALSE(cacheConfig.enabled); } diff --git a/programmers-guide/COMPILER_CACHE.md b/programmers-guide/COMPILER_CACHE.md index efe3525850..ff9abb246f 100644 --- a/programmers-guide/COMPILER_CACHE.md +++ b/programmers-guide/COMPILER_CACHE.md @@ -13,7 +13,7 @@ SPDX-License-Identifier: MIT - [Implementation](#Implementation) - [Key Features](#Key-Features) - [Debug Keys](#Debug-Keys) -- [Potential Problems and Limitations](#Potential-Problems-and-Limitations) +- [Potential Issues and Limitations](#Potential-Issues-and-Limitations) # Introduction diff --git a/shared/source/compiler_interface/compiler_cache.h b/shared/source/compiler_interface/compiler_cache.h index d271723603..549dd7d1d0 100644 --- a/shared/source/compiler_interface/compiler_cache.h +++ b/shared/source/compiler_interface/compiler_cache.h @@ -20,7 +20,7 @@ namespace NEO { struct HardwareInfo; struct CompilerCacheConfig { - bool enabled = true; + bool enabled = false; std::string cacheFileExtension; std::string cacheDir; size_t cacheSize = 0; diff --git a/shared/source/compiler_interface/default_cache_config.cpp b/shared/source/compiler_interface/default_cache_config.cpp index 9bf0b80c4a..0082d02cb3 100644 --- a/shared/source/compiler_interface/default_cache_config.cpp +++ b/shared/source/compiler_interface/default_cache_config.cpp @@ -53,25 +53,12 @@ CompilerCacheConfig getDefaultCompilerCacheConfig() { ret.cacheSize = std::numeric_limits::max(); } - if (ret.enabled) { - PRINT_DEBUG_STRING(NEO::debugManager.flags.PrintDebugMessages.get(), stdout, "NEO_CACHE_PERSISTENT is enabled. Cache is located in: %s\n\n", - ret.cacheDir.c_str()); - } + PRINT_DEBUG_STRING(NEO::debugManager.flags.PrintDebugMessages.get(), stdout, "NEO_CACHE_PERSISTENT is enabled. Cache is located in: %s\n\n", + ret.cacheDir.c_str()); + 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(neoCacheMaxSizeDefault); - ret.cacheFileExtension = ApiSpecificConfig::compilerCacheFileExtension(); - } else { - ret.enabled = false; - ret.cacheSize = 0u; - ret.cacheFileExtension = ApiSpecificConfig::compilerCacheFileExtension(); - } - return ret; } diff --git a/shared/source/os_interface/windows/debug_registry_reader.cpp b/shared/source/os_interface/windows/debug_registry_reader.cpp index df8ac86a90..66601f9a5a 100644 --- a/shared/source/os_interface/windows/debug_registry_reader.cpp +++ b/shared/source/os_interface/windows/debug_registry_reader.cpp @@ -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 = strcmp(processName.c_str(), neoKey.c_str()) ? IoFunctions::getenvPtr(neoKey.c_str()) : IoFunctions::getenvPtr("cl_cache_dir"); + envValue = IoFunctions::getenvPtr(neoKey.c_str()); 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 = strcmp(processName.c_str(), settingName) ? IoFunctions::getenvPtr(settingName) : IoFunctions::getenvPtr("cl_cache_dir"); + const char *envValue = IoFunctions::getenvPtr(settingName); if (envValue) { keyValue.assign(envValue); } diff --git a/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp index 4601141234..24a58ff05c 100644 --- a/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_cache_tests.cpp @@ -445,6 +445,7 @@ TEST(CompilerInterfaceCachedTests, givenKernelWithoutIncludesAndBinaryInCacheWhe std::unique_ptr cache(new CompilerCacheMock()); cache->loadResult = true; + cache->config.enabled = true; auto compilerInterface = std::unique_ptr(CompilerInterface::createInstance(std::move(cache), true)); TranslationOutput translationOutput; inputArgs.allowCaching = true; diff --git a/shared/test/unit_test/compiler_interface/linux/default_cl_cache_config_tests.cpp b/shared/test/unit_test/compiler_interface/linux/default_cl_cache_config_tests.cpp index 373d7e7a9c..3078ae46f0 100644 --- a/shared/test/unit_test/compiler_interface/linux/default_cl_cache_config_tests.cpp +++ b/shared/test/unit_test/compiler_interface/linux/default_cl_cache_config_tests.cpp @@ -21,47 +21,6 @@ namespace SysCalls { extern bool pathExistsMock; } -namespace LegacyPathWorksIfNewEnvIsSetToDisabled { -bool pathExistsMock(const std::string &path) { - if (path.find(ApiSpecificConfig::compilerCacheLocation().c_str()) != path.npos) - return true; - - return false; -} -} // namespace LegacyPathWorksIfNewEnvIsSetToDisabled - -TEST(ClCacheDefaultConfigLinuxTest, GivenDefaultClCacheConfigWithPathExistsAndNewEnvSetToDisabledThenValuesAreProperlyPopulated) { - std::unordered_map mockableEnvs; - mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; - - VariableBackup *> mockableEnvValuesBackup(&NEO::IoFunctions::mockableEnvValues, &mockableEnvs); - VariableBackup pathExistsBackup(&NEO::SysCalls::sysCallsPathExists, LegacyPathWorksIfNewEnvIsSetToDisabled::pathExistsMock); - - auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheLocation().c_str(), cacheConfig.cacheDir.c_str()); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheFileExtension().c_str(), cacheConfig.cacheFileExtension.c_str()); - EXPECT_TRUE(cacheConfig.enabled); -} - -namespace NewEnvIsDisabledAndLegacyPathDoesNotExist { -bool pathExistsMock(const std::string &path) { - return false; -} -} // namespace NewEnvIsDisabledAndLegacyPathDoesNotExist - -TEST(ClCacheDefaultConfigLinuxTest, GivenDefaultClCacheConfigWithNotExistingPathAndNewEnvSetToDisabledThenValuesAreProperlyPopulated) { - std::unordered_map mockableEnvs; - mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; - - VariableBackup *> mockableEnvValuesBackup(&NEO::IoFunctions::mockableEnvValues, &mockableEnvs); - VariableBackup pathExistsBackup(&NEO::SysCalls::sysCallsPathExists, NewEnvIsDisabledAndLegacyPathDoesNotExist::pathExistsMock); - - auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheLocation().c_str(), cacheConfig.cacheDir.c_str()); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheFileExtension().c_str(), cacheConfig.cacheFileExtension.c_str()); - EXPECT_FALSE(cacheConfig.enabled); -} - namespace AllVariablesCorrectlySet { bool pathExistsMock(const std::string &path) { if (path.find("ult/directory/") != path.npos) @@ -365,4 +324,13 @@ TEST(ClCacheDefaultConfigLinuxTest, GivenXdgEnvWhenOtherProcessCreatesNeoCompile EXPECT_EQ(cacheConfig.cacheDir, "xdg/directory/neo_compiler_cache"); EXPECT_TRUE(XdgPathIsSetAndOtherProcessCreatesPath::mkdirCalled); } + +TEST(ClCacheDefaultConfigLinuxTest, GivenNeoCachePersistentSetToZeroWhenGetDefaultCompilerCacheConfigThenCacheIsDisabled) { + std::unordered_map mockableEnvs; + mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; + + auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); + + EXPECT_FALSE(cacheConfig.enabled); +} } // namespace NEO diff --git a/shared/test/unit_test/compiler_interface/windows/default_cl_cache_config_tests.cpp b/shared/test/unit_test/compiler_interface/windows/default_cl_cache_config_tests.cpp index a9db8df6bc..b6f8ea3426 100644 --- a/shared/test/unit_test/compiler_interface/windows/default_cl_cache_config_tests.cpp +++ b/shared/test/unit_test/compiler_interface/windows/default_cl_cache_config_tests.cpp @@ -62,30 +62,6 @@ struct ClCacheDefaultConfigWindowsTest : public ::testing::Test { VariableBackup createDirectoryAResultBackup; }; -TEST_F(ClCacheDefaultConfigWindowsTest, GivenDefaultClCacheConfigWithPathExistsThenValuesAreProperlyPopulated) { - mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; - - bool pathExistsMock = true; - VariableBackup pathExistsMockBackup(&NEO::SysCalls::pathExistsMock, pathExistsMock); - - auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheLocation().c_str(), cacheConfig.cacheDir.c_str()); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheFileExtension().c_str(), cacheConfig.cacheFileExtension.c_str()); - EXPECT_TRUE(cacheConfig.enabled); -} - -TEST_F(ClCacheDefaultConfigWindowsTest, GivenDefaultClCacheConfigWithNonExistingPathThenValuesAreProperlyPopulated) { - mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; - - bool pathExistsMock = false; - VariableBackup pathExistsMockBackup(&NEO::SysCalls::pathExistsMock, pathExistsMock); - - auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheLocation().c_str(), cacheConfig.cacheDir.c_str()); - EXPECT_STREQ(ApiSpecificConfig::compilerCacheFileExtension().c_str(), cacheConfig.cacheFileExtension.c_str()); - EXPECT_FALSE(cacheConfig.enabled); -} - TEST_F(ClCacheDefaultConfigWindowsTest, GivenAllEnvVarWhenProperlySetThenCorrectConfigIsReturned) { mockableEnvs["NEO_CACHE_PERSISTENT"] = "1"; mockableEnvs["NEO_CACHE_MAX_SIZE"] = "22"; @@ -289,4 +265,12 @@ TEST_F(ClCacheDefaultConfigWindowsTest, GivenCachePathExistsAndNoEnvVarsSetWhenG EXPECT_EQ(cacheConfig.cacheDir, expectedCacheDirPath); } +TEST_F(ClCacheDefaultConfigWindowsTest, GivenNeoCachePersistentSetToZeroWhenGetDefaultCompilerCacheConfigThenCacheIsDisabled) { + mockableEnvs["NEO_CACHE_PERSISTENT"] = "0"; + + auto cacheConfig = NEO::getDefaultCompilerCacheConfig(); + + EXPECT_FALSE(cacheConfig.enabled); +} + } // namespace NEO diff --git a/shared/test/unit_test/os_interface/debug_env_reader_tests.cpp b/shared/test/unit_test/os_interface/debug_env_reader_tests.cpp index c74effa00a..e75df0c6d2 100644 --- a/shared/test/unit_test/os_interface/debug_env_reader_tests.cpp +++ b/shared/test/unit_test/os_interface/debug_env_reader_tests.cpp @@ -483,12 +483,6 @@ TEST_F(DebugEnvReaderTests, GivenBoolEnvVariableWhenGettingThenCorrectValueIsRet } } -TEST_F(DebugEnvReaderTests, WhenSettingAppSpecificLocationThenLocationIsReturned) { - std::string appSpecific; - appSpecific = "cl_cache_dir"; - EXPECT_EQ(appSpecific, environmentVariableReader->appSpecificLocation(appSpecific)); -} - TEST_F(DebugEnvReaderTests, givenEnvironmentVariableReaderWhenCreateOsReaderWithStringThenNotNullPointer) { std::unique_ptr settingsReader(SettingsReader::createOsReader(false, "")); EXPECT_NE(nullptr, settingsReader); diff --git a/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp b/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp index b997786980..4648a18e0a 100644 --- a/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/registry_reader_tests.cpp @@ -507,24 +507,4 @@ TEST_F(RegistryReaderTest, givenRegistryKeyPresentWhenValueIsNonZeroInBothDwords EXPECT_TRUE(value); EXPECT_EQ(DebugVarPrefix::none, type); } - -TEST_F(DebugReaderWithRegistryAndEnvTest, givenSetProcessNameWhenReadFromEnvironmentVariableThenReturnClCacheDir) { - SysCalls::regOpenKeySuccessCount = 0u; - SysCalls::regQueryValueSuccessCount = 0u; - registryReader.processName = "processName"; - std::string defaultCacheDir = ""; - std::string cacheDir = registryReader.getSetting("processName", defaultCacheDir); - EXPECT_STREQ("./tested_cl_cache_dir", cacheDir.c_str()); -} - -TEST_F(DebugReaderWithRegistryAndEnvTest, givenSetProcessNameWhenReadFromEnvironmentVariableThenReturnClCacheDirPrefix) { - SysCalls::regOpenKeySuccessCount = 0u; - SysCalls::regQueryValueSuccessCount = 0u; - registryReader.processName = "processName"; - std::string defaultCacheDir = ""; - DebugVarPrefix type = DebugVarPrefix::none; - std::string cacheDir2 = registryReader.getSetting("processName", defaultCacheDir, type); - EXPECT_STREQ("./tested_cl_cache_dir", cacheDir2.c_str()); - EXPECT_EQ(DebugVarPrefix::none, type); -} } // namespace NEO diff --git a/shared/test/unit_test/os_interface/windows/registry_reader_tests.h b/shared/test/unit_test/os_interface/windows/registry_reader_tests.h index e35b314d36..8e315d3002 100644 --- a/shared/test/unit_test/os_interface/windows/registry_reader_tests.h +++ b/shared/test/unit_test/os_interface/windows/registry_reader_tests.h @@ -38,7 +38,6 @@ class TestedRegistryReader : public RegistryReader { IoFunctions::mockableEnvValues->insert({"settingSourceString", "environment"}); IoFunctions::mockableEnvValues->insert({"settingSourceInt", "2"}); IoFunctions::mockableEnvValues->insert({"processName", "processName"}); - IoFunctions::mockableEnvValues->insert({"cl_cache_dir", "./tested_cl_cache_dir"}); } const char *getRegKey() const { return registryReadRootKey.c_str();