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).
gmem_edge_masked_load
def gmem_edge_masked_load[dtype: DType, src_space: AddressSpace, //, width: Int](ptr: UnsafePointer[Scalar[dtype], address_space=src_space], mask: Int16) -> SIMD[dtype, width]
Loads an edge-masked vector, treating ptr as device (global) memory (Apple M5 only).
Like edge_masked_load but reinterprets any pointer as global — for a
generic-typed pointer to device memory. Emits AGX3
load.with.emask.global.
Constraints:
width in {1, 2, 4}, dtype 8/16/32/64-bit. Apple M5 only.
Parameters:
- dtype (
DType): Element type of the pointer (inferred). - src_space (
AddressSpace): Pointer source address space (inferred). - width (
Int): Number of elements to load.
Args:
- ptr (
UnsafePointer[Scalar[dtype], address_space=src_space]): Base pointer of the load, pointing to global memory. - mask (
Int16): Per-lane active mask, e.g. frombuild_edge_mask.
Returns:
SIMD[dtype, width]: A SIMD[dtype, width]; in-range lanes loaded, masked-off lanes zero.