Setup and restore module-level environment and cache state.
()
| 77 | |
| 78 | @pytest.fixture(scope="module", autouse=True) |
| 79 | def 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") |
nothing calls this directly
no test coverage detected
searching dependent graphs…