vinx13 commented on a change in pull request #9224:
URL: https://github.com/apache/tvm/pull/9224#discussion_r727501661
##########
File path: tests/python/unittest/test_tvmscript_complete.py
##########
@@ -272,10 +272,40 @@ def test_complete_match_buffer():
tvm.ir.assert_structural_equal(match_buffer_func,
expected_match_buffer_func)
[email protected]_func
+def alloc_buffer_func(a: T.handle, b: T.handle) -> None:
+ A = T.match_buffer(a, [2, 2], dtype="float32")
+ B = T.match_buffer(b, [2, 2], dtype="float32")
+ C = T.alloc_buffer([2, 2], dtype="float32")
+ A[(0, 0)] = T.float32(2)
+ C[(0, 0)] = A[(0, 0)] + B[(0, 0)]
+ B[(0, 0)] = C[(0, 0)]
+
+
[email protected]_func
+def expect_alloc_buffer_func(a: T.handle, b: T.handle) -> None:
+ A = T.match_buffer(a, [2, 2], dtype="float32", elem_offset=0, align=128,
offset_factor=1)
+ B = T.match_buffer(b, [2, 2], dtype="float32", elem_offset=0, align=128,
offset_factor=1)
+ with T.block([], "root"):
+ T.reads([])
+ T.writes([])
+ C = T.alloc_buffer([2, 2], dtype="float32", elem_offset=0, align=128,
offset_factor=1)
+ A[(0, 0)] = T.float32(2)
+ C[(0, 0)] = A[(0, 0)] + B[(0, 0)]
+ B[(0, 0)] = C[(0, 0)]
+
+
+def test_complete_alloc_buffer():
+ rt_func = tvm.script.from_source(alloc_buffer_func.script(show_meta=True))
+ rt_mod = tvm.build(rt_func, "llvm")
Review comment:
```suggestion
```
remove this as it is beyond script complete
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]