diff options
Diffstat (limited to 'tools/cf_diff.py')
| -rw-r--r-- | tools/cf_diff.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/cf_diff.py b/tools/cf_diff.py index 78f5f54b0..91f0097e4 100644 --- a/tools/cf_diff.py +++ b/tools/cf_diff.py | |||
| @@ -55,7 +55,9 @@ if SEM_DIR not in sys.path: | |||
| 55 | 55 | ||
| 56 | import cf_ref # noqa: E402 | 56 | import cf_ref # noqa: E402 |
| 57 | import cpu_ref # noqa: E402 | 57 | import cpu_ref # noqa: E402 |
| 58 | import rdna2spirv # noqa: E402 | 58 | # The translator is imported where it is used (run_case), not here: rdna2spirv.py takes seconds to compile, and |
| 59 | # with dont_write_bytecode the compiled code is never cached, so --help and a usage error would wait for it on | ||
| 60 | # every run. | ||
| 59 | from spirv_wave_interp import UnsupportedConstruct, run_wave # noqa: E402 | 61 | from spirv_wave_interp import UnsupportedConstruct, run_wave # noqa: E402 |
| 60 | 62 | ||
| 61 | STUB_DXBC = b"DXBC" + bytes(24) + struct.pack("<I", 0) + bytes(4) | 63 | STUB_DXBC = b"DXBC" + bytes(24) + struct.pack("<I", 0) + bytes(4) |
| @@ -434,6 +436,7 @@ def build(body, wave): | |||
| 434 | 436 | ||
| 435 | def run_case(name, body, wave, structured=True): | 437 | def run_case(name, body, wave, structured=True): |
| 436 | """Returns (status, detail): status in {"match", "mismatch", "skip"}.""" | 438 | """Returns (status, detail): status in {"match", "mismatch", "skip"}.""" |
| 439 | import rdna2spirv # here, not at the top of the file: see the note above the imports | ||
| 437 | lines = build(body, wave) | 440 | lines = build(body, wave) |
| 438 | text = listing_text(lines, name) | 441 | text = listing_text(lines, name) |
| 439 | with tempfile.TemporaryDirectory(prefix="cf-diff-") as tmp: | 442 | with tempfile.TemporaryDirectory(prefix="cf-diff-") as tmp: |