pub struct StridedTile<ES: Numeric, N: Size> {
pub container: Box<[Vector<ES, N>]>,
pub start: u32,
pub end: u32,
pub stride: u32,
pub swizzle: Swizzle,
pub layout: MatrixLayout,
}Expand description
Typed form of the smem stage slot. start/end/stride are in vector
units.
Fields§
§container: Box<[Vector<ES, N>]>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: &[Vector<ES, N>],
start: u32,
config: StageMemoryConfig,
) -> StridedTile<ES, N>
pub fn new_contiguous( container: &[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_strided(
container: &[Vector<ES, N>],
start: u32,
end: u32,
stride: u32,
swizzle: Swizzle,
layout: MatrixLayout,
) -> StridedTile<ES, N>
pub fn new_strided( container: &[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 __expand_new_contiguous(
scope: &Scope,
container: &<[Vector<ES, N>] as CubeType>::ExpandType,
start: <u32 as CubeType>::ExpandType,
config: StageMemoryConfig,
) -> <StridedTile<ES, N> as CubeType>::ExpandType
pub fn __expand_new_contiguous( scope: &Scope, container: &<[Vector<ES, N>] as CubeType>::ExpandType, start: <u32 as CubeType>::ExpandType, config: StageMemoryConfig, ) -> <StridedTile<ES, N> as CubeType>::ExpandType
Creates a tile from a contiguous slice of data.
The slice length must exactly match the tile size.
Sourcepub fn __expand_new_strided(
scope: &Scope,
container: &<[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( scope: &Scope, container: &<[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
Creates a tile from a strided slice of data.
The slice must include all elements of the tile, though it may include unused gaps.
Source§impl<ES: Numeric, N: Size> StridedTile<ES, N>
impl<ES: Numeric, N: Size> StridedTile<ES, N>
pub fn unvectorized_stride(&self) -> u32
pub fn __expand_unvectorized_stride( scope: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType
Source§impl<ES: Numeric, N: Size> StridedTile<ES, N>
impl<ES: Numeric, N: Size> StridedTile<ES, N>
Sourcepub fn as_slice(&self) -> &[Vector<ES, N>]
pub fn as_slice(&self) -> &[Vector<ES, N>]
Returns the tile as an offset read-only slice. Should only be used when swizzling is definitely not applicable.
Sourcepub fn as_slice_mut(&mut self) -> &mut [Vector<ES, N>]
pub fn as_slice_mut(&mut self) -> &mut [Vector<ES, N>]
Returns the tile as an offset slice. Should only be used when swizzling is definitely not applicable.
Sourcepub fn __expand_as_slice<'infer, 'scope>(
scope: &'scope Scope,
this: &'infer <Self as CubeType>::ExpandType,
) -> &'infer <[Vector<ES, N>] as CubeType>::ExpandType ⓘ
pub fn __expand_as_slice<'infer, 'scope>( scope: &'scope Scope, this: &'infer <Self as CubeType>::ExpandType, ) -> &'infer <[Vector<ES, N>] as CubeType>::ExpandType ⓘ
Returns the tile as an offset read-only slice. Should only be used when swizzling is definitely not applicable.
Sourcepub fn __expand_as_slice_mut<'infer, 'scope>(
scope: &'scope Scope,
this: &'infer mut <Self as CubeType>::ExpandType,
) -> &'infer mut <[Vector<ES, N>] as CubeType>::ExpandType ⓘ
pub fn __expand_as_slice_mut<'infer, 'scope>( scope: &'scope Scope, this: &'infer mut <Self as CubeType>::ExpandType, ) -> &'infer mut <[Vector<ES, N>] as CubeType>::ExpandType ⓘ
Returns the tile as an offset slice. Should only be used when swizzling is definitely not applicable.
Source§impl<ES: Numeric, N: Size> StridedTile<ES, N>
impl<ES: Numeric, N: Size> StridedTile<ES, N>
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>
Sourcepub fn __expand_get_vector(
scope: &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_get_vector( scope: &Scope, this: &<Self as CubeType>::ExpandType, coor_strided: <u32 as CubeType>::ExpandType, coor_contiguous: <u32 as CubeType>::ExpandType, ) -> <Vector<ES, N> as CubeType>::ExpandType
Returns a specific vector from the tile based on coordinates.
pub fn __expand_stage_offset( scope: &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: &Scope, this: &<Self as CubeType>::ExpandType, ) -> <StridedTile<ES, N2> as CubeType>::ExpandType
Trait Implementations§
Source§impl<ES: Clone + Numeric, N: Clone + Size> Clone for StridedTile<ES, N>
impl<ES: Clone + Numeric, N: Clone + Size> Clone for StridedTile<ES, N>
Source§fn clone(&self) -> StridedTile<ES, N>
fn clone(&self) -> StridedTile<ES, N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ES: Numeric, N: Size> CubeType for StridedTile<ES, N>
impl<ES: Numeric, N: Size> CubeType for StridedTile<ES, N>
type ExpandType = StridedTileExpand<ES, N>
Auto Trait Implementations§
impl<ES, N> Freeze for StridedTile<ES, N>
impl<ES, N> RefUnwindSafe for StridedTile<ES, N>where
ES: RefUnwindSafe,
N: RefUnwindSafe,
impl<ES, N> Send for StridedTile<ES, N>
impl<ES, N> Sync for StridedTile<ES, N>
impl<ES, N> Unpin for StridedTile<ES, N>
impl<ES, N> UnsafeUnpin for StridedTile<ES, N>
impl<ES, N> UnwindSafe for StridedTile<ES, N>where
ES: UnwindSafe,
N: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more