pub struct StridedTile<ES: Numeric, IO: SliceVisibility = ReadOnly> {
pub slice: Slice<Line<ES>, IO>,
pub stride: u32,
pub layout: MatrixLayout,
}Expand description
Tile with a linear major dimension, and a strided minor dimension. Basic tile kind supported by all stage matmuls.
Fields§
§slice: Slice<Line<ES>, IO>Slice containing all data
stride: u32Stride between each row/col, depending on MatrixLayout (the other is assumed to be 1)
layout: MatrixLayoutLayout of the tile (row-major or column-major).
Implementations§
Source§impl<ES: Numeric> StridedTile<ES>
impl<ES: Numeric> StridedTile<ES>
Sourcepub fn new_contiguous(
slice: Slice<Line<ES>>,
config: StageMemoryConfig,
) -> StridedTile<ES>
pub fn new_contiguous( slice: Slice<Line<ES>>, config: StageMemoryConfig, ) -> StridedTile<ES>
Creates a tile from a contiguous slice of data.
The slice length must exactly match the tile size.
Sourcepub fn new_contiguous_mut(
slice: Slice<Line<ES>, ReadWrite>,
config: StageMemoryConfig,
) -> StridedTile<ES, ReadWrite>
pub fn new_contiguous_mut( slice: Slice<Line<ES>, ReadWrite>, config: StageMemoryConfig, ) -> StridedTile<ES, ReadWrite>
Creates a tile from a contiguous slice of data.
The slice length must exactly match the tile size.
Sourcepub fn new_strided(
slice: Slice<Line<ES>>,
stride: u32,
layout: MatrixLayout,
) -> StridedTile<ES>
pub fn new_strided( slice: Slice<Line<ES>>, stride: u32, layout: MatrixLayout, ) -> StridedTile<ES>
Creates a tile from a strided slice of data.
The slice must include all elements of the tile, though it may include unused gaps.
Sourcepub fn new_strided_mut(
slice: Slice<Line<ES>, ReadWrite>,
stride: u32,
layout: MatrixLayout,
) -> StridedTile<ES, ReadWrite>
pub fn new_strided_mut( slice: Slice<Line<ES>, ReadWrite>, stride: u32, layout: MatrixLayout, ) -> StridedTile<ES, ReadWrite>
Creates a tile from a strided slice of data.
The slice must include all elements of the tile, though it may include unused gaps.
pub fn __expand_new_contiguous( scope: &mut Scope, slice: <Slice<Line<ES>> as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <StridedTile<ES> as CubeType>::ExpandType
pub fn __expand_new_contiguous_mut( scope: &mut Scope, slice: <Slice<Line<ES>, ReadWrite> as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <StridedTile<ES, ReadWrite> as CubeType>::ExpandType
pub fn __expand_new_strided( scope: &mut Scope, slice: <Slice<Line<ES>> as CubeType>::ExpandType, stride: <u32 as CubeType>::ExpandType, layout: MatrixLayout, ) -> <StridedTile<ES> as CubeType>::ExpandType
pub fn __expand_new_strided_mut( scope: &mut Scope, slice: <Slice<Line<ES>, ReadWrite> as CubeType>::ExpandType, stride: <u32 as CubeType>::ExpandType, layout: MatrixLayout, ) -> <StridedTile<ES, ReadWrite> as CubeType>::ExpandType
Source§impl<ES: Numeric, IO: SliceVisibility> StridedTile<ES, IO>
impl<ES: Numeric, IO: SliceVisibility> StridedTile<ES, IO>
Sourcepub fn as_unlined(&self) -> (Slice<ES, IO>, u32)
pub fn as_unlined(&self) -> (Slice<ES, IO>, u32)
Returns the tile as an unlined (scalar) slice.
Returns:
- The unlined slice
- The updated stride to account for line width removal
Sourcepub fn get_line(&self, coor_strided: u32, coor_contiguous: u32) -> Line<ES>
pub fn get_line(&self, coor_strided: u32, coor_contiguous: u32) -> Line<ES>
Returns a specific line from the tile based on coordinates.
pub fn __expand_as_unlined( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <(Slice<ES, IO>, u32) as CubeType>::ExpandType
pub fn __expand_get_line( scope: &mut Scope, this: <Self as CubeType>::ExpandType, coor_strided: <u32 as CubeType>::ExpandType, coor_contiguous: <u32 as CubeType>::ExpandType, ) -> <Line<ES> as CubeType>::ExpandType
Trait Implementations§
Source§impl<ES: Clone + Numeric, IO: Clone + SliceVisibility> Clone for StridedTile<ES, IO>
impl<ES: Clone + Numeric, IO: Clone + SliceVisibility> Clone for StridedTile<ES, IO>
Source§fn clone(&self) -> StridedTile<ES, IO>
fn clone(&self) -> StridedTile<ES, IO>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more