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

Function kernel

testing/python/issue/test_tilelang_issue_2188.py:19–37  ·  view source on GitHub ↗
(inp: T.Tensor((1,), T.int32), out: T.Tensor((1,), T.int32))

Source from the content-addressed store, hash-verified

17 def kernel_fn():
18 @T.prim_func
19 def kernel(inp: T.Tensor((1,), T.int32), out: T.Tensor((1,), T.int32)):
20 with T.Kernel(1, threads=64) as _:
21 tx = T.get_thread_binding()
22 slot = T.alloc_shared((1,), T.int32)
23
24 ready_barrier = 10
25 empty_barrier = 11
26 participant_threads = 64
27
28 if tx < 32:
29 if tx == 0:
30 slot[0] = inp[0] + 1
31 T.named_barrier_arrive(ready_barrier, participant_threads)
32 T.sync_threads(empty_barrier, participant_threads)
33 else:
34 T.sync_threads(ready_barrier, participant_threads)
35 if tx == 32:
36 out[0] = slot[0]
37 T.named_barrier_arrive(empty_barrier, participant_threads)
38
39 return kernel
40

Callers

nothing calls this directly

Calls 1

get_thread_bindingMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…