triton.language.atomic_max(pointer, val, mask=None, sem=None, scope=None)

Performs an atomic max at the memory location specified by pointer.

Return the data stored at pointer before the atomic operation.

  • pointer (Block of dtype=triton.PointerDType) – The memory locations to operate on

  • val (Block of dtype=pointer.dtype.element_ty) – The values with which to perform the atomic operation

  • sem (str, optional) – Specifies the memory semantics for the operation. Acceptable values are “acquire”, “release”, “acq_rel” (stands for “ACQUIRE_RELEASE”), and “relaxed”. If not provided, the function defaults to using “acq_rel” semantics.

  • scope (str, optional) – Defines the scope of threads that observe the synchronizing effect of the atomic operation. Acceptable values are “gpu” (default), “cta” (cooperative thread array, thread block), or “sys” (stands for “SYSTEM”). The default value is “gpu”.

This function can also be called as a member function on tensor, as x.atomic_max(...) instead of atomic_max(x, ...).