For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo module
rowwise
GPU row-wise reduction scaffolder.
The author writes one body[ctx: Context](row_coords) callable,
taking a comptime Context (the dispatch tier) and the row's
coords. The body composes a few helpers from this module:
reduceβ tier-aware iteration over the reduce axis, then a cross-thread join of the body's accumulators. Takes a per-tile callbacktile_fn[ws, _r](which closes over input closures + local monoid states) and a variadic ofReduceOpstates to pjoin after the loop. Zero states runs iteration only β used by 2-pass algorithms' second pass.onceβ run a closure exactly once per (logical) output row. Picks the canonical writer thread; the body never seeslane_id()/thread_idx.x.simdβ width-polymorphicSIMDconstructor from a per-lane callback; degenerates cleanly atw = 1.
launch is the top-level entry point. It picks the tier from
shape and axis, then instantiates the matching kernel template.
No GPU primitives leak into the body: it sees ctx, lambdas, and
the helpers above.
Structsβ
- β
BlockReducer: Reduces a scalar acrossBLOCK_SIZEthreads in a block. Broadcasts the result to every thread. - β
WarpReducer: Reduces a scalar across all lanes in a warp. Broadcasts the result to every lane.
Functionsβ
- β
launch: Top-level scaffolder. Picks the tier from shape + axis, instantiates the matching kernel, and launches. - β
once: Runsemitexactly once per (logical) output row. - β
pjoin: Cross-thread join for a single monoid state, tier-appropriately. - β
reduce: Drives the tier-aware iteration over the reduce axis, with no monoid state β pure per-tile iteration for map/emit terminals (see the state-carrying overload below for reduce phases).