Skip to main content
Log in

Mojo function

masked_load

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

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

Parameters:

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

Args:

  • addr (UnsafePointer[SIMD[type, 1], address_space, exclusive, alignment]): 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].

Was this page helpful?