pub struct TiledMatmul {
pub tile_size: usize,
}Expand description
Tiled matrix multiplication engine.
Fields§
§tile_size: usizeTile dimension (square tiles).
Implementations§
Source§impl TiledMatmul
impl TiledMatmul
Sourcepub fn with_tile_size(tile_size: usize) -> Self
pub fn with_tile_size(tile_size: usize) -> Self
Create with a custom tile size.
Sourcepub fn matmul(
&self,
a: &[f64],
m: usize,
k: usize,
b: &[f64],
n: usize,
) -> Vec<f64>
pub fn matmul( &self, a: &[f64], m: usize, k: usize, b: &[f64], n: usize, ) -> Vec<f64>
Compute C = A × B using tiled iteration.
a: row-major matrix [m × k]b: row-major matrix [k × n]- Returns: row-major matrix [m × n]
Panics if inner dimensions don’t match.
Sourcepub fn matmul_transposed_b(
&self,
a: &[f64],
m: usize,
k: usize,
b: &[f64],
n: usize,
) -> Vec<f64>
pub fn matmul_transposed_b( &self, a: &[f64], m: usize, k: usize, b: &[f64], n: usize, ) -> Vec<f64>
Compute C = A × B^T using tiled iteration (useful when B is stored in row-major but you need A × B^T).
a: row-major matrix [m × k]b: row-major matrix [n × k] (transposed: each row of b is a column of B)- Returns: row-major matrix [m × n]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TiledMatmul
impl RefUnwindSafe for TiledMatmul
impl Send for TiledMatmul
impl Sync for TiledMatmul
impl Unpin for TiledMatmul
impl UnsafeUnpin for TiledMatmul
impl UnwindSafe for TiledMatmul
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
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>
Converts
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>
Converts
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