pub struct GemmWorkspace<T: TropicalScalar> { /* private fields */ }Expand description
Reusable CPU packing storage, shared by sequential calls through an exclusive borrow.
Each parallel output task gets its own pair of buffers. Storage grows to the
largest panels and task count used so far; call Self::clear to release it.
This reuses packing allocations, not result matrices or Rayon task metadata.
The scalar parameter permits reuse across semirings with the same scalar type.
use tropical_gemm::{GemmWorkspace, TropicalGemm, TropicalMaxPlus};
let mut workspace = GemmWorkspace::<f32>::new();
let mut c = vec![TropicalMaxPlus(0.0); 4];
for _ in 0..3 {
TropicalGemm::new(2, 2, 2).execute_with_workspace(
&[1.0; 4], 2, &[2.0; 4], 2, &mut c, 2, &mut workspace,
);
}
assert!(c.iter().all(|v| v.0 == 3.0));Implementations§
Source§impl<T: TropicalScalar> GemmWorkspace<T>
impl<T: TropicalScalar> GemmWorkspace<T>
Trait Implementations§
Source§impl<T: Debug + TropicalScalar> Debug for GemmWorkspace<T>
impl<T: Debug + TropicalScalar> Debug for GemmWorkspace<T>
Source§impl<T: TropicalScalar> Default for GemmWorkspace<T>
impl<T: TropicalScalar> Default for GemmWorkspace<T>
Auto Trait Implementations§
impl<T> Freeze for GemmWorkspace<T>
impl<T> RefUnwindSafe for GemmWorkspace<T>where
T: RefUnwindSafe,
impl<T> Send for GemmWorkspace<T>
impl<T> Sync for GemmWorkspace<T>
impl<T> Unpin for GemmWorkspace<T>where
T: Unpin,
impl<T> UnsafeUnpin for GemmWorkspace<T>
impl<T> UnwindSafe for GemmWorkspace<T>where
T: 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
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