Skip to content

kernel.workgroup.scan

kernel dialect

Prefix-scan a scalar or rank-1 vector value across the current workgroup.

Operation contract

Property Value
Semantic phase executable
Traits Convergent, HasAncestor(kernel.def)
Target contracts kernel.synchronization

Signature

Kind Name Type Cardinality Description
Operand value any required Per-invocation value to scan.
Result result any required Scanned value.
Attribute kind enum CombiningKind required Combining operation.
Attribute mode enum KernelWorkgroupScanMode required Inclusive or exclusive scan.
Attribute direction enum KernelWorkgroupScanDirection required Workitem order to scan.

Verification constraints

  • SameType(value, result)

Examples

%prefix = kernel.workgroup.scan<addf> %v {mode = inclusive, direction = forward} : f32