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 function
aligned_load
def aligned_load[V: Loadable, //, width: Int](view: V, idx: Coord[*idx.element_types], inner: Int, inner_dim: Int) -> SIMD[V.dtype, width]
Loads width elements of view at idx, as one aligned vector when it can on GPU.
The read is aligned when inner, the innermost coordinate of idx, and
inner_dim, the length of the innermost dimension, are both multiples of
width: the row-major flat index is then a multiple of width. The view's
own alignment still caps that, so a misaligned view reads correctly.
Parameters:
Args:
- view (
V): The operand's device view. - idx (
Coord[*idx.element_types]): The coordinate of the first element. - inner (
Int): The innermost coordinate ofidx. - inner_dim (
Int): The length of the view's innermost dimension.
Returns:
SIMD[V.dtype, width]: The loaded elements.