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

Function test_swizzle_layout_1

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

Source from the content-addressed store, hash-verified

1152 test_swizzle_layout_0()
1153
1154 def test_swizzle_layout_1():
1155 layout = SwizzleLayout(per_element=3, swizzle_len=3, atom_len=3)
1156 assert layout.size() == 512
1157 for i, j, k in itertools.product(range(8), range(8), range(8)):
1158 assert layout.apply((i * 8 + j) * 8 + k)["m"] == (i * 8 + (i ^ j)) * 8 + k
1159 # apply can accept coord larger than size
1160 for p in range(4096):
1161 outer = p // 512
1162 inner = p % 512
1163 i, j, k = inner // 64, (inner % 64) // 8, inner % 8
1164 assert layout.apply(p)["m"] == outer * 512 + (i * 8 + (i ^ j)) * 8 + k
1165
1166 test_swizzle_layout_1()
1167

Callers 1

test_applyFunction · 0.85

Calls 4

SwizzleLayoutClass · 0.90
productMethod · 0.80
sizeMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…