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

passing strings to MKL

Paul_Calvert
Beginner
435 Views

The MKL routines that accept a string seem to expect more parametersthan the documentation shows. As I understand it _DGESDD@60 would imply 60 bytes are passed, but only 56 are documented.

I'm missing something.

The Lahey compiler expects a 32 bit integer to be passed by value after the argument list to indicate the length of a string when called from another language. Does MKL expect something like that?

I'm using MKL in a Windows DLL. Calls that do not pass strings work fine.

0 Kudos
1 Solution
mecej4
Honored Contributor III
435 Views
Note that CVF/DVF used a calling convention for character arguments that is different from that used by Intel Fortran: the hidden string lengths are passed immediately after each character argument in CVF/DVF; in Intel Fortran, all the lengths are appended to the end of the explicit argument list.

I suspect that, since STDCALL name decoration is used and you use the Lahey compiler, you have modified the source code by adding DLLIMPORT directives. That is one way to do things, but you may have to remove those directives if you want to use the Intel compiler.

Read about the /iface: mixed_str_len_arg to /iface:nomixed_str_len_arg options of the Intel compiler.

View solution in original post

0 Kudos
2 Replies
ArturGuzik
Valued Contributor I
435 Views
It expects integer (4-byte unsigned). This is just Fortran requirenment, to pass length of the string, as hidden argument, by default.

here you have some discussion on that on MSDN and Intel. You can also use BIND options to improve interoperability with C.

A.

0 Kudos
mecej4
Honored Contributor III
436 Views
Note that CVF/DVF used a calling convention for character arguments that is different from that used by Intel Fortran: the hidden string lengths are passed immediately after each character argument in CVF/DVF; in Intel Fortran, all the lengths are appended to the end of the explicit argument list.

I suspect that, since STDCALL name decoration is used and you use the Lahey compiler, you have modified the source code by adding DLLIMPORT directives. That is one way to do things, but you may have to remove those directives if you want to use the Intel compiler.

Read about the /iface: mixed_str_len_arg to /iface:nomixed_str_len_arg options of the Intel compiler.
0 Kudos
Reply