(
N,
block_N,
dtype,
)
| 42 | |
| 43 | |
| 44 | def alloc_var_add( |
| 45 | N, |
| 46 | block_N, |
| 47 | dtype, |
| 48 | ): |
| 49 | import tilelang.language as T |
| 50 | |
| 51 | @T.prim_func |
| 52 | def main( |
| 53 | A: T.Tensor((N,), dtype), |
| 54 | B: T.Tensor((N,), dtype), |
| 55 | ): |
| 56 | with T.Kernel(T.ceildiv(N, block_N), threads=block_N) as bx: |
| 57 | A_shared = T.alloc_shared([block_N], dtype) |
| 58 | tmp = T.alloc_var(dtype) |
| 59 | tmp = 1 # noqa: F841 |
| 60 | T.copy(A[bx * block_N], A_shared) |
| 61 | for i in T.Parallel(block_N): |
| 62 | A_shared[i] = A_shared[i] + tmp |
| 63 | T.copy(A_shared, B[bx * block_N]) |
| 64 | |
| 65 | return main |
| 66 | |
| 67 | |
| 68 | def run_alloc_var_add( |
no outgoing calls
no test coverage detected
searching dependent graphs…