mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 00:10:58 +08:00
feature: Add new environment variables for compiler cache
This patch add new environment variables to control compiler cache. Works as follow: If persistent cache is set driver check if NEO_CACHE_DIR is set. If not then driver checks XDG_CACHE_HOME - If exists then driver create neo_compiler_cache folder, if not then driver checks HOME directory. If each NEO_CACHE_DIR, XDG_CACHE_HOME and HOME are not set then compiler cache is disabled. Current support is for Linux only. Signed-off-by: Diedrich, Kamil <kamil.diedrich@intel.com> Related-To: NEO-4262
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
268dcb0777
commit
5a4a2ab8ab
@@ -89,8 +89,22 @@ int (*sysCallsScandir)(const char *dirp,
|
||||
int (*sysCallsUnlink)(const std::string &pathname) = nullptr;
|
||||
int (*sysCallsStat)(const std::string &filePath, struct stat *statbuf) = nullptr;
|
||||
int (*sysCallsMkstemp)(char *fileName) = nullptr;
|
||||
int (*sysCallsMkdir)(const std::string &dir) = nullptr;
|
||||
bool (*sysCallsPathExists)(const std::string &path) = nullptr;
|
||||
|
||||
int mkdir(const std::string &path) {
|
||||
if (sysCallsMkdir != nullptr) {
|
||||
return sysCallsMkdir(path);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool pathExists(const std::string &path) {
|
||||
if (sysCallsPathExists != nullptr) {
|
||||
return sysCallsPathExists(path);
|
||||
}
|
||||
|
||||
return pathExistsMock;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
namespace NEO {
|
||||
namespace SysCalls {
|
||||
|
||||
extern int (*sysCallsMkdir)(const std::string &dir);
|
||||
extern int (*sysCallsOpen)(const char *pathname, int flags);
|
||||
extern int (*sysCallsOpenWithMode)(const char *pathname, int flags, int mode);
|
||||
extern ssize_t (*sysCallsPread)(int fd, void *buf, size_t count, off_t offset);
|
||||
@@ -38,6 +39,7 @@ extern int (*sysCallsScandir)(const char *dirp,
|
||||
extern int (*sysCallsUnlink)(const std::string &pathname);
|
||||
extern int (*sysCallsStat)(const std::string &filePath, struct stat *statbuf);
|
||||
extern int (*sysCallsMkstemp)(char *fileName);
|
||||
extern bool (*sysCallsPathExists)(const std::string &path);
|
||||
|
||||
extern int flockRetVal;
|
||||
extern int closeFuncRetVal;
|
||||
|
||||
Reference in New Issue
Block a user