Skip to content

Commit

Permalink
[misc] Enable offline cache in frontend instead of C++ Side (#6051)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PGZXB authored Sep 14, 2022
1 parent c1fd7b2 commit 760d501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/taichi/lang/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion taichi/program/compile_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 760d501

Please sign in to comment.