IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

vote

vote[ret_type: DType](val: Bool) -> Scalar[ret_type]

Creates a 32 or 64 bit mask among all threads in the warp, where each bit is set to 1 if the corresponding thread voted True, and 0 otherwise.

This function takes a boolean value which represents the corresponding threads vote.

Nvidia only supports 32 bit masks, while AMD supports 32 and 64 bit masks.

Parameters:

  • ret_type (DType): Return type for the mask (must be DType.uint32 or DType.uint64).

Args:

  • val (Bool): The boolean vote.

Returns:

Scalar[ret_type]: A mask containing the vote of all threads in the warp.