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

MKL_malloc interface missing from Fortran module

Ben3
Beginner
720 Views

Hi,

It looks like the interface for MKL_malloc is missing from the mkl_service Fortran 90 module, at least in the versions I have. Is it supposed to be in there? The documentation seems to indicate so, and the interface for mkl_free is definitely there.

Cheers,
Ben

Windows

14.0.2.176

Linux

$ grep -ic mkl_malloc composer*/mkl/include/mkl_service.f90
composer_xe_2011_sp1.10.319/mkl/include/mkl_service.f90:0
composer_xe_2011_sp1.13.367/mkl/include/mkl_service.f90:0
composer_xe_2011_sp1.6.233/mkl/include/mkl_service.f90:0
composer_xe_2011_sp1.8.273/mkl/include/mkl_service.f90:0
composer_xe_2011_sp1.9.293/mkl/include/mkl_service.f90:0
composer_xe_2013.0.079/mkl/include/mkl_service.f90:0
composer_xe_2013.1.117/mkl/include/mkl_service.f90:0
composer_xe_2013.2.146/mkl/include/mkl_service.f90:0
composer_xe_2013.4.183/mkl/include/mkl_service.f90:0
composer_xe_2013.5.192/mkl/include/mkl_service.f90:0
composer_xe_2013_sp1.0.080/mkl/include/mkl_service.f90:0
composer_xe_2013_sp1.1.106/mkl/include/mkl_service.f90:0
composer_xe_2013_sp1.2.144/mkl/include/mkl_service.f90:0
composer_xe_2013_sp1.3.174/mkl/include/mkl_service.f90:0
composerxe-2011.0.084/mkl/include/mkl_service.f90:0
composerxe-2011.3.174/mkl/include/mkl_service.f90:0
composerxe-2011.4.191/mkl/include/mkl_service.f90:0
composerxe-2011/mkl/include/mkl_service.f90:0
0 Kudos
3 Replies
Gennady_F_Intel
Moderator
720 Views

declared in mkl_service.h.   there is an example -- <mklroot>\examples\servicefuncsf\source\ servicefuncs.f 

0 Kudos
Ben3
Beginner
720 Views

Gennady Fedorov (Intel) wrote:

declared in mkl_service.h.   there is an example -- <mklroot>\examples\servicefuncsf\source\ servicefuncs.f 

Yes, the C prototypes are in mkl_service.h, but that won't work for Fortran.

That example file has the MKL memory functions declared as external, rather than with using an explicit interface:

#ifdef _IA32
      INTEGER*4 MKL_MALLOC, MKL_CALLOC, MKL_REALLOC
      integer*4 ALLOC_SIZE, NUM_ELEM, SIZE_ELEM
#else
      INTEGER*8 MKL_MALLOC, MKL_CALLOC, MKL_REALLOC
      integer*8 ALLOC_SIZE, NUM_ELEM, SIZE_ELEM
#endif

      EXTERNAL   MKL_MALLOC, MKL_FREE, MKL_CALLOC, MKL_REALLOC

The documentation indicates that an interface should be available for both languages:

Intel® Math Kernel Library 11.1 Update 2 Reference Manual wrote:

Fortran Include Files/Modules

  • Include file: mkl.fi
  • Module (compiled): mkl_service.mod
  • Module (source): mkl_service.f90

C Include Files

  • mkl.h

However it's also missing from mkl.fi:

$ grep -ic malloc composer*/mkl/include/mkl.fi 
composer_xe_2011_sp1.10.319/mkl/include/mkl.fi:0
composer_xe_2011_sp1.13.367/mkl/include/mkl.fi:0
composer_xe_2011_sp1.6.233/mkl/include/mkl.fi:0
composer_xe_2011_sp1.8.273/mkl/include/mkl.fi:0
composer_xe_2011_sp1.9.293/mkl/include/mkl.fi:0
composer_xe_2013.0.079/mkl/include/mkl.fi:0
composer_xe_2013.1.117/mkl/include/mkl.fi:0
composer_xe_2013.2.146/mkl/include/mkl.fi:0
composer_xe_2013.4.183/mkl/include/mkl.fi:0
composer_xe_2013.5.192/mkl/include/mkl.fi:0
composer_xe_2013_sp1.0.080/mkl/include/mkl.fi:0
composer_xe_2013_sp1.1.106/mkl/include/mkl.fi:0
composer_xe_2013_sp1.2.144/mkl/include/mkl.fi:0
composer_xe_2013_sp1.3.174/mkl/include/mkl.fi:0
composerxe-2011.0.084/mkl/include/mkl.fi:0
composerxe-2011.3.174/mkl/include/mkl.fi:0
composerxe-2011.4.191/mkl/include/mkl.fi:0
composerxe-2011/mkl/include/mkl.fi:0

I just wrote my own interface for it.

Cheers,

Ben

 

0 Kudos
Gennady_F_Intel
Moderator
720 Views

Hello. 

The issue has been fixed in MKL v.11.3.0 which has been released two days ago. Please check how it works and let us know if any further problems.

 

0 Kudos
Reply