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

DFTI_DESCRIPTOR does not have the BIND(C) or SEQUENCE attributes

ereisch
New Contributor II
204 Views

Using oneAPI 2023.1.0, mkl_dfti.f90 does not specify the DFTI_DESCRIPTOR type as BIND(C) (or SEQUENCE), which means these descriptors (which appear to only be pointers) cannot be used in common blocks.  I'm not sure what language the underlying algorithms are written in, but since it appears to be just an opaque pointer, specifying the derived type as BIND(C) should probably be safe?

I'm making a copy of mkl_dfti.f90 and making this change locally, but it would be helpful if all the MKL descriptor types were all specified as BIND(C) if possible, which would allow storing them in common blocks without violating the standard.

As always, thanks for the helpful library and documentation.

0 Kudos
1 Reply
Ruqiu_C_Intel
Moderator
150 Views

Thank you to contact us.

As the comment in file mkl_dfti.f90, only the pointer can be used for the type of DFTI_DESCRIPTOR.

 TYPE, PUBLIC :: DFTI_DESCRIPTOR

   PRIVATE

   INTEGER :: dontuse

   ! Structure of this type is not used in Fortran code

   ! the pointer to this type is used only

 END TYPE DFTI_DESCRIPTOR


If we check Common statement linkage here:

https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2024-0/common.html

it indicates that there is no requirement for pointer should be sequence type or a type with the Bind attribute.


Hopefully it helps.





0 Kudos
Reply