helion.language.atomic_max

helion.language.atomic_max(target, index, value, sem='relaxed')[source]

Atomically update target[index] with the maximum of current value and value.

Parameters:
  • target (Tensor) – Tensor to update.

  • index (list[object]) – Indices selecting elements to update. Can include tiles.

  • value (Tensor | float) – Value(s) to compare with.

  • sem (str) – Memory ordering semantics. One of "relaxed", "acquire", "release", "acq_rel". Defaults to "relaxed".

Returns:

The previous value(s) stored at target[index] before the update.

Return type:

torch.Tensor