mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
define var (#3548)
* define var * remove vars from there * fix python symbolic ops * fix llvm * pypath
This commit is contained in:
parent
83cdc85790
commit
2c19ab6561
8 changed files with 26 additions and 22 deletions
|
|
@ -56,6 +56,7 @@ class PythonProgram:
|
|||
ul: Dict[int, Any] = {}
|
||||
dl: Dict[int, DType] = {}
|
||||
pbufs: List[memoryview] = list(bufs)
|
||||
pvals: List[int] = list(vals)
|
||||
i = 0
|
||||
loop_ends: Dict[int, int] = {}
|
||||
while i < len(self.uops):
|
||||
|
|
@ -97,6 +98,8 @@ class PythonProgram:
|
|||
assert dtype.fmt is not None
|
||||
lbuf = memoryview(bytearray(arg[1]*dtype.itemsize))
|
||||
ul[i] = [lbuf.cast(dtype.fmt)] * warp_size
|
||||
elif uop is UOps.DEFINE_VAR:
|
||||
ul[i] = [pvals.pop(0)] * warp_size
|
||||
elif uop is UOps.SPECIAL:
|
||||
if arg[1][0] == 'g':
|
||||
ul[i] = [idxs[2-arg[0]]] * warp_size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue