helion.language.signal

helion.language.signal(signal_pad, index=None, signal=1, wait_for=None, scope='gpu', hasPreviousMemAccess=True)[source]

Set global memory barriers.

Sets global memory barriers to the specified value. If wait_for is not None, it waits for the barriers to be cleared before setting.

Parameters:
  • signal_pad (Tensor | StackTensor) – Tensor of global memory barriers to set

  • index (list[object] | None) – Indices to index into the signal_pad tensor

  • signal (int) – the value to send

  • wait_for (int | None) – The value to wait for before sending the signal.

  • scope (str) – The scope of the lock (default: ‘gpu’)

  • hasPreviousMemAccess (bool) – Whether the signal is preceded by a memory access (default: True)

Return type:

Tensor

Returns:

The old value of the global memory barriers before the update.