()
| 38 | |
| 39 | |
| 40 | def 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 | |
| 52 | def test_buffer_access_ptr_offset(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…