14
14
# KIND, either express or implied. See the License for the
15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
+
18
+ import pytest
19
+ import sys
17
20
import tvm
18
21
from tvm import tir
19
22
from tvm .script import ty , from_source
@@ -380,6 +383,17 @@ def test_match_buffer_shape_mismatch():
380
383
check_error (buffer_shape_mismatch , 7 )
381
384
382
385
386
+ def high_dim_store () -> None :
387
+ with tir .block ([], "root" ):
388
+ B = tir .allocate ([256 ], "float32" , "global" )
389
+ for i , j in tir .grid (16 , 16 ):
390
+ B [i , j ] = 1.0 # error: Store is only allowed with one index
391
+
392
+
393
+ def test_high_dim_store ():
394
+ check_error (high_dim_store , 5 )
395
+
396
+
383
397
def check_error (module , rel_lineno ):
384
398
# Override the default renderer to accumulate errors
385
399
_ , start_line = inspect .getsourcelines (module )
@@ -404,31 +418,4 @@ def render(e):
404
418
405
419
406
420
if __name__ == "__main__" :
407
- test_buffer_bind ()
408
- test_range_missing_args ()
409
- test_undefined_buffer ()
410
- test_unsupported_stmt ()
411
- test_unsupported_function_call ()
412
- test_missing_type_annotation ()
413
- test_invalid_expr_stmt ()
414
- test_invalid_for_function ()
415
- test_invalid_block_function ()
416
- test_return_not_allowed ()
417
- test_tir_assert ()
418
- test_no_body ()
419
- test_allocate_with_buffers ()
420
- test_inconsistent_binding ()
421
- test_invalid_block_axes ()
422
- test_miss_block_bind ()
423
- test_invalid_loop_var ()
424
- test_inconsistent_grid ()
425
- test_invalid_match_buffer_region ()
426
- test_duplicate_buffer ()
427
- test_duplicate_block_signature ()
428
- test_opaque_access_during_complete ()
429
- test_convert_slice_to_bufferload ()
430
- test_error_index_type ()
431
- test_error_index_with_stop_slice ()
432
- test_mismatch_args ()
433
- test_tvm_exception_catch ()
434
- test_match_buffer_shape_mismatch ()
421
+ sys .exit (pytest .main ([__file__ ] + sys .argv [1 :]))
0 commit comments