Mojo function
masked_load
masked_load[type: DType, //, size: Int](addr: UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, origin=origin], mask: SIMD[bool, size], passthrough: SIMD[type, size], alignment: Int = 1) -> SIMD[type, size]
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=address_space, alignment=alignment, origin=origin]
): 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?
Thank you! We'll create more content like this.
Thank you for helping us improve!