mirror of
https://github.com/tile-ai/tilelang.git
synced 2026-10-25 07:14:16 +08:00
* reimplement ThreadSync pass * fix bugs * remove old storage_access * remove deadcode for debugging * format * add WhileOp & expose MakeGuard in constr_visitor * bugfix * bugfix * bugfix * bugfix * trigger ci * add try for checking * bugfix * update tvm with better analyzer * update tvm * Log for debugging in thread_storage_sync * format * consider let node * typo * remove debugging log * consider while op in thread_sync & fix bug sbout letnode * add testing for thread_sync issues * update testing for thread_sync * format * consider T.Ramp expr * remove useless header * format --------- Co-authored-by: LeiWang1999 <leiwang1999@outlook.com>
27 lines
619 B
Python
27 lines
619 B
Python
import tilelang
|
|
import tilelang.testing
|
|
from tilelang import language as T
|
|
|
|
|
|
@tilelang.jit
|
|
def get_shared_kernel():
|
|
@T.prim_func
|
|
def shared_kernel():
|
|
with T.Kernel(1, threads=32):
|
|
tx = T.get_thread_binding()
|
|
shared_mem = T.alloc_shared((32), dtype="float32", scope="shared")
|
|
if tx % 2 == 0:
|
|
a = shared_mem[tx]
|
|
shared_mem[tx ^ 1] = a
|
|
|
|
return shared_kernel
|
|
|
|
|
|
def test_issue_1026():
|
|
kernel = get_shared_kernel()
|
|
assert "__syncthreads" not in kernel.get_kernel_source()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
tilelang.testing.main()
|