Developer Reference


C Interface Conventions for BLAS Routines

CBLAS, the C interface to the Basic Linear Algebra Subprograms (BLAS), provides a C language interface to BLAS routines for
Intel® oneAPI Math Kernel Library
. 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
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® oneAPI
Math Kernel Library
" in the
Intel® oneAPI
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
(for example,
). Names of all CBLAS functions are in lowercase letters.
Complex functions
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
. For example, the BLAS function
corresponds to
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
  • 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
    as their first argument. This parameter specifies whether two-dimensional arrays are row-major (
    ) or column-major (

Enumerated Types

The CBLAS interface uses the following enumerated types:
enum CBLAS_LAYOUT { CblasRowMajor=101, /* row-major arrays */ CblasColMajor=102}; /* column-major arrays */ enum CBLAS_TRANSPOSE { CblasNoTrans=111, /* trans='N' */ CblasTrans=112, /* trans='T' */ CblasConjTrans=113}; /* trans='C' */ enum CBLAS_UPLO { CblasUpper=121, /* uplo ='U' */ CblasLower=122}; /* uplo ='L' */ enum CBLAS_DIAG { CblasNonUnit=131, /* diag ='N' */ CblasUnit=132}; /* diag ='U' */ enum CBLAS_SIDE { CblasLeft=141, /* side ='L' */ CblasRight=142}; /* side ='R' */

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at