add index to DEFINE_GLOBAL (#3542)

* remove DEFINE_GLOBAL from uops with side effects

* add index to DEFINE_GLOBAL

* bugfix

* better var name
This commit is contained in:
George Hotz
2024-02-29 15:22:26 -08:00
committed by GitHub
parent 978a997d1f
commit 83cdc85790
5 changed files with 20 additions and 11 deletions

View File

@@ -92,7 +92,7 @@ class PythonProgram:
dl[i] = dtype
if uop is UOps.DEFINE_GLOBAL:
assert dtype.fmt is not None
ul[i] = [pbufs.pop(0).cast(dtype.fmt)] * warp_size
ul[i] = [pbufs[arg[0]].cast(dtype.fmt)] * warp_size
elif uop is UOps.DEFINE_LOCAL:
assert dtype.fmt is not None
lbuf = memoryview(bytearray(arg[1]*dtype.itemsize))