mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-13 00:15:35 +08:00
@@ -91,7 +91,7 @@ def add_gpudims(ctx:Renderer, s:UOp):
|
||||
subs = {}
|
||||
for r in s_topo:
|
||||
# look for local INDEXes that are not used in the GLOBAL store, then add them as an INVALID
|
||||
if r.op is Ops.STORE and (idx := r.src[0]).src[0].buf_uop.addrspace == AddrSpace.GLOBAL:
|
||||
if r.op is Ops.STORE and (idx := r.src[0]).src[0].addrspace == AddrSpace.GLOBAL:
|
||||
missing_locals = [all_ranges[rng] for rng in local_dims if all_ranges[rng] not in idx.ranges]
|
||||
if len(missing_locals):
|
||||
assert len(idx.src) == 2, "index has 2 sources"
|
||||
|
||||
@@ -764,8 +764,8 @@ class UOp(OpMixin, metaclass=UOpMetaClass):
|
||||
if self.op in GroupOp.Movement: return self.src[0].addrspace
|
||||
if self.op is Ops.STACK or self.op in GroupOp.Elementwise:
|
||||
ad = [x.addrspace for x in self.src if x.addrspace is not None]
|
||||
assert all_same(ad), f"addrspace mismatch in {self.op} -- {ad}"
|
||||
return ad[0] if len(ad) else None
|
||||
if not len(ad) or not all_same(ad): return None
|
||||
return ad[0]
|
||||
return None
|
||||
@property
|
||||
def buf_uop(self) -> UOp:
|
||||
|
||||
Reference in New Issue
Block a user