Skip to main content

gemv_f32

Function gemv_f32 

Source
pub fn gemv_f32(
    m: usize,
    n: usize,
    a: &[f32],
    x: &[f32],
) -> Result<Vec<f32>, ForgeError>
Expand description

Best-path single-precision dense GEMV: row-major y[M] = A[M×N] · x[N].

Path selection (mirrors gemm_f32):

  1. WGSL GPU — when caps().wgpu is set and the problem is at least GEMM_GPU_THRESHOLD MACs (m * n), run the certified GEMV via the shared ForgeRuntime. A runtime build/dispatch failure is not propagated — the call falls through to the CPU floor so it is never broken.
  2. CPU floor — otherwise compute on the CPU via gemv_cpu.

a must have m * n elements (row-major) and x must have n. Returns m row elements. Dimension/length mismatches are the only hard errors.