diff --git a/test/backend/test_renderer_failures.py b/test/backend/test_renderer_failures.py index 83a83800af..867980036b 100644 --- a/test/backend/test_renderer_failures.py +++ b/test/backend/test_renderer_failures.py @@ -34,7 +34,7 @@ class TestRendererFailures(unittest.TestCase): @unittest.skipIf(not isinstance(Device[Device.DEFAULT].renderer, (PTXRenderer, PythonRenderer)), "test is for ptx or python renderer") def test_gated_store_with_alu(self): a = UOp.param(0, dtypes.int, (4,)) - gate_alu = (lidx0:=UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 4),), arg='lidx0')).ne(0) + gate_alu = (lidx0:=UOp.special(4, 'lidx0')).ne(0) gated_alu_store = UOp(Ops.STORE, src=(a.index(lidx0.valid(gate_alu)), UOp.const(dtypes.int, 1))) sink = UOp(Ops.SINK, src=(gated_alu_store,), arg=KernelInfo()) ret = _test_uop_result([], sink, local_size=[4, 1, 1])[0] @@ -43,8 +43,8 @@ class TestRendererFailures(unittest.TestCase): @unittest.skipIf(not isinstance(Device[Device.DEFAULT].renderer, (PTXRenderer, PythonRenderer)), "test is for ptx or python renderer") def test_gated_store_with_alu_2d(self): a = UOp.param(0, dtypes.int, (8,)) - gate_alu_0 = (lidx0:=UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 4),), arg='lidx0')).ne(0) - gate_alu_1 = (lidx1:=UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 2),), arg='lidx1')).ne(0) + gate_alu_0 = (lidx0:=UOp.special(4, 'lidx0')).ne(0) + gate_alu_1 = (lidx1:=UOp.special(2, 'lidx1')).ne(0) gated_alu_store = UOp(Ops.STORE, src=(a.index((lidx0+lidx1*4).valid(gate_alu_0&gate_alu_1)), UOp.const(dtypes.int, 1))) sink = UOp(Ops.SINK, src=(gated_alu_store,), arg=KernelInfo()) ret = _test_uop_result([], sink, local_size=[4, 2, 1])[0] @@ -88,7 +88,7 @@ class TestWGSLFailures(unittest.TestCase): a = UOp.param(0, dtypes.int, (4,)) b = UOp.param(1, dtypes.int, (4,)) c = UOp.param(2, dtypes.int, (4,)) - lidx0 = UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 4),), arg="lidx0") + lidx0 = UOp.special(4, "lidx0") gate = lidx0.ne(0) alt = c.index(lidx0).load() ld = UOp.load(b.index(lidx0.valid(gate))) @@ -103,7 +103,7 @@ class TestPTXFailures(unittest.TestCase): @unittest.skip("INDEX can only have a gate ALU parent, not an IF") def test_gated_store_with_if(self): a = UOp.param(0, dtypes.int, (4,)) - gate_alu = (lidx0:=UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 4),), arg='lidx0')).ne(0) + gate_alu = (lidx0:=UOp.special(4, 'lidx0')).ne(0) val = UOp.const(dtypes.int, 1) if_uop = UOp(Ops.IF, src=(gate_alu,)) gated_alu_store = UOp(Ops.STORE, src=(a.index(lidx0, if_uop), val)) diff --git a/test/null/test_uop_graph.py b/test/null/test_uop_graph.py index 7164a3cfed..3a79dcc4b4 100644 --- a/test/null/test_uop_graph.py +++ b/test/null/test_uop_graph.py @@ -532,7 +532,7 @@ class TestUOpGraph(unittest.TestCase): def test_fold_gated_load_local(self): glbl0 = UOp.param(0, dtypes.int, (16,)) smem = UOp.placeholder((18,), dtypes.int, slot=0, addrspace=AddrSpace.LOCAL) - lidx = UOp.special(16, "lidx0", dtypes.int) + lidx = UOp.special(16, "lidx0") st = smem.index(lidx).store(glbl0.index(lidx).load()) barrier = st.barrier() ld0 = smem.after(barrier).index(UOp.invalid()) diff --git a/test/null/test_uops.py b/test/null/test_uops.py index 25accb04ff..54d77f1730 100644 --- a/test/null/test_uops.py +++ b/test/null/test_uops.py @@ -111,9 +111,9 @@ class TestExecALU(unittest.TestCase): class TestGatedStoreRewrite(unittest.TestCase): def test_tiny_gate_store(self): gmem = UOp.param(0, dtypes.float, (8,)) - gidx0 = UOp(Ops.SPECIAL, src=(UOp.const(dtypes.int, 4),), arg='gidx0') - gate = gidx0 (UPat(Ops.IF, dtype=dtypes.void, src=(UPat(dtype=dtypes.bool), UPat((Ops.CAST, Ops.INDEX, Ops.SHRINK)))), lambda: True), (UPat(Ops.ENDIF, dtype=dtypes.void, src=(UPat(Ops.IF),)), lambda: True), + + # SPECIAL is int32 after index lowering + (UPat(Ops.SPECIAL, src=(UPat.var("x", dtypes.int32),), name="s"), lambda s,x: s.dtype == x.dtype and isinstance(s.arg, str)), ])+spec_shared # these are intermediate ops. everything should be deleted from here