mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-07 22:23:55 -05:00
visualize SQTT with the same cfg infrastructure (#13870)
* start * rough sketch * post render dag * art * intro g key * work * custom color scale * colors * more blue * better * smaller * use for loop in test
This commit is contained in:
@@ -178,5 +178,21 @@ class TestCfg(unittest.TestCase):
|
||||
s_endpgm(),
|
||||
])
|
||||
|
||||
def test_colored_blocks(self):
|
||||
N = 10
|
||||
asm = ["entry:", s_branch("init0"),]
|
||||
for i in range(N):
|
||||
asm += [f"init{i}:", s_mov_b32(s[1], i + 1), s_branch(loop:=f"loop{i}")]
|
||||
asm += [
|
||||
f"{loop}:",
|
||||
s_nop(i & 7),
|
||||
s_add_u32(s[1], s[1], -1),
|
||||
s_cmp_eq_i32(s[1], 0),
|
||||
s_cbranch_scc0(loop),
|
||||
s_branch(f"init{i+1}" if i + 1 < N else "end"),
|
||||
]
|
||||
asm += ["end:", s_endpgm()]
|
||||
run_asm("test_colored_blocks", asm)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user