From f9835a29a4c7fa2071f806e3c5762596d26932c5 Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Tue, 27 May 2025 11:27:07 +0100 Subject: [PATCH] Add basic support for replaying from SPIR-V Previously, replay checked for either an OpenCL C source file (kernel.cl) or a device binary (*.bin). This commit adds another check for a SPIR-V binary (kernel.spv). --- intercept/scripts/run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/intercept/scripts/run.py b/intercept/scripts/run.py index 27a91794..811d8b0f 100644 --- a/intercept/scripts/run.py +++ b/intercept/scripts/run.py @@ -150,6 +150,11 @@ def sampler_from_string(ctx, sampler_descr): with open("kernel.cl", 'r') as file: kernel = file.read() prg = cl.Program(ctx, kernel).build(options) +elif os.path.isfile("kernel.spv"): + print("Using kernel IL") + with open("kernel.spv", 'r') as file: + kernel = np.fromfile(file, dtype='uint8').tobytes() + prg = cl.Program(ctx, kernel).build(options) else: print("Using kernel device binary") binary_files = gl.glob("./DeviceBinary*.bin")