pub trait Microkernel<T: TropicalSemiring> {
const MR: usize;
const NR: usize;
// Required method
unsafe fn execute(
&self,
mr: usize,
nr: usize,
k: usize,
a: *const T::Scalar,
b: *const T::Scalar,
c: *mut T,
ldc: usize,
);
}Expand description
Trait for GEMM microkernels.
A microkernel computes a small block of C += A * B using register blocking. The dimensions mr x nr define the “register tile” that fits in CPU registers.
Required Associated Constants§
Required Methods§
Sourceunsafe fn execute(
&self,
mr: usize,
nr: usize,
k: usize,
a: *const T::Scalar,
b: *const T::Scalar,
c: *mut T,
ldc: usize,
)
unsafe fn execute( &self, mr: usize, nr: usize, k: usize, a: *const T::Scalar, b: *const T::Scalar, c: *mut T, ldc: usize, )
Execute the microkernel.
Computes C[0..mr, 0..nr] = A[0..mr, 0..k] ⊗ B[0..k, 0..nr] where the result is combined with existing C values using tropical addition.
§Safety
amust point to at leastmr * kelements (packed column-major)bmust point to at leastk * nrelements (packed row-major)cmust point to at leastmr * ldcelementsmr <= Self::MRandnr <= Self::NR
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.