Skip to main content

Mojo function

splat

splat[size: Int, //, dtype: DType](value: SIMD[DType.bool, size]) -> SIMD[dtype, size]

Elementwise splat the boolean value of each element in the SIMD vector into all bits of the corresponding element in a new SIMD vector.

Parameters:

  • ​size (Int): The size of the SIMD vector.
  • ​dtype (DType): The DType of the output.

Args:

  • ​value (SIMD): The value to check.

Returns:

SIMD: A SIMD vector where each element is filled with 1 bits if the corresponding element in value is True, or filled with 0 bits otherwise.

splat(value: Bool) -> Int

Get a bitmask of whether the value is True.

Args:

  • ​value (Bool): The value to check.

Returns:

Int: A bitmask filled with 1 if the value is True, filled with 0 otherwise.

Was this page helpful?