Sparse BLAS Routines¶
The Intel® oneAPI Math Kernel Library provides a C++ with SYCL interface to some of the Sparse BLAS routines. This section describes such Sparse BLAS routines included in the Intel® oneAPI Math Kernel Library (oneMKL).
The Sparse BLAS library provides basic operations on sparse matrices and vectors. The
fundamental object that encompasses the sparse matrix and is which is used in the Sparse BLAS
library is the sparse::matrix_handle_t
. See Sparse BLAS Matrix Handle Contract between User and Library
for a discussion of the way that library APIs will interact with the handle as well as the
usage contract with regards to the matrix handle for both users and the library. The
currently supported sparse matrix formats in the sparse::matrix_handle_t
object can be found in Sparse Storage Formats.
The routines that enable these Sparse BLAS operations can be separated into 4 groups:
State management
routinesAnalysis
routines (also called inspector stage or optimize stage routines)Execution
routinesHelper
routines.
The state management
routines include initialization, destruction and APIs
for setting data, formats and properties in the different sparse objects like the
sparse::matrix_handle_t
or sparse::matmat_descr_t
.
In an analysis
routine, the library inspects the matrix properties including
size, sparsity pattern and available parallelism and can create new data structures
or copies of the user data which applies matrix format or structure changes to enable
a more optimized algorithm for the desired operation. The user data is not changed by
any such analysis or optimizations. The optimizations created in the analysis
routines may be reused by multiple execution
routines to improve performance.
For a given matrix, an analysis
routine would typically be called a single time for
each operation whereas the corresponding execution
routines may be called multiple
times.
The execution
routines are where the actual matrix-matrix, matrix-vector operations
take place and may use the data, optimizations and properties stored in the handle to
perform the desired operation.
The helper
routines operate on the data in the matrix handle and may include
things like data copy/transpose into other handles, sorting of data within a handle,
or eventually, when supported, changes to the sparse matrix format within the handle.
State Management Routines |
Data Types |
Description |
---|---|---|
N/A |
Initialize a |
|
N/A |
Release a |
|
float, double |
Set internal representation of |
|
N/A |
Set special properties of user provided marix data in |
|
N/A |
Initialize a |
|
N/A |
Populate a |
|
N/A |
Query the operation description housed in a |
|
N/A |
Release a |
Analysis Routines |
Data Types |
Description |
---|---|---|
N/A |
Perform internal optimizations for the sparse::gemv operation. |
|
N/A |
Perform internal optimizations for the sparse::trmv operation. |
|
N/A |
Perform internal optimizations for the sparse::trsv operation. |
Execution Routines |
Data Types |
Description |
---|---|---|
float, double |
General sparse matrix-dense vector product |
|
float, double |
General sparse matrix-dense vector product with fused dot product |
|
float, double |
Symmetric sparse matrix-dense vector product |
|
float, double |
Triangular sparse matrix-dense vector product |
|
float, double |
Triangular solve of sparse matrix against a dense vector. |
|
float, double |
General sparse matrix-dense matrix product |
|
float, double |
General sparse matrix-sparse matrix product |
Helper Routines |
Data Types |
Description |
---|---|---|
float, double |
General sparse matrix out-of-place copy/transposition into a new matrix handle |
|
float, double |
General sparse matrix sort of matrix format in matrix handle |