CBLAS, the C interface to the Basic Linear Algebra Subprograms (BLAS), provides a C language interface to BLAS routines for Intel MKL. While you can call the Fortran implementation of BLAS, for coding in C the CBLAS interface has some advantages such as allowing you to specify column-major or row-major ordering with the layout parameter.

For more information about calling Fortran routines from C in general, and specifically about calling BLAS and CBLAS routines, see " Mixed-language Programming with the Intel Math Kernel Library" in the Intel Math Kernel Library Developer Guide.


This reference contains syntax in C for both the CBLAS interface and the Fortran BLAS routines.

In CBLAS, the Fortran routine names are prefixed with cblas_ (for example, dasum becomes cblas_dasum). Names of all CBLAS functions are in lowercase letters.

Complex functions ?dotc and ?dotu become CBLAS subroutines (void functions); they return the complex result via a void pointer, added as the last parameter. CBLAS names of these functions are suffixed with _sub. For example, the BLAS function cdotc corresponds to cblas_cdotc_sub.


Users of the CBLAS interface should be aware that the CBLAS are just a C interface to the BLAS, which is based on the FORTRAN standard and subject to the FORTRAN standard restrictions. In particular, the output parameters should not be referenced through more than one argument.


This interface is not implemented in the Sparse BLAS Level 2 and Level 3 routines.

The arguments of CBLAS functions comply with the following rules:

  • Input arguments are declared with the const modifier.

  • Non-complex scalar input arguments are passed by value.

  • Complex scalar input arguments are passed as void pointers.

  • Array arguments are passed by address.

  • BLAS character arguments are replaced by the appropriate enumerated type.

  • Level 2 and Level 3 routines acquire an additional parameter of type CBLAS_LAYOUT as their first argument. This parameter specifies whether two-dimensional arrays are row-major (CblasRowMajor) or column-major (CblasColMajor).

Enumerated Types

The CBLAS interface uses the following enumerated types:

   CblasRowMajor=101,  /* row-major arrays */
   CblasColMajor=102};   /* column-major arrays */
   CblasNoTrans=111,     /* trans='N' */
   CblasTrans=112,       /* trans='T' */
   CblasConjTrans=113};  /* trans='C' */
   CblasUpper=121,        /* uplo ='U' */
   CblasLower=122};       /* uplo ='L' */
   CblasNonUnit=131,      /* diag ='N' */
   CblasUnit=132};        /* diag ='U' */
   CblasLeft=141,         /* side ='L' */
   CblasRight=142};       /* side ='R' */
Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.
Seleccione el color del botón adhesivo: 
Orange (only for download buttons)