IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 function

pjoin

def pjoin[State: ReduceOp, params: ContextParams, //](mut state: State, mut ctx: Context[params])

Cross-thread join for a single monoid state.

GPU: cooperative warp/block reduce (warp / block tiers) or cross-block atomic finish (split-K); no-op for the tiled and serial tiers. CPU: drives the monoid's own pjoin body via a single-participant SerialReducer β€” no cross-thread combine, but monoids may run per-state finalization here (e.g. ReduceSum horizontally reducing its SIMD accumulator into the scalar acc field bodies read).

Parameters:

  • ​State (ReduceOp): The monoid type being joined.
  • ​params (ContextParams): Comptime dispatch parameters.

Args:

  • ​state (State): The body's monoid accumulator.
  • ​ctx (Context[params]): The dispatch bundle.