IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/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. /max/get-started.md).

Mojo function

partial_simd_load

def partial_simd_load[dtype: DType, //, width: Int](storage: UnsafePointer[Scalar[dtype], address_space=storage.address_space], lbound: Int, rbound: Int, pad_value: Scalar[dtype]) -> SIMD[dtype, width]

Loads a vector with dynamic bound.

Out of bound data will be filled with pad value. Data is valid if lbound <= idx < rbound for idx from 0 to (simd_width-1). For example:

addr 0  1  2  3
data x 42 43  x

partial_simd_load[4](addr0, 1, 3) #gives [0 42 43 0]

Parameters:

  • ​dtype (DType): The DType of storage.
  • ​width (Int): The system simd vector size.

Args:

Returns:

SIMD[dtype, width]: The SIMD vector loaded and zero-filled.