IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo module

masked_load_apple

Apple M5 (AGX3) hardware edge-masked vector loads.

build_edge_mask computes a per-lane in-bounds mask; the *edge_masked_load family does a predicated vector load that zeroes masked-off lanes, letting a kernel vectorize a boundary tile without a scalar remainder loop or an out-of-bounds read. The three entry points differ only in address-space resolution:

  • edge_masked_load β€” the pointer's own space (must be GLOBAL or SHARED).
  • gmem_edge_masked_load β€” reinterprets any pointer as device (global).
  • smem_edge_masked_load β€” reinterprets any pointer as threadgroup (shared).

Apple M5 only: the AGX3 intrinsics don't exist elsewhere, so callers dispatch on compute_capability() == 5.

Functions​