File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,9 @@ def build_kernels(
473473
474474 return out_kernels
475475
476+ def __str__ (self ):
477+ return f"{ type (self ).__name__ } :{ cupy .cuda .get_device_id ()} "
478+
476479 def nparray_to_context_array (self , arr ):
477480 """
478481 Copies a numpy array to the device memory.
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ def build_kernels(
219219 fid .write (specialized_source )
220220
221221 prg = cl .Program (self .context , specialized_source ).build (
222- options = "-cl-std=CL2.0"
222+ options = "-cl-std=CL2.0" ,
223223 )
224224
225225 out_kernels = {}
@@ -238,6 +238,11 @@ def build_kernels(
238238
239239 return out_kernels
240240
241+ def __str__ (self ):
242+ platform_id = cl .get_platforms ().index (self .platform )
243+ device_id = self .platform .get_devices ().index (self .device )
244+ return f"{ type (self ).__name__ } :{ platform_id } .{ device_id } "
245+
241246 def nparray_to_context_array (self , arr ):
242247 """
243248 Copies a numpy array to the device memory.
You can’t perform that action at this time.
0 commit comments