()
| 587 | |
| 588 | @tilelang.jit |
| 589 | def sync_warp_cond_kernel(): |
| 590 | @T.prim_func |
| 591 | def kernel( |
| 592 | x: T.Tensor((N,), T.float32), |
| 593 | out: T.Tensor((M,), T.float32), |
| 594 | ) -> None: |
| 595 | with T.Kernel(1, threads=N) as _: |
| 596 | shmem = T.alloc_shared((M,), T.float32) |
| 597 | tx = T.get_thread_binding() |
| 598 | if tx < M: |
| 599 | shmem[tx] = x[tx] |
| 600 | T.sync_warp() |
| 601 | for i in T.Parallel(M): |
| 602 | out[i] = shmem[i] |
| 603 | |
| 604 | return kernel |
| 605 | |
| 606 | x = torch.randn(N, dtype=torch.float32, device="cuda") |
| 607 | out = torch.zeros(M, dtype=torch.float32, device="cuda") |
no outgoing calls
no test coverage detected
searching dependent graphs…