MCPcopy Create free account
hub / github.com/tile-ai/tilelang / alloc_global

Function alloc_global

testing/python/language/test_tilelang_language_alloc.py:166–181  ·  view source on GitHub ↗
(
    N,
    block_N,
    dtype,
)

Source from the content-addressed store, hash-verified

164
165
166def 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
184def run_alloc_global(

Callers 1

run_alloc_globalFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…