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

Function alloc_var_add

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

Source from the content-addressed store, hash-verified

42
43
44def 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
68def run_alloc_var_add(

Callers 1

run_alloc_var_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…