File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,11 @@ def sampler_from_string(ctx, sampler_descr):
106106
107107ctx = cl .create_some_context ()
108108queue = 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
111115samplers = {}
112116sampler_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 :
You can’t perform that action at this time.
0 commit comments