mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
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>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c9fdeb200c
commit
26ca64bb28
@@ -14,19 +14,3 @@ TEST(CompilerCache, GivenDefaultClCacheConfigThenValuesAreProperlyPopulated) {
|
||||
EXPECT_STREQ(".cl_cache", cacheConfig.cacheFileExtension.c_str());
|
||||
EXPECT_TRUE(cacheConfig.enabled);
|
||||
}
|
||||
|
||||
TEST(CompilerCacheTests, GivenExistingConfigWhenLoadingFromCacheThenBinaryIsLoaded) {
|
||||
NEO::CompilerCache cache(NEO::getDefaultCompilerCacheConfig());
|
||||
static const char *hash = "SOME_HASH";
|
||||
std::unique_ptr<char[]> data(new char[32]);
|
||||
for (size_t i = 0; i < 32; i++)
|
||||
data.get()[i] = static_cast<char>(i);
|
||||
|
||||
bool ret = cache.cacheBinary(hash, static_cast<const char *>(data.get()), 32);
|
||||
EXPECT_TRUE(ret);
|
||||
|
||||
size_t size;
|
||||
auto loadedBin = cache.loadCachedBinary(hash, size);
|
||||
EXPECT_NE(nullptr, loadedBin);
|
||||
EXPECT_NE(0U, size);
|
||||
}
|
||||
Reference in New Issue
Block a user