(inp: T.Tensor((1,), T.int32), out: T.Tensor((1,), T.int32))
| 17 | def kernel_fn(): |
| 18 | @T.prim_func |
| 19 | def kernel(inp: T.Tensor((1,), T.int32), out: T.Tensor((1,), T.int32)): |
| 20 | with T.Kernel(1, threads=64) as _: |
| 21 | tx = T.get_thread_binding() |
| 22 | slot = T.alloc_shared((1,), T.int32) |
| 23 | |
| 24 | ready_barrier = 10 |
| 25 | empty_barrier = 11 |
| 26 | participant_threads = 64 |
| 27 | |
| 28 | if tx < 32: |
| 29 | if tx == 0: |
| 30 | slot[0] = inp[0] + 1 |
| 31 | T.named_barrier_arrive(ready_barrier, participant_threads) |
| 32 | T.sync_threads(empty_barrier, participant_threads) |
| 33 | else: |
| 34 | T.sync_threads(ready_barrier, participant_threads) |
| 35 | if tx == 32: |
| 36 | out[0] = slot[0] |
| 37 | T.named_barrier_arrive(empty_barrier, participant_threads) |
| 38 | |
| 39 | return kernel |
| 40 |
nothing calls this directly
no test coverage detected
searching dependent graphs…