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).