From e347f10d333d1fdc2ab8daf261e821afe96b092b Mon Sep 17 00:00:00 2001 From: George Hotz Date: Thu, 1 Aug 2024 12:38:48 -0700 Subject: [PATCH] hotfix: print which opencl device we are using --- tinygrad/runtime/ops_gpu.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tinygrad/runtime/ops_gpu.py b/tinygrad/runtime/ops_gpu.py index 2330dace16..bb27dad6d2 100644 --- a/tinygrad/runtime/ops_gpu.py +++ b/tinygrad/runtime/ops_gpu.py @@ -90,6 +90,7 @@ class CLDevice(Compiled): self.device_id = CLDevice.device_ids[0 if ":" not in device else int(device.split(":")[1])] self.device_name = (cl.clGetDeviceInfo(self.device_id, cl.CL_DEVICE_NAME, 256, buf := ctypes.create_string_buffer(256), None), buf.value.decode())[1] # noqa: E501 self.driver_version = (cl.clGetDeviceInfo(self.device_id, cl.CL_DRIVER_VERSION, 256, buf := ctypes.create_string_buffer(256), None), buf.value.decode())[1] # noqa: E501 + if DEBUG >= 1: print(f"CLDevice: opening {self.device_name} with version {self.driver_version}") self.context = checked(cl.clCreateContext(None, 1, self.device_id, cl.clCreateContext.argtypes[3](), None, status := ctypes.c_int32()), status) self.queue = checked(cl.clCreateCommandQueue(self.context, self.device_id, cl.CL_QUEUE_PROFILING_ENABLE, status), status) self.pending_copyin: List[memoryview] = []