Unverified Commit 1516f43c authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[Cache] raise errors for `tileang.clear_cache()` (#1077)

parent 6a388c0e
...@@ -39,9 +39,15 @@ def cached( ...@@ -39,9 +39,15 @@ def cached(
def clear_cache(): def clear_cache():
""" """
Clears the entire kernel cache (using KernelCache class). Disabled helper that previously removed the entire kernel cache.
Raises:
RuntimeError: Always raised to warn users to clear the cache manually.
""" """
_kernel_cache_instance.clear_cache() cache_dir = env.TILELANG_CACHE_DIR
raise RuntimeError("tilelang.clear_cache() is disabled because deleting the cache directory "
"is dangerous. If you accept the risk, remove it manually with "
f"`rm -rf '{cache_dir}'`.")
if env.TILELANG_CLEAR_CACHE.lower() in ("1", "true", "yes", "on"): if env.TILELANG_CLEAR_CACHE.lower() in ("1", "true", "yes", "on"):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment