Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

matmul to gemm

aslan666
Beginner
446 Views

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?

0 Kudos
3 Replies
TimP
Honored Contributor III
446 Views

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.

0 Kudos
aslan666
Beginner
446 Views

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?

 

0 Kudos
TimP
Honored Contributor III
446 Views

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

0 Kudos
Reply