pub struct StridedTile<ES: Numeric, N: Size, IO: SliceVisibility = ReadOnly> {
pub container: Slice<Vector<ES, N>, IO>,
pub start: u32,
pub end: u32,
pub stride: u32,
pub swizzle: Swizzle,
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§
§container: Slice<Vector<ES, N>, IO>Slice containing all data for the stage
start: u32Offset of the tile in the stage
end: u32End of the tile in the stage, may be wrong with swizzle
stride: u32Stride between each row/col, depending on MatrixLayout (the other is assumed to be 1)
swizzle: SwizzleSwizzle object to transform the index
layout: MatrixLayoutLayout of the tile (row-major or column-major).
Implementations§
Source§impl<ES: Numeric, N: Size> StridedTile<ES, N>
impl<ES: Numeric, N: Size> StridedTile<ES, N>
Sourcepub fn new_contiguous(
container: Slice<Vector<ES, N>>,
start: u32,
config: StageMemoryConfig,
) -> StridedTile<ES, N>
pub fn new_contiguous( container: Slice<Vector<ES, N>>, start: u32, config: StageMemoryConfig, ) -> StridedTile<ES, N>
Creates a tile from a contiguous slice of data.
The slice length must exactly match the tile size.
Sourcepub fn new_contiguous_mut(
container: Slice<Vector<ES, N>, ReadWrite>,
start: u32,
config: StageMemoryConfig,
) -> StridedTile<ES, N, ReadWrite>
pub fn new_contiguous_mut( container: Slice<Vector<ES, N>, ReadWrite>, start: u32, config: StageMemoryConfig, ) -> StridedTile<ES, N, ReadWrite>
Creates a tile from a contiguous slice of data.
The slice length must exactly match the tile size.
Sourcepub fn new_strided(
container: Slice<Vector<ES, N>>,
start: u32,
end: u32,
stride: u32,
swizzle: Swizzle,
layout: MatrixLayout,
) -> StridedTile<ES, N>
pub fn new_strided( container: Slice<Vector<ES, N>>, start: u32, end: u32, stride: u32, swizzle: Swizzle, layout: MatrixLayout, ) -> StridedTile<ES, N>
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(
container: Slice<Vector<ES, N>, ReadWrite>,
start: u32,
end: u32,
stride: u32,
swizzle: Swizzle,
layout: MatrixLayout,
) -> StridedTile<ES, N, ReadWrite>
pub fn new_strided_mut( container: Slice<Vector<ES, N>, ReadWrite>, start: u32, end: u32, stride: u32, swizzle: Swizzle, layout: MatrixLayout, ) -> StridedTile<ES, N, 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, container: <Slice<Vector<ES, N>> as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <StridedTile<ES, N> as CubeType>::ExpandType
pub fn __expand_new_contiguous_mut( scope: &mut Scope, container: <Slice<Vector<ES, N>, ReadWrite> as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <StridedTile<ES, N, ReadWrite> as CubeType>::ExpandType
pub fn __expand_new_strided( scope: &mut Scope, container: <Slice<Vector<ES, N>> as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, end: <u32 as CubeType>::ExpandType, stride: <u32 as CubeType>::ExpandType, swizzle: <Swizzle as CubeType>::ExpandType, layout: MatrixLayout, ) -> <StridedTile<ES, N> as CubeType>::ExpandType
pub fn __expand_new_strided_mut( scope: &mut Scope, container: <Slice<Vector<ES, N>, ReadWrite> as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, end: <u32 as CubeType>::ExpandType, stride: <u32 as CubeType>::ExpandType, swizzle: <Swizzle as CubeType>::ExpandType, layout: MatrixLayout, ) -> <StridedTile<ES, N, ReadWrite> as CubeType>::ExpandType
Source§impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
pub fn unvectorized_stride(&self) -> u32
pub fn __expand_unvectorized_stride( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
Source§impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
Sourcepub fn as_slice(&self) -> Slice<Vector<ES, N>, ReadOnly>
pub fn as_slice(&self) -> Slice<Vector<ES, N>, ReadOnly>
Returns the tile as an offset read-only slice. Should only be used when swizzling is definitely not applicable.
Sourcepub fn to_read_only(&self) -> StridedTile<ES, N, ReadOnly>
pub fn to_read_only(&self) -> StridedTile<ES, N, ReadOnly>
Returns a read-only view of this tile, dropping write permission on the container.
pub fn __expand_as_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Slice<Vector<ES, N>, ReadOnly> as CubeType>::ExpandType
pub fn __expand_to_read_only( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <StridedTile<ES, N, ReadOnly> as CubeType>::ExpandType
Source§impl<ES: Numeric, N: Size> StridedTile<ES, N, ReadWrite>
impl<ES: Numeric, N: Size> StridedTile<ES, N, ReadWrite>
Sourcepub fn as_slice_mut(&self) -> Slice<Vector<ES, N>, ReadWrite>
pub fn as_slice_mut(&self) -> Slice<Vector<ES, N>, ReadWrite>
Returns the tile as an offset slice. Should only be used when swizzling is definitely not applicable.
pub fn __expand_as_slice_mut( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <Slice<Vector<ES, N>, ReadWrite> as CubeType>::ExpandType
Source§impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
impl<ES: Numeric, N: Size, IO: SliceVisibility> StridedTile<ES, N, IO>
Sourcepub fn get_vector(
&self,
coor_strided: u32,
coor_contiguous: u32,
) -> Vector<ES, N>
pub fn get_vector( &self, coor_strided: u32, coor_contiguous: u32, ) -> Vector<ES, N>
Returns a specific vector from the tile based on coordinates.
pub fn stage_offset(&self, relative_offset: u32) -> u32
pub fn with_vector_size<N2: Size>(&self) -> StridedTile<ES, N2, IO>
pub fn __expand_get_vector( scope: &mut Scope, this: <Self as CubeType>::ExpandType, coor_strided: <u32 as CubeType>::ExpandType, coor_contiguous: <u32 as CubeType>::ExpandType, ) -> <Vector<ES, N> as CubeType>::ExpandType
pub fn __expand_stage_offset( scope: &mut Scope, this: <Self as CubeType>::ExpandType, relative_offset: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
pub fn __expand_with_vector_size<N2: Size>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <StridedTile<ES, N2, IO> as CubeType>::ExpandType
Trait Implementations§
Source§impl<ES: Clone + Numeric, N: Clone + Size, IO: Clone + SliceVisibility> Clone for StridedTile<ES, N, IO>
impl<ES: Clone + Numeric, N: Clone + Size, IO: Clone + SliceVisibility> Clone for StridedTile<ES, N, IO>
Source§fn clone(&self) -> StridedTile<ES, N, IO>
fn clone(&self) -> StridedTile<ES, N, IO>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more