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
ProducerStage
struct ProducerStage[pipeline_origin: MutOrigin, num_stages: Int, Backend: PipelineBackend = NvidiaMbarBackend[num_stages]]
Unified handle for producing to a pipeline stage.
Works as both a linear type (direct use) and within context managers.
Lifecycle:
- Created via
pipeline.acquire_producer()or context manager - Use
index()andmbar()for production - Must call
release()to advance stage (compiler-enforced)
Parametersβ
- βpipeline_origin (
MutOrigin): Origin of the pipeline reference. - βnum_stages (
Int): Number of pipeline stages. - βBackend (
PipelineBackend): The synchronization backend (seeProducerConsumerPipeline).
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], index: UInt32)
indexβ
mbarβ
def mbar(self) -> Backend.Handle
Get the barrier to signal when production is complete.
Caller is responsible for signaling via mma_arrive or similar.
Returns:
Backend.Handle
releaseβ
def release(deinit self)
Advance producer to next stage.
This is the only way to destroy this linear type. The compiler will error if you don't call this.