tilelang.cpu.language.kernel¶

CPU dialect of T.Kernel: the common launch plus CPU launch annotations.

Functions¶

Kernel(*blocks[, prelude])

Construct a kernel launch frame for CPU: a grid of tile programs.

Module Contents¶

tilelang.cpu.language.kernel.Kernel(*blocks, prelude=None)¶

Construct a kernel launch frame for CPU: a grid of tile programs.

The grid becomes the outer loop nest of the generated function and each tile program runs as a plain serial body; T.Parallel loops are lowered to serial loops. There are no SIMT threads, so this dialect has no threads and T.get_thread_binding() is rejected at compile time.

Parameters:
  • *blocks (int | PrimExpr) – Grid extent along each axis (1-3 dimensions). The launch yields one program index per axis.

  • prelude (str, optional) – C source injected before the generated kernel, e.g. #include lines or helper functions.

Return type:

tilelang.language.kernel.KernelLaunchFrame

Examples

with T.Kernel(T.ceildiv(N, 128)) as bx:
    for i in T.Parallel(128):
        ...