autogen cleanup (#6064)

* start autogen cleanup

* nvgpu

* better?

* better

* amd part

* gpu regen

* fix mockgpu amd

* nv

* amd fix linter

* remove import

* ugh

* nv on master

* amd on master
This commit is contained in:
nimlgen
2024-08-14 20:20:35 +03:00
committed by GitHub
parent de773b593e
commit 7ab531aede
10 changed files with 52332 additions and 36394 deletions

View File

@@ -9,7 +9,7 @@ from tinygrad.device import BufferOptions, LRUAllocator, Compiled, Compiler, Com
# see test/external/external_osx_profiling.py to determine this ratio. it's in like GPU clocks or something
OSX_TIMING_RATIO = (125/3) if OSX else 1.0
cl_errors = {attr: k for k in dir(cl) if k.startswith("CL_") and (attr:=getattr(cl, k)) <= 0}
cl_errors = {attr: k for k in dir(cl) if k.startswith("CL_") and isinstance(attr:=getattr(cl, k), int) and attr <= 0}
def check(status):
if status != 0: raise RuntimeError(f"OpenCL Error {status}: {cl_errors.get(status, 'Unknown error')}")
def checked(ret, status): return (check(status.value), ret)[1]