Hzfengsy commented on code in PR #11308:
URL: https://github.com/apache/tvm/pull/11308#discussion_r872383950


##########
tests/python/unittest/test_tvmscript_error_report.py:
##########
@@ -658,5 +635,42 @@ def test_preflattened_buffer_map_offset_factor():
     check_error(preflattened_buffer_map_offset_factor_nonint, 3)
 
 
+def strided_buffer_region(A: T.handle):
+    # do not allow stride in buffer region
+    A = T.match_buffer((128, 128), "int32")
+    with T.block():
+        T.reads([])
+        T.writes([A[0:128:2, 0:128:3]])  # error
+        T.evaluate(T.call_extern("strided_compute", dtype=""))
+
+
+def strided_buffer_region(A: T.handle):
+    # do not allow stride in buffer region
+    A = T.match_buffer((128, 128), "int32")
+    with T.block():
+        T.reads([])
+        T.writes([A[0:128:2, 0:128:3]])  # error
+        T.evaluate(T.call_extern("strided_compute", dtype=""))
+
+
+def access_reversed_slice(A: T.handle):
+    # do not allow reversed slice step
+    A = T.match_buffer((128,), "int32")
+    A[0:128:-1] = T.broadcast(1, 128)
+
+
+def access_non_const_slice(A: T.handle):
+    # do not allow reversed slice step

Review Comment:
   error comment?



##########
tests/python/unittest/test_tvmscript_error_report.py:
##########
@@ -658,5 +635,42 @@ def test_preflattened_buffer_map_offset_factor():
     check_error(preflattened_buffer_map_offset_factor_nonint, 3)
 
 
+def strided_buffer_region(A: T.handle):
+    # do not allow stride in buffer region
+    A = T.match_buffer((128, 128), "int32")
+    with T.block():
+        T.reads([])
+        T.writes([A[0:128:2, 0:128:3]])  # error
+        T.evaluate(T.call_extern("strided_compute", dtype=""))
+
+
+def strided_buffer_region(A: T.handle):

Review Comment:
   the duplicated test



-- 
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]

Reply via email to