pub struct CpuBackend;Expand description
CPU backend using portable SIMD
Trait Implementations§
Source§impl Backend for CpuBackend
impl Backend for CpuBackend
Source§fn sparse_matmul(
&self,
matrix: &Array2<f32>,
input: &[f32],
rows: &[usize],
) -> Vec<f32>
fn sparse_matmul( &self, matrix: &Array2<f32>, input: &[f32], rows: &[usize], ) -> Vec<f32>
Sparse matrix-vector multiplication
Only computes rows specified in
rowsSource§fn sparse_matmul_accumulate(
&self,
matrix: &Array2<f32>,
input: &[f32],
cols: &[usize],
output: &mut [f32],
)
fn sparse_matmul_accumulate( &self, matrix: &Array2<f32>, input: &[f32], cols: &[usize], output: &mut [f32], )
Sparse matrix-vector multiplication with column-major accumulation
Source§fn activation(&self, data: &mut [f32], activation_type: ActivationType)
fn activation(&self, data: &mut [f32], activation_type: ActivationType)
Apply activation function in-place
Source§fn axpy(&self, a: &mut [f32], b: &[f32], scalar: f32)
fn axpy(&self, a: &mut [f32], b: &[f32], scalar: f32)
Vectorized multiply-add: a[i] += b[i] * scalar
Source§fn simd_width(&self) -> usize
fn simd_width(&self) -> usize
SIMD width (number of f32s per vector register)
Auto Trait Implementations§
impl Freeze for CpuBackend
impl RefUnwindSafe for CpuBackend
impl Send for CpuBackend
impl Sync for CpuBackend
impl Unpin for CpuBackend
impl UnwindSafe for CpuBackend
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