check on cuEventSynchronize (#3933)

This commit is contained in:
nimlgen
2024-03-26 16:14:38 +03:00
committed by GitHub
parent 778d17fbd3
commit 739f47eb0f

View File

@@ -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