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

Function serial_count_kernel

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

Source from the content-addressed store, hash-verified

459
460 @tilelang.jit
461 def serial_count_kernel():
462 @T.prim_func
463 def kernel(out: T.Tensor((1,), T.int32)) -> None:
464 with T.Kernel(1, threads=1) as _:
465 count_var = T.alloc_var(T.int32, init=0)
466 for _ in T.serial(N):
467 count_var = count_var + 1
468 out[0] = count_var
469
470 return kernel
471
472 out = torch.zeros(1, dtype=torch.int32, device="cuda")
473 serial_count_kernel()(out)

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…