Skip to content

Commit

Permalink
Remove derived Default impl for GEMM kernels
Browse files Browse the repository at this point in the history
Kernels are only supposed to be constructible via the `new` method which returns
`None` if the kernel is not supported on the current system. Having a derived
`Default` impl provided a way to instantiate the kernels even on systems where
they are not supported.
  • Loading branch information
robertknight committed Sep 11, 2024
1 parent 34ffc73 commit 74aee00
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/gemm/kernels/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use super::simd_generic::{simd_gemm, simd_gemv};
use super::Kernel;
use crate::gemm::packing::{pack_a_block, pack_b_block};

#[derive(Default)]
pub struct ArmNeonKernel {
_private: (),
}
Expand Down
1 change: 0 additions & 1 deletion src/gemm/kernels/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::gemm::packing::{pack_a_block, pack_b_block};
/// This is the base kernel that does not use architecture-specific intrinsics
/// but is autovectorization-friendly. It is expected to perform the same as
/// a kernel using SSE intrinsics (or equivalent).
#[derive(Default)]
pub struct GenericKernel {
_private: (),
}
Expand Down
1 change: 0 additions & 1 deletion src/gemm/kernels/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use super::simd_generic::{simd_gemm, simd_gemv};
use super::Kernel;
use crate::gemm::packing::{pack_a_block, pack_b_block};

#[derive(Default)]
pub struct WasmKernel {
_private: (),
}
Expand Down
2 changes: 0 additions & 2 deletions src/gemm/kernels/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use super::Kernel;
use crate::gemm::packing::{pack_a_block, pack_b_block};

/// Optimized kernel for x64 CPUs that support AVX + FMA instructions.
#[derive(Default)]
pub struct FmaKernel {
_private: (),
}
Expand Down Expand Up @@ -132,7 +131,6 @@ unsafe impl Kernel<f32, f32, f32> for FmaKernel {

/// Optimized kernel for x64 CPUs that support AVX 512 instructions.
#[cfg(feature = "avx512")]
#[derive(Default)]
pub struct Avx512Kernel {
_private: (),
}
Expand Down

0 comments on commit 74aee00

Please sign in to comment.