Skip to content

Commit 6e6ffe9

Browse files
authored
print the device and platform name when replaying kernels (#343)
1 parent 664e9a7 commit 6e6ffe9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

intercept/scripts/run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ def sampler_from_string(ctx, sampler_descr):
106106

107107
ctx = cl.create_some_context()
108108
queue = cl.CommandQueue(ctx)
109-
devices = ctx.get_info(cl.context_info.DEVICES)
109+
device = queue.get_info(cl.command_queue_info.DEVICE)
110+
platform = device.get_info(cl.device_info.PLATFORM)
111+
112+
print(f"Running on platform: {platform.get_info(cl.platform_info.NAME)}")
113+
print(f"Running on device: {device.get_info(cl.device_info.NAME)}")
110114

111115
samplers = {}
112116
sampler_files = gl.glob("./Sampler*.txt")
@@ -156,7 +160,7 @@ def sampler_from_string(ctx, sampler_descr):
156160
# Try the binaries to find one that works
157161
for idx in range(len(binaries)):
158162
try:
159-
prg = cl.Program(ctx, [devices[0]], [binaries[idx]]).build(options)
163+
prg = cl.Program(ctx, [device], [binaries[idx]]).build(options)
160164
getattr(prg, kernel_name)
161165
break
162166
except Exception as e:

0 commit comments

Comments
 (0)