(
N,
block_N,
dtype,
)
| 164 | |
| 165 | |
| 166 | def alloc_global( |
| 167 | N, |
| 168 | block_N, |
| 169 | dtype, |
| 170 | ): |
| 171 | @T.prim_func |
| 172 | def main( |
| 173 | A: T.Tensor((N,), dtype), |
| 174 | B: T.Tensor((N,), dtype), |
| 175 | ): |
| 176 | C = T.alloc_global((N,), dtype) |
| 177 | with T.Kernel(T.ceildiv(N, block_N), threads=block_N) as bx: |
| 178 | T.copy(A[bx * block_N : (bx + 1) * block_N], C[bx * block_N : (bx + 1) * block_N]) |
| 179 | T.copy(C[bx * block_N : (bx + 1) * block_N], B[bx * block_N : (bx + 1) * block_N]) |
| 180 | |
| 181 | return main |
| 182 | |
| 183 | |
| 184 | def run_alloc_global( |
no outgoing calls
no test coverage detected
searching dependent graphs…