Developer Reference

Contents

C Interface Conventions for LAPACK Routines

The C interfaces are implemented for most of the
Intel® MKL
LAPACK driver and computational routines.

NaN checking in LAPACKE

NaN checking can affect the performance of an application. By default, it is ON.
See the Support Functions section for details on the methods and options to turn NaN check off or back on with LAPACKE:.

Function Prototypes

Intel® MKL
supports four distinct floating-point precisions. Each corresponding prototype looks similar, usually differing only in the data type. C interface LAPACK function names follow the form
<?><name>
, where
<?>
is:
  • LAPACKE_s
    for float
  • LAPACKE_d
    for double
  • LAPACKE_c
    for lapack_complex_float
  • LAPACKE_z
    for lapack_complex_double
A specific example follows. To solve a system of linear equations with a packed Cholesky-factored Hermitian positive-definite matrix with complex precision, use the following:
lapack_int LAPACKE_
c
pptrs
(int
matrix_layout
, char
uplo
, lapack_int
n
, lapack_int
nrhs
, const
lapack_complex_float
*
ap
,
lapack_complex_float
*
b
, lapack_int
ldb
);

Workspace Arrays

In contrast to the Fortran interface, the LAPACK C interface omits workspace parameters because workspace is allocated during runtime and released upon completion of the function operation.
If you prefer to allocate workspace arrays yourself, the LAPACK C interface provides alternate interfaces with
work
parameters. The name of the alternate interface is the same as the LAPACK C interface with
_work
appended. For example, the syntax for the singular value decomposition of a real bidiagonal matrix is:
Fortran:
call sbdsdc ( uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq,
work
,
iwork
, info )
C LAPACK interface:
lapack_int LAPACKE_sbdsdc ( int matrix_layout, char uplo, char compq, lapack_int n, float* d, float* e, float* u, lapack_int ldu, float* vt, lapack_int ldvt, float* q, lapack_int* iq );
Alternate C LAPACK interface with
work
parameters:
lapack_int LAPACKE_sbdsdc_work( int matrix_layout, char uplo, char compq, lapack_int n, float* d, float* e, float* u, lapack_int ldu, float* vt, lapack_int ldvt, float* q, lapack_int* iq, float*
work
, lapack_int*
iwork
);
See the
install_dir
/include/mkl_lapacke.h
file for the full list of alternative C LAPACK interfaces.
The
Intel® MKL
Fortran-specific documentation contains details about workspace arrays.

Mapping Fortran Data Types against C Data Types

Fortran Data Types vs. C Data Types
FORTRAN
C
INTEGER
lapack_int
LOGICAL
lapack_logical
REAL
float
DOUBLE PRECISION
double
COMPLEX
lapack_complex_float
COMPLEX*16
/
DOUBLE COMPLEX
lapack_complex_double
CHARACTER
char

C Type Definitions

You can find type definitions specific to
Intel® MKL
such as
MKL_INT
,
MKL_Complex8
, and
MKL_Complex16
in
install_dir
/mkl_types.h
.
C types
#ifndef lapack_int #define lapack_int MKL_INT #endif #ifndef lapack_logical #define lapack_logical lapack_int #endif
Complex Type Definitions
Complex type for single precision:
#ifndef lapack_complex_float #define lapack_complex_float MKL_Complex8 #endif
Complex type for double precision:
#ifndef lapack_complex_double #define lapack_complex_double MKL_Complex16 #endif
Matrix Layout Definitions
#define LAPACK_ROW_MAJOR 101 #define LAPACK_COL_MAJOR 102
See Matrix Layout for LAPACK Routines for an explanation of row-major order and column-major order storage.
Error Code Definitions
#define LAPACK_WORK_MEMORY_ERROR -1010 /* Failed to allocate memory for a working array */ #define LAPACK_TRANSPOSE_MEMORY_ERROR -1011 /* Failed to allocate memory for transposed matrix */

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804