tilelang.cpu.language.kernel¶
CPU dialect of T.Kernel: the common launch plus CPU launch annotations.
Functions¶
|
Construct a kernel launch frame for CPU: a grid of tile programs. |
Module Contents¶
- tilelang.cpu.language.kernel.Kernel(*blocks, prelude=None, cpu_num_threads=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.Parallelloops are lowered to serial loops. There are no SIMT threads, so this dialect has nothreadsandT.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.
#includelines or helper functions.cpu_num_threads (int, optional) – OpenMP thread count for the grid parallel region when the
tl.cpu_parallelpass config is enabled: emitted as thenum_threads(n)clause.None(default) omits the clause and lets the OpenMP runtime pick the thread count (e.g. fromOMP_NUM_THREADS). Only thectarget consumes it — on thellvmtarget it has no effect, since that path lowers toTVMBackendParallelLaunchand uses TVM’s own thread pool.
- Return type:
Examples
with T.Kernel(T.ceildiv(N, 128)) as bx: for i in T.Parallel(128): ...