helion.language.atomic_xor

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

Atomically apply bitwise XOR with value to target[index].

Parameters:
  • target (Tensor) – Tensor to update (integer/bool dtype).

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

  • value (Tensor | int | bool) – Value(s) to XOR 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