Skip to content

pipeline.strand

← pipeline dialect

Construct independently progressing strand instances over a target-relative worker domain. Each selected worker enters its instance once; 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.
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]) {
}