mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +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
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,12 +15,12 @@ class CompilerCacheMock : public CompilerCache {
|
||||
CompilerCacheMock() : CompilerCache(CompilerCacheConfig{}) {
|
||||
}
|
||||
|
||||
bool cacheBinary(const std::string kernelFileHash, const char *pBinary, uint32_t binarySize) override {
|
||||
bool cacheBinary(const std::string &kernelFileHash, const char *pBinary, size_t binarySize) override {
|
||||
cacheInvoked++;
|
||||
return cacheResult;
|
||||
}
|
||||
|
||||
std::unique_ptr<char[]> loadCachedBinary(const std::string kernelFileHash, size_t &cachedBinarySize) override {
|
||||
std::unique_ptr<char[]> loadCachedBinary(const std::string &kernelFileHash, size_t &cachedBinarySize) override {
|
||||
if (loadResult || numberOfLoadResult > 0) {
|
||||
numberOfLoadResult--;
|
||||
cachedBinarySize = sizeof(char);
|
||||
|
||||
Reference in New Issue
Block a user