Skip to main content

function

masked_load

masked_load[size: Int](addr: DTypePointer[type, address_space], mask: SIMD[bool, size], passthrough: SIMD[type, size], alignment: Int = 1) -> SIMD[$1, $0]

Loads data from memory and return it, replacing masked lanes with values from the passthrough vector.

Parameters:

  • size (Int): Size of the return SIMD buffer.

Args:

  • addr (DTypePointer[type, address_space]): The base pointer for the load.
  • mask (SIMD[bool, size]): A binary vector which prevents memory access to certain lanes of the memory stored at addr.
  • passthrough (SIMD[type, size]): In the result vector, the masked-off lanes are replaced with the passthrough vector.
  • alignment (Int): The alignment of the source addresses. Must be 0 or a power of two constant integer value. Default is 1.

Returns:

The loaded memory stored in a vector of type SIMD[type, size].