From 5a4a2ab8ab59a4c4433598c79666898d7dc7c344 Mon Sep 17 00:00:00 2001 From: "Diedrich, Kamil" Date: Tue, 9 May 2023 00:39:55 +0200 Subject: [PATCH] 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 Related-To: NEO-4262 --- opencl/doc/FAQ.md | 62 +- .../default_cache_config.cpp | 42 +- .../compiler_interface/CMakeLists.txt | 6 +- .../linux/default_cl_cache_config_tests.cpp | 213 +++++ .../source/compiler_interface/CMakeLists.txt | 3 + .../linux/os_compiler_cache_helper.cpp | 57 ++ .../os_compiler_cache_helper.h | 14 + .../windows/os_compiler_cache_helper.cpp | 14 + shared/source/os_interface/linux/sys_calls.h | 1 + .../os_interface/linux/sys_calls_linux.cpp | 4 + .../linux/sys_calls_linux_ult.cpp | 14 + .../os_interface/linux/sys_calls_linux_ult.h | 2 + .../compiler_interface/CMakeLists.txt | 11 +- .../compiler_cache_tests.cpp | 570 ------------- .../linux/compiler_cache_tests_linux.cpp | 806 ++++++++++++++++++ .../windows/compiler_cache_tests_windows.cpp | 23 + 16 files changed, 1257 insertions(+), 585 deletions(-) create mode 100644 opencl/test/unit_test/compiler_interface/linux/default_cl_cache_config_tests.cpp create mode 100644 shared/source/compiler_interface/linux/os_compiler_cache_helper.cpp create mode 100644 shared/source/compiler_interface/os_compiler_cache_helper.h create mode 100644 shared/source/compiler_interface/windows/os_compiler_cache_helper.cpp create mode 100644 shared/test/unit_test/compiler_interface/linux/compiler_cache_tests_linux.cpp create mode 100644 shared/test/unit_test/compiler_interface/windows/compiler_cache_tests_windows.cpp diff --git a/opencl/doc/FAQ.md b/opencl/doc/FAQ.md index 99d84e1b5f..8f381e5f67 100644 --- a/opencl/doc/FAQ.md +++ b/opencl/doc/FAQ.md @@ -1,6 +1,6 @@