Rate This Document
Findability
Accuracy
Completeness
Readability

Migrating the Basic Linear Algebra Library (BLAS)

Replaceability

The external interfaces provided by KML_BLAS are the same as those provided by MKL-BLAS in terms of interface parameters and function names, and can be directly replaced.

Table 1, Table 2, Table 3, and Table 4 show the mapping between replaceable interfaces and MKL interfaces.

Table 1 Replacement mapping of the Level 1 interfaces

MKL Interface

KML Interface

Data Type

Description

cblas_?asum

cblas_?asum

s, d, c, z

Computes the sum of absolute values of vector elements.

cblas_?axpy

cblas_?axpy

s, d, c, z

Performs vector scaling and addition.

cblas_?copy

cblas_?copy

s, d, c, z

Copies a vector.

cblas_?dot

cblas_?dot

s, d

Computes the dot product of vectors.

cblas_?sdot

cblas_?sdot

d, sd

Computes the dot product with extended precision.

cblas_?dotc_sub

cblas_?dotc_sub

c, z

Computes the dot product of a conjugate vector and another vector.

cblas_?dotu_sub

cblas_?dotu_sub

c, z

Computes the dot product of complex vectors.

cblas_?nrm2

cblas_?nrm2

s, d, sc, dz

Computes the Euclidean norm.

cblas_?rot

cblas_?rot

s, d, cs, zd

Rotates points in a plane.

cblas_?rotg

cblas_?rotg

s, d

Constructs a rotation plane.

cblas_?rotm

cblas_?rotm

s, d

Modifies a rotation plane.

cblas_?rotmg

cblas_?rotmg

s, d

Constructs a modified rotation plane.

cblas_?scal

cblas_?scal

s, d, c, z, cs, zd

Scales a vector.

cblas_?swap

cblas_?swap

s, d, c, z

Swaps elements in two vectors.

cblas_i?amin

cblas_i?amin

s, d, c, z

Finds the index of the element with the minimum absolute value.

cblas_i?amax

cblas_i?amax

s, d, c, z

Finds the index of the element with the maximum absolute value.

Table 2 Replacement mapping of the Level 2 interfaces

MKL Interface

KML Interface

Data Type

Description

cblas_?gbmv

cblas_?gbmv

s, d, c, z

Computes the product of a vector and a band matrix.

cblas_?gemv

cblas_?gemv

s, d, c, z

Computes the product of a vector and a matrix.

cblas_?ger

cblas_?ger

s, d

Performs a rank-1 update of a general matrix.

cblas_?gerc

cblas_?gerc

c, z

Performs a rank-1 update of a complex general matrix.

cblas_?geru

cblas_?geru

c, z

Perform a rank-1 update of a general conjugated matrix.

cblas_?hbmv

cblas_?hbmv

c, z

Computes the product of a vector and a Hermitian band matrix.

cblas_?hemv

cblas_?hemv

c, z

Computes the product of a vector and a Hermitian matrix.

cblas_?her

cblas_?her

c, z

Performs a rank-1 update of a complex Hermitian matrix.

cblas_?her2

cblas_?her2

c, z

Performs a rank-2 update of a complex Hermitian matrix.

cblas_?hpmv

cblas_?hpmv

c, z

Computes the product of a vector and a triangle-expanded Hermitian matrix.

cblas_?hpr

cblas_?hpr

c, z

Performs a rank-1 update of a triangular expanded Hermitian matrix.

cblas_?hpr2

cblas_?hpr2

c, z

Performs a rank-2 update of a triangular expanded Hermitian matrix.

cblas_?sbmv

cblas_?sbmv

s, d

Computes the product of a vector and a symmetric band matrix.

cblas_?spmv

cblas_?spmv

s, d

Computes the product of a vector and a packed symmetric matrix.

cblas_?spr

cblas_?spr

s, d

Performs a rank-1 update of a symmetric expanded matrix.

cblas_?spr2

cblas_?spr2

s, d

Performs a rank-2 update of a symmetric expanded matrix.

cblas_?symv

cblas_?symv

s, d

Computes the product of a vector and a symmetric matrix.

cblas_?syr

cblas_?syr

s, d

Performs a rank 1 update of a symmetric matrix.

cblas_?syr2

cblas_?syr2

s, d

Performs a rank 2 update of a symmetric matrix.

cblas_?tbmv

cblas_?tbmv

s, d, c, z

Computes the product of a vector and a triangular band matrix.

cblas_?tbsv

cblas_?tbsv

s, d, c, z

Solves a linear system of equations with a triangular band matrix.

cblas_?tpmv

cblas_?tpmv

s, d, c, z

Computes the product of a vector and a packed triangular matrix.

cblas_?tpsv

cblas_?tpsv

s, d, c, z

Solves a linear system of equations with a triangular packed matrix.

cblas_?trmv

cblas_?trmv

s, d, c, z

Computes the product of a vector and a triangular matrix.

cblas_?trsv

cblas_?trsv

s, d, c, z

Solves a linear system of equations with a triangular coefficient matrix.

Table 3 Replacement mapping of the Level 3 interfaces

MKL Interface

KML Interface

Data Type

Description

cblas_?gemm

cblas_?gemm

s, d, c, z

Computes the product of a general matrix and a matrix.

cblas_?hemm

cblas_?hemm

c, z

Computes the product of a complex Hermitian matrix and a matrix.

cblas_?her2k

cblas_?her2k

c, z

Performs a rank-2 update of the product of a complex matrix and a matrix. The output matrix C is a complex Hermitian matrix.

cblas_?herk

cblas_?herk

c, z

Performs a rank-k update of the product of a complex matrix and a matrix. The output matrix C is a complex Hermitian matrix.

cblas_?symm

cblas_?symm

s, d, c, z

Computes the product of a symmetric real matrix and a matrix.

cblas_?syrk

cblas_?syrk

s, d

Performs a rank-k update of a matrix-matrix product. The output matrix C is a symmetric matrix.

cblas_?syr2k

cblas_?syr2k

s, d

Performs a rank-2 update of a matrix-matrix product. The output matrix C is a symmetric matrix.

cblas_?trmm

cblas_?trmm

s, d, c, z

Computes a matrix-matrix product where one input matrix is triangular.

cblas_?trsm

cblas_?trsm

s, d, c, z

Solves a triangular matrix equation.

Table 4 Replacement mapping of the extension interfaces

MKL Interface

KML Interface

Data Type

Description

cblas_?axpby

cblas_?axpby

s, d, c, z

Performs vector scaling and addition.

cblas_?gemm3m

cblas_?gemm3m

c, z

Computes the product of a general complex matrix and a matrix.

Migrating the C-based Library

For the interfaces provided by KML_BLAS, replace the BLAS link options of Intel MKL with the KML_BLAS link options during compilation. No other modification is required.

Migrating the Fortran-based Library

See Migrating the C-based Library.

To ensure successful linking when C/C++ and Fortran are used together, add an underscore (_) to the names of the global variables and functions in the C code that exchange information in hybrid programming, or use the compilation option -fno-underscoring. Otherwise, a linking error is reported.