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
once
def once[Emit: def() -> None & RegisterPassable & ImplicitlyCopyable, params: ContextParams, //](emit: Emit, ctx: Context[params])
Runs emit exactly once per logical output row.
GPU: picks the canonical writer (lane 0 / thread 0 / last-block thread 0, depending on tier). CPU: every worker emits its own outputs (one worker per row).
emit is a value closure (its copy-captured state rides the value);
once is an in-kernel thread predicate β not a launch boundary β so it
is invoked directly under the canonical-writer guard.
Parameters:
- βEmit (
def() -> None&RegisterPassable&ImplicitlyCopyable): The value-closure type ofemit. - βparams (
ContextParams): Comptime dispatch parameters.
Args:
- βemit (
Emit): Callback to run on the canonical writer. - βctx (
Context[params]): The dispatch bundle.