triton.language.atomic_xchg

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.

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

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