triton.language.atomic_xchg(pointer, val, builder=None)

Swaps the old values stored at location pointer with the new values given by val. Returns the old values.

  • 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

  • builder (, optional from within JIT'ed functions) – IR builder to generate code into