Skip to main content

Mojo function

elect_one_sync_with_mask

elect_one_sync_with_mask(mask: SIMD[uint32, 1] = __init__[__mlir_type.!pop.int_literal](4294967295)) -> Bool

Elects a single thread within a warp to perform an operation.

Note:

  • Only supported on NVIDIA SM90+ GPUs.
  • Maps directly to the elect.sync instruction in CUDA PTX.
  • Useful for having a single thread perform an operation while maintaining warp synchronization.

Args:

  • mask (SIMD[uint32, 1]): The mask to use for the election. Defaults to 0xFFFFFFFF.

Returns:

True for the elected thread, False for all other threads in the warp.

Was this page helpful?