()
| 142 | |
| 143 | |
| 144 | def test_continue_loop(): |
| 145 | @T.prim_func(s_tir=True) |
| 146 | def func(Out: T.Buffer((2,), "int32")): |
| 147 | T.func_attr({"global_symbol": "main"}) |
| 148 | Out[0] = 0 |
| 149 | Out[1] = 0 |
| 150 | for i in range(10): |
| 151 | for j in range(10): |
| 152 | if (i * 10 + j) % 3 != 0: |
| 153 | continue |
| 154 | Out[0] = Out[0] + 1 |
| 155 | k = T.decl_buffer([], "int32") |
| 156 | k[()] = 0 |
| 157 | while k[()] < Out[0]: |
| 158 | k[()] = k[()] + 1 |
| 159 | if k[()] % 6 == 0: |
| 160 | Out[1] = Out[1] + 1 |
| 161 | continue |
| 162 | |
| 163 | func = build_tir_func(func) |
| 164 | b = np.zeros([2], "int32") |
| 165 | if not hasattr(b, "__dlpack__"): |
| 166 | return |
| 167 | func(b) |
| 168 | assert b[0] == 34 |
| 169 | assert b[1] == 5 |
| 170 | |
| 171 | |
| 172 | def test_exception(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…