Skip to main content

## inverse_ballot

# Function inverse_ballot

Source

    pub fn inverse_ballot(value: u64) -> bool

🔬This is a nightly-only experimental API. (`stdarch_amdgpu` #149988)
Available on `target_arch=amdgpu` only.
Expand description

Indexes into the `value` with the current lane id and returns for each lane if the corresponding bit is set.

While `ballot` converts a `bool` to a mask, `inverse_ballot` converts a mask back to a `bool`. This means `inverse_ballot(ballot(b)) == b`. The inverse of `ballot(inverse_ballot(value)) ~= value` is not always true as inactive lanes are set to zero by `ballot`.