Developer Reference

  • 0.10
  • 10/21/2020
  • Public Content
Contents

Matrix Storage Schemes for BLAS Routines

Matrix arguments of BLAS
and CBLAS
routines can use the following storage schemes:
  • Full storage
    : a matrix
    A
    is stored in a two-dimensional array
    a
    , with the matrix element
    A
    ij
    stored in the array element
    a
    [
    i
    +
    j
    *
    lda
    ]
    for column-major layout and
    a
    [
    j
    +
    i
    *
    lda
    ]
    for row-major layout, where
    lda
    is the leading dimension for the array
    .
  • Packed storage
    scheme allows you to store symmetric, Hermitian, or triangular matrices more compactly
    . For column-major layout, the upper or lower triangle of the matrix is packed by columns in a one dimensional array. For row-major layout, the upper or lower triangle of the matrix is packed by rows in a one dimensional array.
  • Band storage
    : a band matrix is stored compactly in a two-dimensional array.
    For column-major layout, columns of the matrix are stored in the corresponding columns of the array, and diagonals of the matrix are stored in a specific row of the array. For row-major layout, rows of the matrix are stored in the corresponding rows of the array, and diagonals of the matrix are stored in a specific column of the array.
For more information on matrix storage schemes, see Matrix Arguments in
the
Appendix
“Routine and Function Arguments”
.

Row-Major and Column-Major Layout

The BLAS routines follow the Fortran convention of storing two-dimensional arrays using column-major layout. When calling BLAS routines from C, remember that they require arrays to be in column-major format, not the row-major format that is the convention for C.
Unless otherwise specified, the psuedo-code examples for the BLAS routines illustrate matrices stored using column-major layout.
The CBLAS interface allows you to specify either column-major or row-major layout for BLAS Level 2 and Level 3 routines, by setting the
layout
parameter to
CblasColMajor
or
CblasRowMajor
.

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