Atomic Add Atomics
Atomically add a value to a memory location and (optionally) return the prior value.
Vendor-Neutral Definition
old = *addr; *addr = old + val; the read-modify-write is indivisible with respect to other threads/lanes targeting the same address.
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler
translations.
equivalent with restrictions
Both atomically add a value to a memory location.
| Property | NVIDIA PTX | AMDGPU |
|---|---|---|
| Instruction | atom | global_atomic_add, ds_add_u32 |
| ISA Layer | Virtual | Native |
| Data Types | b32, b64, f32, f64, s32, u32, u64 | u32 |
| Version / Target Introduced | PTX ISA 1.0 | gfx942/gfx1100, gfx942/gfx1100 |
Important Differences
- PTX's atom.add covers global and shared space via a state-space qualifier on one mnemonic; AMDGPU uses separate mnemonics per memory segment (global_atomic_add vs ds_add_u32).
Source Evidence
- Parallel Thread Execution ISA ↗ — NVIDIA Corporation
- User Guide for AMDGPU Backend ↗ — LLVM Project
Verification method: documentation