MCPcopy Create free account
hub / github.com/apache/tvm / test_buffer_access_ptr

Function test_buffer_access_ptr

tests/python/tirx-base/test_tir_buffer.py:40–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39
40def test_buffer_access_ptr():
41 m = tvm.tirx.SizeVar("m", "int32")
42 n = tvm.tirx.SizeVar("n", "int32")
43 Ab = tvm.tirx.decl_buffer((m, n), "float32", strides=[n + 1, 1])
44 aptr = Ab.access_ptr("rw")
45 tvm.ir.assert_structural_equal(aptr.args[3], Ab.strides[0] * m)
46 assert aptr.args[0].dtype == Ab.dtype
47 assert aptr.args[4].value == Buffer.READ | Buffer.WRITE
48 aptr = Ab.access_ptr("w")
49 assert aptr.args[4].value == Buffer.WRITE
50
51
52def test_buffer_access_ptr_offset():

Callers

nothing calls this directly

Calls 1

access_ptrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…