The Intel MKL ILP64 libraries use the 64-bit integer type (necessary for indexing huge arrays, with more than 231-1 elements), whereas the LP64 libraries index arrays with the 32-bit integer type.
The LP64 and ILP64 interfaces are supported in the Interface layer (see Layered Model Concept and Directory Structure in Detail for more information).
The ILP64 interface is provided for the following two reasons:
- To support huge data arrays (with more than 231-1 elements)
- To enable compiling your Fortran code with the -i8 compiler option
It is up to you to choose which interface to use. Choose the LP64 interface for compatibility with the previous Intel MKL versions because "LP64" is just a new name for the only interface that the Intel MKL versions lower than 9.1 provided. Choose the ILP64 interface if your application uses Intel MKL for calculations with huge data arrays or the library may be used so in future.
Intel MKL provides the same include directory for the ILP64 and LP64 interfaces.
Table 3-2 shows how to compile for the ILP64 and LP64 interfaces:
|
Fortran |
|
|
Compiling for ILP64 |
ifort -i8 -I<mkl drectory>/include … |
|
Compiling for LP64 |
ifort -I<mkl drectory>/include … |
|
C or C++ |
|
|
Compiling for ILP64 |
icc -DMKL_ILP64 -I<mkl directory>/include … |
|
Compiling for LP64 |
icc -I<mkl directory>/include … |
|
|
NOTE. Linking of the application compiled with the -i8 or -DMKL_ILP64 option to the LP64 libraries may result in unpredictable consequences and erroneous output. |
You do not need to change existing code if you are not using the ILP64 interface.
To migrate to ILP64 or write new code for ILP64, use appropriate types for parameters of the Intel MKL functions and subroutines (see Table 3-3):
|
|
Fortran |
C or C++ |
|
32-bit integers |
INTEGER*4 or |
int |
|
Universal integers for ILP64/LP64: - 64-bit for ILP64 - 32-bit otherwise |
INTEGER |
MKL_INT |
|
Universal integers for ILP64/LP64: - 64-bit integers |
INTEGER*8 or INTEGER(KIND=8) |
MKL_INT64 |
|
FFT interface integers for ILP64/LP64 |
INTEGER |
MKL_LONG |
Given a function with integer parameters, the Reference Manual does not explain which parameters become 64-bit and which remain 32-bit for ILP64, and you are encouraged to browse the include files, examples, and tests for the ILP64 interface details. For their location, see Table 3-1.
You are encouraged to start with browsing the include files, listed in Table A-2.
Some function domains that support only a Fortran interface (see Table A-1), provide header files for C/C++ in the include directory. Such *.h files enable using a Fortran binary interface from C/C++ code. These files can also be used to understand the ILP64 usage.
All Intel MKL function domains support ILP64 programming with the following exceptions:
- FFTW interfaces to Intel MKL:
— FFTW 2.x wrappers do not support ILP64.
— FFTW 3.2 wrappers support ILP64 by a dedicated set of functions plan_guru64.
- GMP* arithmetic functions do not support ILP64.