upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/cf_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cf_diff.py')
-rw-r--r--tools/cf_diff.py5
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
56import cf_ref # noqa: E402 56import cf_ref # noqa: E402
57import cpu_ref # noqa: E402 57import cpu_ref # noqa: E402
58import 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.
59from spirv_wave_interp import UnsupportedConstruct, run_wave # noqa: E402 61from spirv_wave_interp import UnsupportedConstruct, run_wave # noqa: E402
60 62
61STUB_DXBC = b"DXBC" + bytes(24) + struct.pack("<I", 0) + bytes(4) 63STUB_DXBC = b"DXBC" + bytes(24) + struct.pack("<I", 0) + bytes(4)
@@ -434,6 +436,7 @@ def build(body, wave):
434 436
435def run_case(name, body, wave, structured=True): 437def 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: