From 760d501be883dd0ea1c424be186fbbd00aae0dcd Mon Sep 17 00:00:00 2001 From: PGZXB Date: Wed, 14 Sep 2022 09:39:22 +0800 Subject: [PATCH] [misc] Enable offline cache in frontend instead of C++ Side (#6051) Related issue = #4401 Enabling offline cache in C++ Side (setting `CompileConfig::offline_cache` as `true` by default) is dangerous. The offline cache will always be enabled when running taichi_cpp_tests because the value of compile config in C++ side is not affected by env variables, which is not expected and can cause some strange bugs because it will unexpectedly load cache files that were not expected to generate. --- python/taichi/lang/misc.py | 1 + taichi/program/compile_config.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/taichi/lang/misc.py b/python/taichi/lang/misc.py index 96319f28bf8d8..4b6c38ebdeb4e 100644 --- a/python/taichi/lang/misc.py +++ b/python/taichi/lang/misc.py @@ -348,6 +348,7 @@ def init(arch=None, current_dir = os.getcwd() cfg = impl.default_cfg() + cfg.offline_cache = True # Enable offline cache in frontend instead of C++ side # Check if installed version meets the requirements. if require_version is not None: check_require_version(require_version) diff --git a/taichi/program/compile_config.h b/taichi/program/compile_config.h index 14f17e419fd6d..622ddb39139df 100644 --- a/taichi/program/compile_config.h +++ b/taichi/program/compile_config.h @@ -96,7 +96,7 @@ struct CompileConfig { int auto_mesh_local_default_occupacy{4}; // Offline cache options - bool offline_cache{true}; + bool offline_cache{false}; std::string offline_cache_file_path{get_repo_dir() + "ticache"}; std::string offline_cache_cleaning_policy{ "lru"}; // "never"|"version"|"lru"|"fifo"