15 ms·
Matrix-vector operations are part of BLAS, and most performant BLAS packages (e.g. MKL and OpenBLAS) are written in assembly or machine-generated using a specia
by simonster 11y ago
Matrix-vector operations are part of BLAS, and most performant BLAS packages (e.g. MKL and OpenBLAS) are written in assembly or machine-generated using a special-purpose codegen. You can't write the gemv/gemm kernel in any general-purpose language and expect to beat modern BLAS. But you can call BLAS/LAPACK from whatever language you want. This is how MATLAB succeeds even though it has a dog-slow interpreter.