Overview
Kunpeng Math Library
The Kunpeng Math Library (KML) provides high-performance mathematical functions which are optimized based on the Kunpeng platform. All interfaces are implemented by C/C++ and assembly languages. Some interfaces are encapsulated using Java. Table 1 shows the composition of the KML.
No. |
Library |
Description |
Application Scenario |
|---|---|---|---|
1 |
KML_BLAS |
Based on the Kunpeng architecture, KML_BLAS performs in-depth mining on the computing efficiency of Basic Linear Algebra Subprograms (BLAS) by means of vectorization, data prefetch, compilation optimization, and data rearrangement. As a result, the performance of BLAS interface functions approaches the theoretical peak value. |
Vector-vector operation Vector-matrix operation Matrix-matrix operation |
2 |
KML_SPBLAS |
Sparse Basic Linear Algebra Subprograms (KML_SPBLAS) is a basic linear algebra operation library of sparse matrices. It provides high-performance vector and matrix operations for sparse matrices in compressed format based on the Kunpeng architecture. Based on the instruction set and architecture features of Kunpeng, a high-performance sparse matrix operation library is developed to improve the service performance of HPC and big data solutions. |
Sparse vector-vector operation Sparse vector-matrix operation Sparse matrix-matrix operation |
3 |
KML_VML |
Vector Math Library (KML_VML) performs vectorization on input data by using methods such as NEON instruction optimization and inline assembly. It makes full use of register features in the Kunpeng architecture to improve performance of Kunpeng servers. |
Vector mathematical operations include power functions, trigonometric functions, exponential functions, hyperbolic functions, and logarithmic functions |
4 |
KML_MATH |
KML_MATH is a mathematical library for basic operations. It provides functions with high performance that is based on Kunpeng processors by means of periodic function specifications and algorithm improvement. |
Basic mathematical operations, including trigonometric, logarithmic, exponential, and power functions |
5 |
KML_FFT |
KML_FFT is a math library of fast Fourier transform (FFT). It is the fast computing methods of discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT), and is widely used in the fields of engineering, science, and mathematics. KML_FFT reduces the complexity of Fourier transform calculation from O(n2) to O(n log n), and is listed in the top 10 algorithms of the 20th century by the IEEE Computing in Science & Engineering. |
FFT C2C, C2R, R2C, and R2R transforms |
6 |
KML_LAPACK |
KML_LAPACK optimizes the Linear Algebra PACKage (LAPACK) computing efficiency based on the Kunpeng architecture by means of block division, algorithm combination, multi-thread, and BLAS interface optimization. |
Linear equation system operations, including solving equations, eigenvalue, and singular value problems. |
7 |
KML_SVML |
Short Vector Math Library (KML_SVML) processes input vectors in batches by using methods such as NEON instruction optimization and inline assembly. It makes full use of register features in the Kunpeng architecture to improve performance of Kunpeng servers. |
Vector mathematical operations include power functions, trigonometric functions, exponential functions, hyperbolic functions, and logarithmic functions |
8 |
KML_SOLVER |
An iterative sparse solver library that uses preconditioned conjugate gradient (PCG) and generalized conjugate residual (GCR) methods. KML_SOLVER supports multiple threads on a single node. |
Sparse symmetric positive definite matrix and sparse general matrix linear equations are solved iteratively. |
9 |
KML_JAVA |
A KML math library encapsulated in Java based on the JNI technology. |
BLAS and VML |
KML is available only for Kunpeng processors.
To achieve the optimal performance, the KML interface does not verify all input parameters. The validity of input parameters is ensured by the service that calls the interface.
This document provides the installation guide, detailed interface definition, and sample code of the Kunpeng math library to help users quickly get familiar with KML.