triton.language.atomic_xchg¶
- triton.language.atomic_xchg(pointer, val, mask=None, builder=None)¶
Swaps the old values stored at location
pointer
with the new values given byval
. Returns the old values.- Parameters
pointer (Block of dtype=triton.PointerDType) – The memory locations which contain the old values
val (Block of dtype=`pointer.dtype.element_ty`) – The new values to store
mask (Block of triton.int1, optional) – If mask[idx] is false,
pointer[idx]
is unaffected.builder (triton.ir.builder, optional from within JIT'ed functions) – IR builder to generate code into