From 99fb115791d03b5064e1b622bb59cfdacfb3f2d1 Mon Sep 17 00:00:00 2001 From: nimlgen <138685161+nimlgen@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:39:59 +0300 Subject: [PATCH] cuda correct pointer type (#7153) --- tinygrad/runtime/ops_cuda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/ops_cuda.py b/tinygrad/runtime/ops_cuda.py index ef01369133..4e83f869bd 100644 --- a/tinygrad/runtime/ops_cuda.py +++ b/tinygrad/runtime/ops_cuda.py @@ -87,7 +87,7 @@ class CUDAAllocator(LRUAllocator): check(cuda.cuEventRecord(sync_event, None)) check(cuda.cuCtxSetCurrent(dest_dev.context)) check(cuda.cuStreamWaitEvent(None, sync_event, 0)) # sync the default stream on the dest dev - def offset(self, buf, size:int, offset:int): return ctypes.c_ulong(buf.value + offset) + def offset(self, buf, size:int, offset:int): return cuda.CUdeviceptr_v2(buf.value + offset) class CUDADevice(Compiled): devices: List[CUDADevice] = []