Expand description
Atomic operation reference implementations. Atomic operation semantics enforced by the parity engine.
GPU atomic instructions vary in memory ordering and return-value behavior across backends. This module exists to define one sequentially consistent, return-old-value semantics that every backend must match byte-for-byte.
Functions§
- apply
- Apply one sequentially consistent atomic operation.
- atomic_
add - Return the old value and the value after atomic add.
- atomic_
and - Return the old value and the value after atomic bitwise AND.
- atomic_
compare_ exchange - Return the old value and the value after atomic compare-exchange.
- atomic_
exchange - Return the old value and the replacement value for atomic exchange.
- atomic_
lru_ update - LRU-update semantics: replace the slot with
valueonly whenvalueis strictly greater thanold(the “more recent timestamp” wins). Identical tie-breaker behavior toatomic_max, kept as a distinct op so backends can lower it to a dedicated LRU-tracking instruction on hardware that has one. CPU reference is the correctness oracle. - atomic_
max - Return the old value and the value after atomic unsigned maximum.
- atomic_
min - Return the old value and the value after atomic unsigned minimum.
- atomic_
or - Return the old value and the value after atomic bitwise OR.
- atomic_
xor - Return the old value and the value after atomic bitwise XOR.