MCPcopy Index your code
hub / github.com/apache/tvm / test_storage

Function test_storage

tests/python/tirx/test_layout.py:1453–1487  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1451
1452
1453def test_storage():
1454 def case1():
1455 layout = TileLayout(S[(8, 8) : (8, 1)])
1456 assert_structural_equal(layout.storage(), layout)
1457
1458 case1()
1459
1460 def case2():
1461 layout = TileLayout(S[(8, 4, 2) : (4 @ laneid, 1 @ laneid, 1)])
1462 layout_stroage = TileLayout(S[2:1])
1463 assert_structural_equal(layout.storage(), layout_stroage)
1464
1465 case2()
1466
1467 def case3():
1468 layout = SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3)
1469 assert_structural_equal(layout.storage(), layout)
1470
1471 case3()
1472
1473 def case4():
1474 layout = (
1475 TileLayout(S[2:1])
1476 .tile(TileLayout(S[(8, 4) : (4 @ laneid, 1 @ laneid)]), (8, 4), (1, 2))
1477 .tile(TileLayout(S[(2, 1) : (1, 2)]), (2, 1), (8, 8))
1478 .tile(TileLayout(S[(1, 8) : (8, 1)]), (1, 8), (16, 8))
1479 )
1480 layout_stroage = (
1481 TileLayout(S[2:1])
1482 .tile(TileLayout(S[(2, 1) : (1, 2)]), (2, 1), (1, 2))
1483 .tile(TileLayout(S[(1, 8) : (8, 1)]), (1, 8), (2, 2))
1484 )
1485 assert_structural_equal(layout.storage().canonicalize(), layout_stroage.canonicalize())
1486
1487 case4()
1488
1489
1490def test_unpack():

Callers

nothing calls this directly

Calls 4

case1Function · 0.85
case2Function · 0.85
case3Function · 0.85
case4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…