pub struct StoreOperation<'c> { /* private fields */ }
Expand description
A store
operation. Writes an n-D vector to an n-D slice of memory.
The ‘vector.store’ operation writes an n-D vector to an n-D slice of memory. It takes the vector value to be stored, a ‘base’ memref and an index for each memref dimension. The ‘base’ memref and indices determine the start memory address from which to write. Each index provides an offset for each memref dimension based on the element type of the memref. The shape of the vector value to store determines the shape of the slice written from the start memory address. The elements along each dimension of the slice are strided by the memref strides. Only unit strides are allowed along the most minor memref dimension. These constraints guarantee that elements written along the first dimension of the slice are contiguous in memory.
The memref element type can be a scalar or a vector type. If the memref element type is a scalar, it should match the element type of the value to store. If the memref element type is vector, it should match the type of the value to store.
Example 1: 1-D vector store on a scalar memref.
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<8xf32>
Example 2: 1-D vector store on a vector memref.
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<8xf32>>, vector<8xf32>
Example 3: 2-D vector store on a scalar memref.
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xf32>, vector<4x8xf32>
Example 4: 2-D vector store on a vector memref.
vector.store %valueToStore, %memref[%i, %j] : memref<200x100xvector<4x8xf32>>, vector<4x8xf32>
Representation-wise, the ‘vector.store’ operation permits out-of-bounds writes. Support and implementation of out-of-bounds vector stores are target-specific. No assumptions should be made on the memory written out of bounds. Not all targets may support out-of-bounds vector stores.
Example 5: Potential out-of-bounds vector store.
vector.store %valueToStore, %memref[%index] : memref<?xf32>, vector<8xf32>
Example 6: Explicit out-of-bounds vector store.
vector.store %valueToStore, %memref[%c0] : memref<7xf32>, vector<8xf32>
Implementations§
source§impl<'c> StoreOperation<'c>
impl<'c> StoreOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> StoreOperationBuilder<'c, Unset, Unset, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> StoreOperationBuilder<'c, Unset, Unset, Unset>
Creates a builder.