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

Function sync_warp_cond_kernel

testing/python/amd/test_tilelang_hip_codegen.py:589–604  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

587
588 @tilelang.jit
589 def sync_warp_cond_kernel():
590 @T.prim_func
591 def kernel(
592 x: T.Tensor((N,), T.float32),
593 out: T.Tensor((M,), T.float32),
594 ) -> None:
595 with T.Kernel(1, threads=N) as _:
596 shmem = T.alloc_shared((M,), T.float32)
597 tx = T.get_thread_binding()
598 if tx < M:
599 shmem[tx] = x[tx]
600 T.sync_warp()
601 for i in T.Parallel(M):
602 out[i] = shmem[i]
603
604 return kernel
605
606 x = torch.randn(N, dtype=torch.float32, device="cuda")
607 out = torch.zeros(M, dtype=torch.float32, device="cuda")

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…