Skip to content

pipeline.strand

← pipeline dialect

Construct strand instances over a target-relative worker domain. By default each selected worker enters an independent instance once. A cooperative strand instead enters one instance with all selected workers: channel actions collectively acquire, publish or release one record, while ordinary payload operations execute per participant. Channel actions require converged participation, including through calls. Ordinary loops in the body express repeated work. The region captures lexical SSA values and declares work rather than executing inline. Multiple strands may share a worker, with channel dependencies controlling their progress. Origins, counts and strides select coordinates as origin + index * stride. An omitted target inherits the enclosing pipeline's target environment.

Operation contract

Property Value
Semantic phase —
Traits UnknownEffects, HasAncestor(pipeline.def), ImplicitTerminator(pipeline.end)

Signature

Kind Name Type Cardinality Description
Operand origins index variadic Dynamic worker origins.
Operand counts index variadic Dynamic worker counts.
Operand strides index variadic Dynamic worker strides.
Attribute target symbol (target) optional —
Attribute static_origins i64_array required Worker origins; INT64_MIN entries refer to dynamic origins.
Attribute static_counts i64_array required Worker counts; INT64_MIN entries refer to dynamic counts.
Attribute static_strides i64_array required Worker strides; INT64_MIN entries refer to dynamic strides.
Attribute participation enum StrandParticipation optional —
Region body region required One complete strand instance, with lexical captures. (terminator pipeline.end.)

Examples

pipeline.strand target(@npu) workers([%column, 2], [1, 1], [1, 1]) {
}
pipeline.strand<cooperative> workers([0], [4], [1]) {
}