pub struct MatrixBlockSlice<'a> {
limbs: *const u64,
stride: NonZeroUsize,
_marker: PhantomData<&'a ()>,
}Expand description
A non-contiguous view of a 64 x 64 block within a larger matrix.
The block is stored in row-major order with a configurable stride between rows. This allows efficient access to sub-blocks within a matrix without copying data.
§Safety
The limbs pointer must remain valid for the lifetime 'a, and must point to at least 64 valid
rows spaced stride limbs apart.
Fields§
§limbs: *const u64§stride: NonZeroUsizeNumber of limbs between consecutive rows
_marker: PhantomData<&'a ()>Implementations§
Source§impl<'a> MatrixBlockSlice<'a>
impl<'a> MatrixBlockSlice<'a>
pub(super) fn new(limbs: *const u64, stride: NonZeroUsize) -> Self
pub(crate) fn limbs(&self) -> *const u64
pub(crate) fn stride(&self) -> NonZeroUsize
Sourcepub fn iter(self) -> impl Iterator<Item = &'a u64>
pub fn iter(self) -> impl Iterator<Item = &'a u64>
Returns an iterator over the 64 rows of this block.
§Safety
Each element is obtained via self.limbs.add(i * self.stride), which is safe because the
constructor guarantees 64 valid rows at the given stride.
Sourcepub fn gather(self) -> MatrixBlock
pub fn gather(self) -> MatrixBlock
Gathers the non-contiguous block into a contiguous MatrixBlock.
This operation is necessary before performing block-level GEMM since the AVX-512 kernel expects contiguous data.
Trait Implementations§
impl Send for MatrixBlockSlice<'_>
impl Sync for MatrixBlockSlice<'_>
Auto Trait Implementations§
impl<'a> Freeze for MatrixBlockSlice<'a>
impl<'a> RefUnwindSafe for MatrixBlockSlice<'a>
impl<'a> Unpin for MatrixBlockSlice<'a>
impl<'a> UnwindSafe for MatrixBlockSlice<'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> 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