(M, N, dtype, op, src_scope, dst_scope, threads, batch)
| 99 | |
| 100 | @tilelang.jit(out_idx=-1) |
| 101 | def kernel(M, N, dtype, op, src_scope, dst_scope, threads, batch): |
| 102 | @T.prim_func |
| 103 | def main(A: T.Tensor((M, N), dtype), B: T.Tensor((M,), dtype)): |
| 104 | with T.Kernel(1, threads=threads): |
| 105 | if src_scope == "fragment": |
| 106 | src = T.alloc_fragment((M, N), dtype) |
| 107 | else: |
| 108 | src = T.alloc_shared((M, N), dtype) |
| 109 | if dst_scope == "fragment": |
| 110 | dst = T.alloc_fragment((M,), dtype) |
| 111 | else: |
| 112 | dst = T.alloc_shared((M,), dtype) |
| 113 | T.copy(A, src, disable_tma=src_scope == "shared") |
| 114 | _reduce_op(T, op, src, dst, dim=1, batch=batch) |
| 115 | T.copy(dst, B) |
| 116 | |
| 117 | return main |
| 118 | |
| 119 | jit_kernel = kernel(M, N, dtype, op, src_scope, dst_scope, threads, batch) |
| 120 |
no test coverage detected
searching dependent graphs…