pub struct Tile<ES: Numeric> {
pub slice: Slice<Line<ES>>,
pub stride: u32,
pub layout: MatrixLayout,
}
Expand description
Data to be handed to the Tile Matmul
Fields§
§slice: Slice<Line<ES>>
Slice containing all data
stride: u32
Stride between each row/col, depending on MatrixLayout (the other is assumed to be 1)
layout: MatrixLayout
Layout of the tile (row-major or column-major).
Implementations§
Source§impl<ES: Numeric> Tile<ES>
impl<ES: Numeric> Tile<ES>
Sourcepub fn new_contiguous<T: TileConfig>(
slice: Slice<Line<ES>>,
ident: Ident,
config: T,
) -> Tile<ES>
pub fn new_contiguous<T: TileConfig>( slice: Slice<Line<ES>>, ident: Ident, config: T, ) -> Tile<ES>
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,
) -> Tile<ES>
pub fn new_strided( slice: Slice<Line<ES>>, stride: u32, layout: MatrixLayout, ) -> Tile<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 as_unlined<T: TileConfig>(
&self,
ident: Ident,
config: T,
) -> (Slice<ES>, u32)
pub fn as_unlined<T: TileConfig>( &self, ident: Ident, config: T, ) -> (Slice<ES>, 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_new_contiguous<T: TileConfig>( scope: &mut Scope, slice: <Slice<Line<ES>> as CubeType>::ExpandType, ident: Ident, config: T, ) -> <Tile<ES> 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, ) -> <Tile<ES> as CubeType>::ExpandType
pub fn __expand_as_unlined<T: TileConfig>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ident: Ident, config: T, ) -> <(Slice<ES>, 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: Numeric> CubeType for Tile<ES>
impl<ES: Numeric> CubeType for Tile<ES>
type ExpandType = TileExpand<ES>
Source§fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
fn into_mut(scope: &mut Scope, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necessary to type inference.
Auto Trait Implementations§
impl<ES> Freeze for Tile<ES>
impl<ES> RefUnwindSafe for Tile<ES>where
ES: RefUnwindSafe,
impl<ES> Send for Tile<ES>
impl<ES> Sync for Tile<ES>
impl<ES> Unpin for Tile<ES>where
ES: Unpin,
impl<ES> UnwindSafe for Tile<ES>where
ES: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more