Mojo function
partial_simd_store
partial_simd_store[type: DType, //, width: Int](storage: UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, mut=mut, origin=origin], lbound: Int, rbound: Int, data: SIMD[type, width])
Stores a vector with dynamic bound.
Out of bound data will ignored. Data is valid if lbound <= idx < rbound for idx from 0 to (simd_width-1).
e.g. addr 0 1 2 3 data 0 0 0 0
partial_simd_load[4](addr0, 1, 3, [-1, 42, 43, -1]) #gives [0 42 43 0]
partial_simd_load[4](addr0, 1, 3, [-1, 42, 43, -1]) #gives [0 42 43 0]
Parameters:
- type (
DType
): The DType of storage. - width (
Int
): The system simd vector size.
Args:
- storage (
UnsafePointer[SIMD[type, 1], address_space=address_space, alignment=alignment, mut=mut, origin=origin]
): Pointer to the address to perform load. - lbound (
Int
): Lower bound of valid index within simd (inclusive). - rbound (
Int
): Upper bound of valid index within simd (non-inclusive). - data (
SIMD[type, width]
): The vector value to store.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!