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

Matrix Multiplication using SGEMM

rafadix08
Beginner
492 Views

I am trying to perform a simple matrix multiplication using the SGEMM function. I am including a "USE SGEMM_INT" line in the program, but still I am getting:

"there is no matching specific subroutine for this generic subroutine call"

When I compile it.

Do I have to add any additional reference to some other library?

PS: I have Intel'sVisual Fortran with IMSL

Thanks,

Rafael

0 Kudos
5 Replies
TimP
Honored Contributor III
492 Views
Quoting - rafadix08

I am trying to perform a simple matrix multiplication using the SGEMM function. I am including a "USE SGEMM_INT" line in the program, but still I am getting:

"there is no matching specific subroutine for this generic subroutine call"

PS: I have Intel'sVisual Fortran with IMSL

The IMSL header SGEMM_INT might be expected to produce such a message if it finds an error in number or type of arguments. It may refer to other IMSL files, but you may have the paths set OK, since SGEMM_INT is found.

0 Kudos
rafadix08
Beginner
492 Views

Thanks for the reply.

I actually solved my problem.

I had included the two following lines:

use numerical_libraries

use SGEMM_INT

Curiously, if I delete either line it works fine. Do you know why is this the case?

0 Kudos
Steven_L_Intel1
Employee
492 Views

You don't want to use both those lines. USE NUMERICAL_LIBRARIES is the way to provide the "Fortran 77" interfaces (as described in the IMSL documentation). USE DGEMM_INT is the way to provide the "Fortran 90" interfaces (same), which have different argument lists. The generic names in both those modules conflict, so if you use them both, you should get an error about the "same named symbol" being referenced from two modules.

It is critically important to choose the correct module to use, as if you mix the interface types inappropriately, you can get bizarre results or run-time errors.

Please carefully read the IMSL documentation description of the routine you want to use. It will (in most cases) show two variations of the calling sequence, and only the "Fortran 90" interface should be paired with the _INT module as listed.

Another common mistake is to use the double-precision name such as DGEMM with the Fortran 90 interfaces. That's a F77 interface routine. If you're using the F90 interfaces, use the generic name.

0 Kudos
rafadix08
Beginner
492 Views
Hi Steve, thanks!
I am still a bit confused about that.
I compiled and executed a program using the SGEMM function. Everything worked fine.
Then I decided to instead of using SGEMM, to use DGEMM. I included a "USE DGEMM_INT" and replaced SGEMM by DGEMM through the code. However, I got the following errormessage after compilation: "There is no matching specific subroutine for this generic subroutine call"
Why did my code work with SGEMM and not with DGEMM?
Then I tried to use just GEMM and included "USE GEMM_INT" (Error in opening the compiled module file)and / or "USE MKL_BLAS" or "USE MKL95_BLAS"
Here is the line I typed in the command line:
ifort %FFLAGS% Interpolation.f90 %LINK_FNL_STATIC% /F1000000000
Thanks!
Rafael

0 Kudos
Steven_L_Intel1
Employee
492 Views

Hmm. I had not thought there was a DGEMM_INT, but there is. I'd need to see the call to DGEMM and the declarations of all its agruments to tell you what is wrong, Now that I look at it closer, the xGEMM routines in IMSL all have one style of interface, compatible with typical usage. There is no GEMM_INT. Make sure that all of the REAL arguments are double precision.

For MKL, you have to build the modules. See the MKL documentation for details.

0 Kudos
Reply