pub struct WasmBackend;Expand description
WASM backend using wasm32 SIMD instructions
Trait Implementations§
Source§impl Backend for WasmBackend
impl Backend for WasmBackend
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 WasmBackend
impl RefUnwindSafe for WasmBackend
impl Send for WasmBackend
impl Sync for WasmBackend
impl Unpin for WasmBackend
impl UnwindSafe for WasmBackend
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