Shubham
Shubham

Reputation: 372

dgemm or dgemv for Matrix Multiplication?

I know dgemv is for matrix-vector, but which is more efficient? Using dgemm directly for matrix multiplication or using dgemv to do the matrix multiplication by multiplying the Matrix A with each individual column of matrix B using dgemv?

Upvotes: 2

Views: 1216

Answers (1)

Stephen Canon
Stephen Canon

Reputation: 106267

If you make repeated calls to DGEMV, you will not benefit from cache tiling and re-use, which are the biggest advantages good DGEMM implementations have. DGEMM is vastly more efficient than multiple calls to DGEMV.

Upvotes: 7

Related Questions