Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

MKL BLAS 2

brunocalado
Beginner
541 Views
I'm trying to call:

[cpp]call gemv(a, x, y [,alpha][,beta] [,trans])[/cpp]

From the Fortran 95 interface but I always get a message of:

Description Resource Path Location Type
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90 FORGATRAN/src line 12 C/C++ Problem



My full code is:

[cpp]PROGRAM main
use mkl95_blas

IMPLICIT NONE
INTEGER :: A(3, 3), B(3, 1)
integer :: xA, yA, xB, yB
xA = 3
yA = 3
xB = 3
yB = 1

call gemv(A, B)

END PROGRAM[/cpp]

It compile when I comment ''call gemv(A, B)"

I'm using
Ubuntu + Eclipse + Photran
0 Kudos
8 Replies
ArturGuzik
Valued Contributor I
541 Views

From the Fortran 95 interface but I always get a message of:

Description Resource Path Location Type
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90 FORGATRAN/src line 12 C/C++ Problem



Hi,

(1) did you generate the .mod file(s) as outlined in User's Guide?
(2) even if you did the routine requires, at least, 3 arguments while you're specifing only 2, so .... the matching routine can't be found.

A.

0 Kudos
brunocalado
Beginner
541 Views
I don't know how to call this:
[cpp]call gemv(a, x, y [,alpha][,beta] [,trans])[/cpp]


I tried:
[cpp]call gemv( A, B, (/'N', 1, 0/) )[/cpp]
Errors:
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90
error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [0] main.f90
error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [1] main.f90



And:
[cpp]call gemv( A, B, 'N' )[/cpp]
Errors:
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90


And I don't have ideia how to compile the mod. All MKL library are in my include path and it usually compile anyone needed.

Can you help me?
0 Kudos
ArturGuzik
Valued Contributor I
541 Views
Quoting - brunocalado
I don't know how to call this:
[cpp]call gemv(a, x, y [,alpha][,beta] [,trans])[/cpp]


I tried:
[cpp]call gemv( A, B, (/'N', 1, 0/) )[/cpp]
Errors:
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90
error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [0] main.f90
error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [1] main.f90



And:
[cpp]call gemv( A, B, 'N' )[/cpp]
Errors:
error #6285: There is no matching specific subroutine for this generic subroutine call. [GEMV] main.f90


And I don't have ideia how to compile the mod. All MKL library are in my include path and it usually compile anyone needed.

Can you help me?

(1) In both calls you need matrix A(m,n), vector b(n) and another vector y(m), which is a result of multiplication.
The docs read:
call gemv(a, x, y [,alpha][,beta] [,trans])

so all a, x, and y are required, while arguments in brackets can be omitted (and their defaults will be used).

You're missing, in every call, vector y which will hold the results of *{b}. Passing 'N' as the third argument produces an error on binary expression as the linker expects an array there and not character variable you specified.

(2) Go to Chapter Using Language-Specific Interfaces with Intel MKL on page 7-1 in User's Guide for details on how to build *.mod files or try to extract (portion) of wrapper source file(s).


A.
0 Kudos
brunocalado
Beginner
541 Views
[cpp]program ex_01

	USE mkl95_precision
	USE mkl95_blas


 !------------------------------------------------------------------------------
	IMPLICIT NONE !No permite variaves no declaradas


      character(len = 1) :: trans = "N"
      integer,parameter :: m=3
      integer,parameter :: n=3
      real(8) :: alpha =1.0
      real(8) :: beta=0.0
      real(8) :: a(m, n), x(m), y(n)


      call gemv(a, x(1:n), y(1:m), alpha, beta, trans)




      end
[/cpp]


Description Resource Path Location Type
undefined reference to `dgemv_mkl95' ex_01.f90 /BLAS_EX line 19 C/C++ Problem


and now????
I'm on eclipse 3.5
0 Kudos
ArturGuzik
Valued Contributor I
541 Views
Quoting - brunocalado
Description Resource Path Location Type
undefined reference to `dgemv_mkl95' ex_01.f90 /BLAS_EX line 19 C/C++ Problem

and now????

It looks as if there is something wrong with linking/libraries. Makefile please.

I would note that the call you're trying to make can be shorten to:

call gemv(a, x, y, beta=0.0)

as the other (alpha, trans) you defined, are the same as defaults.


A.

0 Kudos
brunocalado
Beginner
541 Views








The folder MOD was create by me using
make lib32 INSTALL_DIR=

Anyone ever used this???
0 Kudos
ArturGuzik
Valued Contributor I
541 Views
Quoting - brunocalado
The folder MOD was create by me using
make lib32 INSTALL_DIR=

Anyone ever used this???

(1) well, I was wrong on the optional args, as gemv points to an interface. Sorry. However, this will always work (referencing specific routine)

use mkl95_blas, only: DGEMV_MKL95

call DGEMV_MKL95(a, x, y, beta=0.0d0)


(2) apart from .mod you may still need libraries. See make file in examples.

(3) if you don't want to create .lib, you always can try to add to your project the following files from MKL dir:

mkl_blas.f90
mkl_blas_protos.f90

and then build the project and link, say (consult Link Line Advisor page), to:
mkl_intel_c.lib mkl_intel_thread.lib mkl_core.lib

As you use Photran and Eclipse - does it run .bat file for building environment?

A.
0 Kudos
Vladimir_Koldakov__I
New Contributor III
541 Views

Hello,

According to the:

callgemv(a,x,y[,alpha][,beta][,trans])

you shoud provide at least three arguments to the interface. The first one is matrix then two vectors. So such kinds of calls are incorrect:

callgemv(A,B)

callgemv(A,B,'N')

Try this for instance:

program ex_01

USE mkl95_blas

IMPLICIT NONE !No permite variaves no declaradas

real :: A(3, 3), B(3), Y(3)

! init A & B

call gemv(a, b, y) ! y = a * b

!print *, y

end

Thanks,

Vladimir


0 Kudos
Reply