MCPcopy Create free account
hub / github.com/tile-ai/tilelang / setup_module_env

Function setup_module_env

testing/python/cache/test_tilelang_kernel_cache.py:79–96  ·  view source on GitHub ↗

Setup and restore module-level environment and cache state.

()

Source from the content-addressed store, hash-verified

77
78@pytest.fixture(scope="module", autouse=True)
79def setup_module_env():
80 """Setup and restore module-level environment and cache state."""
81 # Save original env values
82 original_cache_dir = env.TILELANG_CACHE_DIR
83 original_tmp_dir = env.TILELANG_TMP_DIR
84
85 # Enable cache once for entire module
86 tilelang.enable_cache()
87
88 yield
89
90 # Restore env at module end
91 env.TILELANG_CACHE_DIR = original_cache_dir
92 env.TILELANG_TMP_DIR = original_tmp_dir
93
94 # Restore default postproc callbacks
95 tvm_ffi.register_global_func("tilelang_callback_cuda_postproc", f=lambda code, _: code, override=True)
96 tvm_ffi.register_global_func("tilelang_callback_cutedsl_postproc", f=lambda code, _: code, override=True)
97
98
99@pytest.fixture(scope="function")

Callers

nothing calls this directly

Calls 1

enable_cacheMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…