view.atomic.load
← view dialect
Atomically read one scalar view element at a full-rank logical index. Each execution is a distinct observation. Ordering is relaxed, acquire, or sequentially consistent. Target lowering must preserve the element width and atomicity at the requested scope without a read-modify-write.
Operation contract
| Property |
Value |
| Semantic phase |
executable |
| Traits |
ObservableEffect |
| Target contracts |
memory.atomic |
| Interfaces |
CachePolicy, MemoryAccess |
| Memory effects |
read view |
Signature
| Kind |
Name |
Type |
Cardinality |
Description |
| Operand |
view |
view |
required |
Typed source view. |
| Operand |
indices |
index |
variadic |
Dynamic logical element indices. |
| Result |
result |
byte_pattern_scalar |
required |
Fixed-width byte-addressable scalar observed by the atomic load. |
| Attribute |
ordering |
enum AtomicLoadOrdering |
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 element indices with INT64_MIN sentinels for dynamics. |
Verification constraints
SameElementType(view, result)
Examples
%generation = view.atomic.load %progress[0] {ordering = acquire, scope = system} : view<1xi32> -> i32