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 struct
ExplicitConsumeContext
struct ExplicitConsumeContext[pipeline_origin: MutOrigin, num_stages: Int, Backend: PipelineBackend = NvidiaMbarBackend[num_stages]]
Context manager for consuming with EXPLICIT barrier arrive.
Use this when you need lane-guarded or specialized barrier signaling.
- enter: Waits for producer to be ready, returns ref to stage with mbar
- exit: Only advances stage counter, does NOT arrive on barrier
The caller is responsible for calling arrive via stage.arrive() or stage.mbar(): with pipeline.consume_explicit() as stage: # ... do work ... if lane_id() < CLUSTER_SIZE: stage.arrive() # exit only calls consumer_step(), not arrive()
Parameters
- pipeline_origin (
MutOrigin): Origin of the pipeline reference. - num_stages (
Int): Number of pipeline stages. - Backend (
PipelineBackend): Pipeline synchronization backend (defaults toNvidiaMbarBackend).
Fields
- pipeline (
Pointer[ProducerConsumerPipeline[num_stages, Backend], pipeline_origin]):
Implemented traits
Methods
__init__
def __init__(out self, pipeline: Pointer[ProducerConsumerPipeline[num_stages, Backend], pipeline_origin])
__deinit__
def __deinit__(deinit self)
__enter__
def __enter__(mut self) -> ref[self._stage._value] ConsumerStage[pipeline_origin, num_stages, Backend]
Wait for producer and return reference to stage with barrier access.
Returns:
ref[self._stage._value] ConsumerStage[pipeline_origin, num_stages, Backend]
__exit__
def __exit__(mut self)
Advance to next stage WITHOUT signaling barrier.