IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
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).

smem_edge_masked_load

def smem_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 threadgroup (shared) memory (Apple M5 only).

Like edge_masked_load but reinterprets any pointer as shared — for a generic-typed pointer to threadgroup memory. Emits AGX3 load.with.emask.local.

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:

Returns:

SIMD[dtype, width]: A SIMD[dtype, width]; in-range lanes loaded, masked-off lanes zero.