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

Function kernel

testing/python/language/test_tilelang_language_reduce.py:101–117  ·  view source on GitHub ↗
(M, N, dtype, op, src_scope, dst_scope, threads, batch)

Source from the content-addressed store, hash-verified

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

Callers 2

test_reduceFunction · 0.70
test_reduce_clearFunction · 0.70

Calls 1

reshapeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…