MCPcopy
hub / github.com/tinygrad/tinygrad / check

Function check

tinygrad/runtime/ops_cl.py:18–19  ·  view source on GitHub ↗
(status)

Source from the content-addressed store, hash-verified

16
17cl_errors = {attr: k for k in dir(cl) if k.startswith("CL_") and isinstance(attr:=getattr(cl, k), int) and attr <= 0}
18def check(status):
19 if status != 0: raise RuntimeError(f"OpenCL Error {status}: {cl_errors.get(status, 'Unknown error')}")
20def checked(ret, status): return (check(status.value), ret)[1]
21
22class CLCompiler(Compiler):

Callers 10

checkedFunction · 0.70
compileMethod · 0.70
__init__Method · 0.70
__del__Method · 0.70
__call__Method · 0.70
_freeMethod · 0.70
_copyinMethod · 0.70
_copyoutMethod · 0.70
__init__Method · 0.70
synchronizeMethod · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…