From 739f47eb0fdab2b75a380f33665dcd84978252b4 Mon Sep 17 00:00:00 2001 From: nimlgen <138685161+nimlgen@users.noreply.github.com> Date: Tue, 26 Mar 2024 16:14:38 +0300 Subject: [PATCH] check on cuEventSynchronize (#3933) --- 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 e6d08ba727..227c1e8fba 100644 --- a/tinygrad/runtime/ops_cuda.py +++ b/tinygrad/runtime/ops_cuda.py @@ -43,7 +43,7 @@ def cu_time_execution(cb, enable=False) -> Optional[float]: cuda.cuEventRecord(evs[0], None) cb() cuda.cuEventRecord(evs[1], None) - cuda.cuEventSynchronize(evs[1]) + check(cuda.cuEventSynchronize(evs[1])) cuda.cuEventElapsedTime(ctypes.byref(ret := ctypes.c_float()), evs[0], evs[1]) for ev in evs: cuda.cuEventDestroy_v2(ev) return ret.value * 1e-3