matmul to gemm

matmul to gemm

Is there any way that matmul functions act like gemm subroutine in mkl blas package ? i write a long code and i used matmul a lot, i want to change them to gemm but a lot of changes should be done. is there any short way?

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Recent versions of ifort include an option /Qopt-matmul which changes MATMUL to call an internal MKL function, same as ?gemm.  It's on by default at -O3.  You didn't say whether your matrices are large enough to benefit from this; for small ones, setting -O3 while setting /Qopt-matmul- may proved more efficient.

gfortran has a similiar option -fexternal-blas which calls ?gemm, but object level compatitiblity is doubtful on Windows; and OpenMP library compatibility is unlikely.

thank you very much... my matrices are small ... the size is in range of 36*36 ... but the multipilication is in big loops over 9000 loops sometimes ... should i still use /Qopt-matmul?

 

Those are probably large enough to gain from the built-in threading implied by /Qopt-matmul, but you may want to compare

Leave a Comment

Please sign in to add a comment. Not a member? Join today