Skip to content

vector.atomic.reduce

vector dialect

Atomic no-result scatter reduction/update into per-lane signed element offsets. Each lane atomically combines its value into origin + offsets[lane]; duplicate active addresses are valid and are serialized by the required ordering and scope attributes.

Operation contract

Property Value
Semantic phase
Interfaces MemoryAccess
Memory effects readwrite view

Signature

Kind Name Type Cardinality Description
Operand value vector required Vector contribution for each lane.
Operand view view required Typed destination view.
Operand offsets vector required Per-lane signed element offsets from the logical origin.
Operand indices index variadic Dynamic logical origin indices.
Attribute kind enum AtomicKind required
Attribute ordering enum AtomicOrdering required Required atomic memory ordering.
Attribute scope enum AtomicScope required Required atomic synchronization scope.
Attribute cache_scope enum CacheScope optional Optional cache/coherency scope required by target lowering.
Attribute cache_temporal enum CacheTemporal optional Optional temporal cache policy required by target lowering.
Attribute static_indices i64_array required Static logical origin indices with INT64_MIN sentinels for dynamics.

Verification constraints

  • HasIndexOrNonI1IntegerElement(offsets)
  • SameElementType(value, view)
  • SameShape(offsets, value)

Examples

vector.atomic.reduce<addi> %v, %view[%row, %col][%offsets] {ordering = relaxed, scope = workgroup} : vector<4xi32>, view<[%m]x[%n]xi32, %layout>, vector<4xindex>