Mojo struct
PipelineBody
struct PipelineBody
Builder for declarative pipeline body specifications.
Use as a context manager: with PipelineBody() as b:. Accumulates
logical OpDesc entries via role-typed methods and combinators.
Call b.done() to finalize the builder and return the op list
for annotate_ops() and subsequent scheduling.
Implemented traitsβ
AnyType,
ImplicitlyDestructible,
Movable
Methodsβ
__init__β
__init__(out self)
__enter__β
__enter__(var self) -> Self
Enable with PipelineBody() as b: syntax for scoped building.
loadβ
load(mut self, tag: Int, *, ch: Int = -1, stage: Int = 0, sub: Int = 0, k: KOffsetKind = KOffsetKind.NONE)
Append a global load (DRAM β LDS or DRAM β registers).
storeβ
store(mut self, tag: Int, *, ch: Int = -1, stage: Int = 0, sub: Int = 0)
Append a shared memory store (registers β LDS).
fragβ
frag(mut self, tag: Int, *, ch: Int = -1, stage: Int = 0, sub: Int = 0)
Append a fragment load (LDS β registers).
computeβ
compute(mut self, tag: Int, *, stage: Int = 0, sub: Int = 0)
Append a compute/MMA op.
barrierβ
barrier(mut self)
Append a barrier.
opβ
op(mut self, tag: Int, *, ch: Int = -1, stage: Int = 0, sub: Int = 0, k: KOffsetKind = KOffsetKind.NONE)
Append a generic logical op (escape hatch for non-standard ops).
fanβ
fan[N: Int](mut self, tag: Int, *, ch: Int = -1, stage: Int = 0, k: KOffsetKind = KOffsetKind.NONE)
Append N ops with subtile=0..N-1 (fan-out pattern).
gridβ
grid[M: Int, N: Int](mut self, tag: Int, *, ch: Int = -1)
Append MΓN ops with stage=i, subtile=j (2D grid pattern).
First dimension maps to stage (0..M-1), second to subtile (0..N-1). For flat patterns where only subtile varies, use fan[M*N] instead.
extendβ
extend(mut self, mut other: Self)
Absorb all ops from another builder (for hierarchical composition).
doneβ
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!