pub struct StageMemory<ES: Numeric, T: TilingLayout> { /* private fields */ }
Expand description
Wrapper over the shared memory used for staging, abstracting its layout
Implementations§
Source§impl<ES: Numeric, T: TilingLayout> StageMemory<ES, T>
impl<ES: Numeric, T: TilingLayout> StageMemory<ES, T>
Sourcepub fn new<S: StageConfig>(
num_stages: u32,
ident: Ident,
config: S,
) -> StageMemory<ES, T>
pub fn new<S: StageConfig>( num_stages: u32, ident: Ident, config: S, ) -> StageMemory<ES, T>
Instantiate a new stage memory for the given identifier
Sourcepub fn new_aligned<S: StageConfig>(
ident: Ident,
alignment: u32,
config: S,
) -> StageMemory<ES, T>
pub fn new_aligned<S: StageConfig>( ident: Ident, alignment: u32, config: S, ) -> StageMemory<ES, T>
Instantiate a new stage memory for the given identifier, with shared memory alignment
Sourcepub fn new_with_smem(
smem: SharedMemory<Line<ES>>,
num_stages: u32,
) -> StageMemory<ES, T>
pub fn new_with_smem( smem: SharedMemory<Line<ES>>, num_stages: u32, ) -> StageMemory<ES, T>
Instantiate with a custom shared memory
Sourcepub fn get_tile<S: StageConfig>(
&self,
row: u32,
col: u32,
buffer_index: u32,
ident: Ident,
config: S,
) -> Tile<ES>
pub fn get_tile<S: StageConfig>( &self, row: u32, col: u32, buffer_index: u32, ident: Ident, config: S, ) -> Tile<ES>
Get the tile at position (row, col)
Sourcepub fn as_slice(&self, line_size: u32) -> Slice<Line<ES>>
pub fn as_slice(&self, line_size: u32) -> Slice<Line<ES>>
Return the whole stage as a slice, for reading
Sourcepub fn as_slice_mut(&mut self, line_size: u32) -> SliceMut<Line<ES>>
pub fn as_slice_mut(&mut self, line_size: u32) -> SliceMut<Line<ES>>
Return the whole stage as a mutable slice, for loading
Sourcepub fn clear_all<G: GlobalConfig>(&mut self, ident: InputIdent, config: G)
pub fn clear_all<G: GlobalConfig>(&mut self, ident: InputIdent, config: G)
Zero out the shared memory
Sourcepub fn clear_stage<G: GlobalConfig>(
&mut self,
stage_ident: StageIdent,
ident: InputIdent,
config: G,
)
pub fn clear_stage<G: GlobalConfig>( &mut self, stage_ident: StageIdent, ident: InputIdent, config: G, )
Zero out the shared memory for only one stage
pub fn __expand_new<S: StageConfig>( scope: &mut Scope, num_stages: u32, ident: Ident, config: S, ) -> <StageMemory<ES, T> as CubeType>::ExpandType
pub fn __expand_new_aligned<S: StageConfig>( scope: &mut Scope, ident: Ident, alignment: u32, config: S, ) -> <StageMemory<ES, T> as CubeType>::ExpandType
pub fn __expand_new_with_smem( scope: &mut Scope, smem: <SharedMemory<Line<ES>> as CubeType>::ExpandType, num_stages: u32, ) -> <StageMemory<ES, T> as CubeType>::ExpandType
pub fn __expand_get_tile<S: StageConfig>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, row: <u32 as CubeType>::ExpandType, col: <u32 as CubeType>::ExpandType, buffer_index: u32, ident: Ident, config: S, ) -> <Tile<ES> as CubeType>::ExpandType
pub fn __expand_as_slice( scope: &mut Scope, this: <Self as CubeType>::ExpandType, line_size: u32, ) -> <Slice<Line<ES>> as CubeType>::ExpandType
pub fn __expand_as_slice_mut( scope: &mut Scope, this: <Self as CubeType>::ExpandType, line_size: u32, ) -> <SliceMut<Line<ES>> as CubeType>::ExpandType
pub fn __expand_clear_all<G: GlobalConfig>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ident: InputIdent, config: G, ) -> <() as CubeType>::ExpandType
pub fn __expand_clear_stage<G: GlobalConfig>( scope: &mut Scope, this: <Self as CubeType>::ExpandType, stage_ident: StageIdent, ident: InputIdent, config: G, ) -> <() as CubeType>::ExpandType
Trait Implementations§
Source§impl<ES: Clone + Numeric, T: Clone + TilingLayout> Clone for StageMemory<ES, T>
impl<ES: Clone + Numeric, T: Clone + TilingLayout> Clone for StageMemory<ES, T>
Source§fn clone(&self) -> StageMemory<ES, T>
fn clone(&self) -> StageMemory<ES, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<ES: Numeric, T: TilingLayout> CubeType for StageMemory<ES, T>
impl<ES: Numeric, T: TilingLayout> CubeType for StageMemory<ES, T>
type ExpandType = StageMemoryExpand<ES, T>
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.
impl<ES: Copy + Numeric, T: Copy + TilingLayout> Copy for StageMemory<ES, T>
Auto Trait Implementations§
impl<ES, T> Freeze for StageMemory<ES, T>
impl<ES, T> RefUnwindSafe for StageMemory<ES, T>where
T: RefUnwindSafe,
ES: RefUnwindSafe,
impl<ES, T> Send for StageMemory<ES, T>
impl<ES, T> Sync for StageMemory<ES, T>
impl<ES, T> Unpin for StageMemory<ES, T>
impl<ES, T> UnwindSafe for StageMemory<ES, T>where
T: UnwindSafe,
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