pub struct MatrixTileSlice<'a> {
limbs: *const u64,
dimensions: [usize; 2],
stride: NonZeroUsize,
_marker: PhantomData<&'a ()>,
}Expand description
An immutable view of a tile within a matrix.
A tile is a rectangular region composed of multiple 64 x 64 blocks. Tiles enable hierarchical parallelization: large matrices are divided into tiles which are processed in parallel, and each tile is further divided into blocks for vectorization.
§Safety
The limbs pointer must remain valid for the lifetime 'a, and must point to a region large
enough for dimensions[0] * 64 rows and dimensions[1] blocks with the given stride.
Fields§
§limbs: *const u64§dimensions: [usize; 2]Dimensions of the tile in units of 64 x 64 blocks: [block_rows, block_cols]
stride: NonZeroUsizeNumber of limbs between consecutive rows in the parent matrix
_marker: PhantomData<&'a ()>Implementations§
Source§impl<'a> MatrixTileSlice<'a>
impl<'a> MatrixTileSlice<'a>
pub fn from_matrix(m: &'a Matrix) -> Self
Sourcepub fn block_rows(&self) -> usize
pub fn block_rows(&self) -> usize
Returns the number of 64 x 64 block rows in this tile.
Sourcepub fn block_columns(&self) -> usize
pub fn block_columns(&self) -> usize
Returns the number of 64 x 64 block columns in this tile.
Sourcepub fn block_at(
&self,
block_row: usize,
block_col: usize,
) -> MatrixBlockSlice<'_>
pub fn block_at( &self, block_row: usize, block_col: usize, ) -> MatrixBlockSlice<'_>
Returns a view of the block at the given block coordinates.
§Panics
Panics if the block coordinates are out of bounds.
pub fn split_rows_at( &self, block_rows: usize, ) -> (MatrixTileSlice<'_>, MatrixTileSlice<'_>)
pub fn split_columns_at( &self, block_columns: usize, ) -> (MatrixTileSlice<'_>, MatrixTileSlice<'_>)
Trait Implementations§
Source§impl<'a> Clone for MatrixTileSlice<'a>
impl<'a> Clone for MatrixTileSlice<'a>
Source§fn clone(&self) -> MatrixTileSlice<'a>
fn clone(&self) -> MatrixTileSlice<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for MatrixTileSlice<'a>
impl<'a> Debug for MatrixTileSlice<'a>
impl<'a> Copy for MatrixTileSlice<'a>
impl Send for MatrixTileSlice<'_>
impl Sync for MatrixTileSlice<'_>
Auto Trait Implementations§
impl<'a> Freeze for MatrixTileSlice<'a>
impl<'a> RefUnwindSafe for MatrixTileSlice<'a>
impl<'a> Unpin for MatrixTileSlice<'a>
impl<'a> UnwindSafe for MatrixTileSlice<'a>
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
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