fix viz addrspace (#16437)

* fix viz addrspace

* revert that
This commit is contained in:
George Hotz
2026-05-29 12:58:05 -07:00
committed by GitHub
parent d69aca41a9
commit 9506b78d73
2 changed files with 3 additions and 3 deletions

View File

@@ -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"

View File

@@ -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: