pub trait Gemm:
Copy
+ Default
+ Sealed
+ 'static {
// Required methods
fn mul_add(acc: Self, a: Self, b: Self) -> Self;
unsafe fn gemm(
m: usize,
n: usize,
k: usize,
dst: &mut [Self],
a: MatView<'_, Self>,
b: MatView<'_, Self>,
);
}Expand description
An element type with a GEMM kernel: f32, f64, f16, and [f32; 2] (complex64 as
(re, im)).
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Gemm for f16
impl Gemm for f16
Source§unsafe fn gemm(
m: usize,
n: usize,
k: usize,
dst: &mut [Self],
a: MatView<'_, Self>,
b: MatView<'_, Self>,
)
unsafe fn gemm( m: usize, n: usize, k: usize, dst: &mut [Self], a: MatView<'_, Self>, b: MatView<'_, Self>, )
As MLX: widened to f32, multiplied with f32 accumulation, rounded once (the
gemm crate’s f16 kernel accumulates in f16, losing bits over a long k).