Rate This Document
Findability
Accuracy
Completeness
Readability

Overview

This document describes how to migrate Intel MKL or some common math libraries to the Kunpeng Math Library to maximize the performance of the Kunpeng platform.

In a broad sense, a math library is a math function interface library that provides high-performance scalar and vector calculation. Common math libraries include Intel Math Kernel Library (Intel MKL for short) and some open-source math libraries. The Kunpeng Math Library (KML) provides high-performance math functions optimized based on the Kunpeng platform. When you migrate an application that uses math library functions to the Kunpeng computing platform, the program needs to be adapted because the function definitions of different computing platforms or math libraries are different. This document is intended to help you solve this problem.

This document describes how to migrate common libraries of Intel MKL to KML, for example, migrating VML of MKL to KML_VML and BLAS of MKL to KML_BLAS (see Checking Whether Intel MKL Is Used). It also describes how to migrate other common libraries to KML (see Replaceability.) Through migration, you can obtain better computing performance than common open source math libraries on the Kunpeng computing platform.

Table 1 shows the mapping between the math libraries before and after the migration.

Table 1 Mapping between math libraries before and after migration

Math Library to be Migrated

KML

Library

Header File

Library

Header File

icc-imf

math.h or mathimf.h

KML_MATH

km.h

MKL-VML

mkl.h or mkl_vml.h

KML_VML

kvml.h

MKL-BLAS

mkl.h or mkl_blas.h

KML_BLAS

kblas.h

MKL-SPBLAS

mkl.h or mkl_spblas.h

KML_SPBLAS

kspblas.h

MKL-FFT

mkl.h or mkl_dfti.h

KML_FFT

kfft.h

MKL-LAPACK

mkl.h or mkl_lapack.h

KML_LAPACK

klapack.h or kservice.h

MKL-SOLVER

mkl.h or mkl_rci.h

KML_SOLVER (iterative solution)

kml_iss.h

MKL PARDISO or PARDISO-cluster

mkl_pardiso.h or mkl_cluster_sparse_solver.h

KML_SOLVER (direct solution)

kml_scadss.h

PETSc

petscksp.h

KML_SOLVER (iterative solution)

kml_iss.h/kml_scaiss.h

MUMPs

dmumps_c.h, smumps_c.h, cmumps_c.h or zmumps_c.h

KML_SOLVER (direct solution)

kml_scadss.h

OpenBLAS

cblas.h

KML_BLAS

kblas.h

FFTW

fftw3.h

KML_FFT

kfft.h

MKL ScaLAPACK

mkl.h or mkl_scalapack.h

KML_SCALAPACK

kscalapack.h, klapack.h or kservice.h