(M: int = 4096)
| 8 | def test_issue_1549_strange_var_vectorization(): |
| 9 | @tl.jit |
| 10 | def get_wrong_kernel(M: int = 4096): |
| 11 | dtype = "int32" |
| 12 | num_threads = 64 |
| 13 | |
| 14 | @T.prim_func |
| 15 | def main( |
| 16 | Data: T.Tensor((M,), dtype), |
| 17 | ): |
| 18 | with T.Kernel(1, threads=num_threads) as _: |
| 19 | # Pre-allocated scalar variables (causes issue in 0.1.7.post1) |
| 20 | idx = T.alloc_var(T.int32) |
| 21 | for i in T.Parallel(M): |
| 22 | idx = i |
| 23 | Data[i] = idx |
| 24 | |
| 25 | return main |
| 26 | |
| 27 | kernel = get_wrong_kernel() |
| 28 | M = 2048 |
no outgoing calls
no test coverage detected
searching dependent graphs…