User Manual#
Introduction#
hipSPARSE is a library that contains basic linear algebra subroutines for sparse matrices and vectors written in HIP for GPU devices. It is designed to be used from C and C++ code. The functionality of hipSPARSE is organized in the following categories:
Sparse Auxiliary Functions describe available helper functions that are required for subsequent library calls.
Sparse Level 1 Functions describe operations between a vector in sparse format and a vector in dense format.
Sparse Level 2 Functions describe operations between a matrix in sparse format and a vector in dense format.
Sparse Level 3 Functions describe operations between a matrix in sparse format and multiple vectors in dense format.
Sparse Extra Functions describe operations that manipulate sparse matrices.
Preconditioner Functions describe manipulations on a matrix in sparse format to obtain a preconditioner.
Sparse Conversion Functions describe operations on a matrix in sparse format to obtain a different matrix format.
Sparse Reordering Functions describe operations on a matrix in sparse format to obtain a reordering.
Sparse Generic Functions describe operations that manipulate sparse matrices.
The code is open and hosted here: ROCmSoftwarePlatform/hipSPARSE
hipSPARSE is a SPARSE marshalling library, with multiple supported backends. It sits between the application and a worker SPARSE library, marshalling inputs into the backend library and marshalling results back to the application. hipSPARSE exports an interface that does not require the client to change, regardless of the chosen backend. Currently, hipSPARSE supports rocSPARSE and cuSPARSE as backends. hipSPARSE focuses on convenience and portability. If performance outweighs these factors, then using rocSPARSE itself is highly recommended. rocSPARSE can also be found on GitHub.
Building and Installing#
Prerequisites#
hipSPARSE requires a ROCm enabled platform, more information here.
Installing pre-built packages#
hipSPARSE can be installed from AMD ROCm repository. For detailed instructions on how to set up ROCm on different platforms, see the AMD ROCm Platform Installation Guide for Linux.
hipSPARSE can be installed on e.g. Ubuntu using
$ sudo apt-get update
$ sudo apt-get install hipsparse
Once installed, hipSPARSE can be used just like any other library with a C API. The header file will need to be included in the user code in order to make calls into hipSPARSE, and the hipSPARSE shared library will become link-time and run-time dependent for the user application.
Building hipSPARSE from source#
Building from source is not necessary, as hipSPARSE can be used after installing the pre-built packages as described above. If desired, the following instructions can be used to build hipSPARSE from source. Furthermore, the following compile-time dependencies must be met
CMake 3.5 or later
googletest (optional, for clients)
Download hipSPARSE#
The hipSPARSE source code is available at the hipSPARSE GitHub page. Download the master branch using:
$ git clone -b master https://github.com/ROCmSoftwarePlatform/hipSPARSE.git
$ cd hipSPARSE
Below are steps to build different packages of the library, including dependencies and clients. It is recommended to install hipSPARSE using the install.sh script.
Using install.sh to build hipSPARSE with dependencies#
The following table lists common uses of install.sh to build dependencies + library.
Command |
Description |
---|---|
./install.sh -h |
Print help information. |
./install.sh -d |
Build dependencies and library in your local directory. The -d flag only needs to be used once. For subsequent invocations of install.sh it is not necessary to rebuild the dependencies. |
./install.sh |
Build library in your local directory. It is assumed dependencies are available. |
./install.sh -i |
Build library, then build and install hipSPARSE package in /opt/rocm/hipsparse. You will be prompted for sudo access. This will install for all users. |
Using install.sh to build hipSPARSE with dependencies and clients#
The client contains example code and unit tests. Common uses of install.sh to build them are listed in the table below.
Command |
Description |
---|---|
./install.sh -h |
Print help information. |
./install.sh -dc |
Build dependencies, library and client in your local directory. The -d flag only needs to be used once. For subsequent invocations of install.sh it is not necessary to rebuild the dependencies. |
./install.sh -c |
Build library and client in your local directory. It is assumed dependencies are available. |
./install.sh -idc |
Build library, dependencies and client, then build and install hipSPARSE package in /opt/rocm/hipsparse. You will be prompted for sudo access. This will install for all users. |
./install.sh -ic |
Build library and client, then build and install hipSPARSE package in opt/rocm/hipsparse. You will be prompted for sudo access. This will install for all users. |
Using individual commands to build hipSPARSE#
CMake 3.5 or later is required in order to build hipSPARSE.
hipSPARSE can be built using the following commands:
# Create and change to build directory
$ mkdir -p build/release ; cd build/release
# Default install path is /opt/rocm, use -DCMAKE_INSTALL_PREFIX=<path> to adjust it
$ cmake ../..
# Compile hipSPARSE library
$ make -j$(nproc)
# Install hipSPARSE to /opt/rocm
$ make install
GoogleTest is required in order to build hipSPARSE clients.
hipSPARSE with dependencies and clients can be built using the following commands:
# Install googletest
$ mkdir -p build/release/deps ; cd build/release/deps
$ cmake ../../../deps
$ make -j$(nproc) install
# Change to build directory
$ cd ..
# Default install path is /opt/rocm, use -DCMAKE_INSTALL_PREFIX=<path> to adjust it
$ cmake ../.. -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_SAMPLES=ON
# Compile hipSPARSE library
$ make -j$(nproc)
# Install hipSPARSE to /opt/rocm
$ make install
Simple Test#
You can test the installation by running one of the hipSPARSE examples, after successfully compiling the library with clients.
# Navigate to clients binary directory
$ cd hipSPARSE/build/release/clients/staging
# Execute hipSPARSE example
$ ./example_csrmv 1000
Supported Targets#
Currently, hipSPARSE is supported under the following operating systems
To compile and run hipSPARSE, AMD ROCm Platform is required.
Device and Stream Management#
hipSetDevice()
and hipGetDevice()
are HIP device management APIs.
They are NOT part of the hipSPARSE API.
Asynchronous Execution#
All hipSPARSE library functions, unless otherwise stated, are non blocking and executed asynchronously with respect to the host. They may return before the actual computation has finished. To force synchronization, hipDeviceSynchronize()
or hipStreamSynchronize()
can be used. This will ensure that all previously executed hipSPARSE functions on the device / this particular stream have completed.
HIP Device Management#
Before a HIP kernel invocation, users need to call hipSetDevice()
to set a device, e.g. device 1. If users do not explicitly call it, the system by default sets it as device 0. Unless users explicitly call hipSetDevice()
to set to another device, their HIP kernels are always launched on device 0.
The above is a HIP (and CUDA) device management approach and has nothing to do with hipSPARSE. hipSPARSE honors the approach above and assumes users have already set the device before a hipSPARSE routine call.
Once users set the device, they create a handle with hipsparseCreate().
Subsequent hipSPARSE routines take this handle as an input parameter. hipSPARSE ONLY queries (by hipGetDevice()
) the user’s device; hipSPARSE does NOT set the device for users. If hipSPARSE does not see a valid device, it returns an error message. It is the users’ responsibility to provide a valid device to hipSPARSE and ensure the device safety.
Users CANNOT switch devices between hipsparseCreate() and hipsparseDestroy(). If users want to change device, they must destroy the current handle and create another hipSPARSE handle.
HIP Stream Management#
HIP kernels are always launched in a queue (also known as stream).
If users do not explicitly specify a stream, the system provides a default stream, maintained by the system. Users cannot create or destroy the default stream. However, users can freely create new streams (with hipStreamCreate()
) and bind it to the hipSPARSE handle using hipsparseSetStream(). HIP kernels are invoked in hipSPARSE routines. The hipSPARSE handle is always associated with a stream, and hipSPARSE passes its stream to the kernels inside the routine. One hipSPARSE routine only takes one stream in a single invocation. If users create a stream, they are responsible for destroying it.
Multiple Streams and Multiple Devices#
If the system under test has multiple HIP devices, users can run multiple hipSPARSE handles concurrently, but can NOT run a single hipSPARSE handle on different discrete devices. Each handle is associated with a particular singular device, and a new handle should be created for each additional device.
Storage Formats#
COO storage format#
The Coordinate (COO) storage format represents a \(m \times n\) matrix by
m |
number of rows (integer). |
n |
number of columns (integer). |
nnz |
number of non-zero elements (integer). |
coo_val |
array of |
coo_row_ind |
array of |
coo_col_ind |
array of |
The COO matrix is expected to be sorted by row indices and column indices per row. Furthermore, each pair of indices should appear only once. Consider the following \(3 \times 5\) matrix and the corresponding COO structures, with \(m = 3, n = 5\) and \(\text{nnz} = 8\) using zero based indexing:
where
COO (AoS) storage format#
The Coordinate (COO) Array of Structure (AoS) storage format represents a \(m \times n\) matrix by
m |
number of rows (integer). |
n |
number of columns (integer). |
nnz |
number of non-zero elements (integer). |
coo_val |
array of |
coo_ind |
array of |
The COO (AoS) matrix is expected to be sorted by row indices and column indices per row. Furthermore, each pair of indices should appear only once. Consider the following \(3 \times 5\) matrix and the corresponding COO (AoS) structures, with \(m = 3, n = 5\) and \(\text{nnz} = 8\) using zero based indexing:
where
CSR storage format#
The Compressed Sparse Row (CSR) storage format represents a \(m \times n\) matrix by
m |
number of rows (integer). |
n |
number of columns (integer). |
nnz |
number of non-zero elements (integer). |
csr_val |
array of |
csr_row_ptr |
array of |
csr_col_ind |
array of |
The CSR matrix is expected to be sorted by column indices within each row. Furthermore, each pair of indices should appear only once. Consider the following \(3 \times 5\) matrix and the corresponding CSR structures, with \(m = 3, n = 5\) and \(\text{nnz} = 8\) using one based indexing:
where
BSR storage format#
The Block Compressed Sparse Row (BSR) storage format represents a \((mb \cdot \text{bsr_dim}) \times (nb \cdot \text{bsr_dim})\) matrix by
mb |
number of block rows (integer) |
nb |
number of block columns (integer) |
nnzb |
number of non-zero blocks (integer) |
bsr_val |
array of |
bsr_row_ptr |
array of |
bsr_col_ind |
array of |
bsr_dim |
dimension of each block (integer). |
The BSR matrix is expected to be sorted by column indices within each row. If \(m\) or \(n\) are not evenly divisible by the block dimension, then zeros are padded to the matrix, such that \(mb = (m + \text{bsr_dim} - 1) / \text{bsr_dim}\) and \(nb = (n + \text{bsr_dim} - 1) / \text{bsr_dim}\). Consider the following \(4 \times 3\) matrix and the corresponding BSR structures, with \(\text{bsr_dim} = 2, mb = 2, nb = 2\) and \(\text{nnzb} = 4\) using zero based indexing and column-major storage:
with the blocks \(A_{ij}\)
such that
with arrays representation
GEBSR storage format#
The General Block Compressed Sparse Row (GEBSR) storage format represents a \((mb \cdot \text{bsr_row_dim}) \times (nb \cdot \text{bsr_col_dim})\) matrix by
mb |
number of block rows (integer) |
nb |
number of block columns (integer) |
nnzb |
number of non-zero blocks (integer) |
bsr_val |
array of |
bsr_row_ptr |
array of |
bsr_col_ind |
array of |
bsr_row_dim |
row dimension of each block (integer). |
bsr_col_dim |
column dimension of each block (integer). |
The GEBSR matrix is expected to be sorted by column indices within each row. If \(m\) is not evenly divisible by the row block dimension or \(n\) is not evenly divisible by the column block dimension, then zeros are padded to the matrix, such that \(mb = (m + \text{bsr_row_dim} - 1) / \text{bsr_row_dim}\) and \(nb = (n + \text{bsr_col_dim} - 1) / \text{bsr_col_dim}\). Consider the following \(4 \times 5\) matrix and the corresponding GEBSR structures, with \(\text{bsr_row_dim} = 2\), \(\text{bsr_col_dim} = 3\), mb = 2, nb = 2` and \(\text{nnzb} = 4\) using zero based indexing and column-major storage:
with the blocks \(A_{ij}\)
such that
with arrays representation
ELL storage format#
The Ellpack-Itpack (ELL) storage format represents a \(m \times n\) matrix by
m |
number of rows (integer). |
n |
number of columns (integer). |
ell_width |
maximum number of non-zero elements per row (integer) |
ell_val |
array of |
ell_col_ind |
array of |
The ELL matrix is assumed to be stored in column-major format. Rows with less than ell_width
non-zero elements are padded with zeros (ell_val
) and \(-1\) (ell_col_ind
).
Consider the following \(3 \times 5\) matrix and the corresponding ELL structures, with \(m = 3, n = 5\) and \(\text{ell_width} = 3\) using zero based indexing:
where
HYB storage format#
The Hybrid (HYB) storage format represents a \(m \times n\) matrix by
m |
number of rows (integer). |
n |
number of columns (integer). |
nnz |
number of non-zero elements of the COO part (integer) |
ell_width |
maximum number of non-zero elements per row of the ELL part (integer) |
ell_val |
array of |
ell_col_ind |
array of |
coo_val |
array of |
coo_row_ind |
array of |
coo_col_ind |
array of |
The HYB format is a combination of the ELL and COO sparse matrix formats. Typically, the regular part of the matrix is stored in ELL storage format, and the irregular part of the matrix is stored in COO storage format. Three different partitioning schemes can be applied when converting a CSR matrix to a matrix in HYB storage format. For further details on the partitioning schemes, see hipsparseHybPartition_t.
Types#
hipsparseHandle_t#
-
typedef void *hipsparseHandle_t#
Handle to the hipSPARSE library context queue.
The hipSPARSE handle is a structure holding the hipSPARSE library context. It must be initialized using hipsparseCreate() and the returned handle must be passed to all subsequent library function calls. It should be destroyed at the end using hipsparseDestroy().
hipsparseMatDescr_t#
-
typedef void *hipsparseMatDescr_t#
Descriptor of the matrix.
The hipSPARSE matrix descriptor is a structure holding all properties of a matrix. It must be initialized using hipsparseCreateMatDescr() and the returned descriptor must be passed to all subsequent library calls that involve the matrix. It should be destroyed at the end using hipsparseDestroyMatDescr().
hipsparseHybMat_t#
-
typedef void *hipsparseHybMat_t#
HYB matrix storage format.
The hipSPARSE HYB matrix structure holds the HYB matrix. It must be initialized using hipsparseCreateHybMat() and the returned HYB matrix must be passed to all subsequent library calls that involve the matrix. It should be destroyed at the end using hipsparseDestroyHybMat().
For more details on the HYB format, see HYB storage format.
hipsparseColorInfo_t#
-
typedef void *hipsparseColorInfo_t#
Coloring info.
The hipSPARSE ColorInfo structure holds the coloring information. It must be initialized using hipsparseCreateColorInfo() and the returned structure must be passed to all subsequent library calls that involve the coloring. It should be destroyed at the end using hipsparseDestroyColorInfo().
bsrsv2Info_t#
-
typedef struct bsrsv2Info *bsrsv2Info_t#
bsrsm2Info_t#
-
typedef struct bsrsm2Info *bsrsm2Info_t#
bsrilu02Info_t#
-
typedef struct bsrilu02Info *bsrilu02Info_t#
bsric02Info_t#
-
typedef struct bsric02Info *bsric02Info_t#
csrsv2Info_t#
-
typedef struct csrsv2Info *csrsv2Info_t#
csrsm2Info_t#
-
typedef struct csrsm2Info *csrsm2Info_t#
csrilu02Info_t#
-
typedef struct csrilu02Info *csrilu02Info_t#
csric02Info_t#
-
typedef struct csric02Info *csric02Info_t#
csrgemm2Info_t#
-
typedef struct csrgemm2Info *csrgemm2Info_t#
pruneInfo_t#
-
typedef struct pruneInfo *pruneInfo_t#
csru2csrInfo_t#
-
typedef struct csru2csrInfo *csru2csrInfo_t#
hipsparseSpVecDescr_t#
-
typedef void *hipsparseSpVecDescr_t#
hipsparseSpMatDescr_t#
-
typedef void *hipsparseSpMatDescr_t#
hipsparseDnVecDescr_t#
-
typedef void *hipsparseDnVecDescr_t#
hipsparseDnMatDescr_t#
-
typedef void *hipsparseDnMatDescr_t#
hipsparseSpGEMMDescr_t#
-
typedef struct hipsparseSpGEMMDescr *hipsparseSpGEMMDescr_t#
hipsparseSpSVDescr_t#
-
typedef struct hipsparseSpSVDescr *hipsparseSpSVDescr_t#
hipsparseSpSMDescr_t#
-
typedef struct hipsparseSpSMDescr *hipsparseSpSMDescr_t#
hipsparseStatus_t#
-
enum hipsparseStatus_t#
List of hipsparse status codes definition.
This is a list of the hipsparseStatus_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_STATUS_SUCCESS#
Function succeeds
-
enumerator HIPSPARSE_STATUS_NOT_INITIALIZED#
hipSPARSE was not initialized
-
enumerator HIPSPARSE_STATUS_ALLOC_FAILED#
Resource allocation failed
-
enumerator HIPSPARSE_STATUS_INVALID_VALUE#
Unsupported value was passed to the function
-
enumerator HIPSPARSE_STATUS_ARCH_MISMATCH#
Device architecture not supported
-
enumerator HIPSPARSE_STATUS_MAPPING_ERROR#
Access to GPU memory space failed
-
enumerator HIPSPARSE_STATUS_EXECUTION_FAILED#
GPU program failed to execute
-
enumerator HIPSPARSE_STATUS_INTERNAL_ERROR#
An internal hipSPARSE operation failed
-
enumerator HIPSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED#
Matrix type not supported
-
enumerator HIPSPARSE_STATUS_ZERO_PIVOT#
Zero pivot was computed
-
enumerator HIPSPARSE_STATUS_NOT_SUPPORTED#
Operation is not supported
-
enumerator HIPSPARSE_STATUS_INSUFFICIENT_RESOURCES#
Resources are insufficient
-
enumerator HIPSPARSE_STATUS_SUCCESS#
hipsparsePointerMode_t#
-
enum hipsparsePointerMode_t#
Indicates if the pointer is device pointer or host pointer.
The hipsparsePointerMode_t indicates whether scalar values are passed by reference on the host or device. The hipsparsePointerMode_t can be changed by hipsparseSetPointerMode(). The currently used pointer mode can be obtained by hipsparseGetPointerMode().
Values:
-
enumerator HIPSPARSE_POINTER_MODE_HOST#
Scalar pointers are in host memory
-
enumerator HIPSPARSE_POINTER_MODE_DEVICE#
Scalar pointers are in device memory
-
enumerator HIPSPARSE_POINTER_MODE_HOST#
hipsparseAction_t#
-
enum hipsparseAction_t#
Specify where the operation is performed on.
The hipsparseAction_t indicates whether the operation is performed on the full matrix, or only on the sparsity pattern of the matrix.
Values:
-
enumerator HIPSPARSE_ACTION_SYMBOLIC#
Operate only on indices
-
enumerator HIPSPARSE_ACTION_NUMERIC#
Operate on data and indices
-
enumerator HIPSPARSE_ACTION_SYMBOLIC#
hipsparseMatrixType_t#
-
enum hipsparseMatrixType_t#
Specify the matrix type.
The hipsparseMatrixType_t indices the type of a matrix. For a given hipsparseMatDescr_t, the hipsparseMatrixType_t can be set using hipsparseSetMatType(). The current hipsparseMatrixType_t of a matrix can be obtained by hipsparseGetMatType().
Values:
-
enumerator HIPSPARSE_MATRIX_TYPE_GENERAL#
General matrix type
-
enumerator HIPSPARSE_MATRIX_TYPE_SYMMETRIC#
Symmetric matrix type
-
enumerator HIPSPARSE_MATRIX_TYPE_HERMITIAN#
Hermitian matrix type
-
enumerator HIPSPARSE_MATRIX_TYPE_TRIANGULAR#
Triangular matrix type
-
enumerator HIPSPARSE_MATRIX_TYPE_GENERAL#
hipsparseFillMode_t#
-
enum hipsparseFillMode_t#
Specify the matrix fill mode.
The hipsparseFillMode_t indicates whether the lower or the upper part is stored in a sparse triangular matrix. For a given hipsparseMatDescr_t, the hipsparseFillMode_t can be set using hipsparseSetMatFillMode(). The current hipsparseFillMode_t of a matrix can be obtained by hipsparseGetMatFillMode().
Values:
-
enumerator HIPSPARSE_FILL_MODE_LOWER#
Lower triangular part is stored
-
enumerator HIPSPARSE_FILL_MODE_UPPER#
Upper triangular part is stored
-
enumerator HIPSPARSE_FILL_MODE_LOWER#
hipsparseDiagType_t#
-
enum hipsparseDiagType_t#
Indicates if the diagonal entries are unity.
The hipsparseDiagType_t indicates whether the diagonal entries of a matrix are unity or not. If HIPSPARSE_DIAG_TYPE_UNIT is specified, all present diagonal values will be ignored. For a given hipsparseMatDescr_t, the hipsparseDiagType_t can be set using hipsparseSetMatDiagType(). The current hipsparseDiagType_t of a matrix can be obtained by hipsparseGetMatDiagType().
Values:
-
enumerator HIPSPARSE_DIAG_TYPE_NON_UNIT#
Diagonal entries are non-unity
-
enumerator HIPSPARSE_DIAG_TYPE_UNIT#
Diagonal entries are unity
-
enumerator HIPSPARSE_DIAG_TYPE_NON_UNIT#
hipsparseIndexBase_t#
-
enum hipsparseIndexBase_t#
Specify the matrix index base.
The hipsparseIndexBase_t indicates the index base of the indices. For a given hipsparseMatDescr_t, the hipsparseIndexBase_t can be set using hipsparseSetMatIndexBase(). The current hipsparseIndexBase_t of a matrix can be obtained by hipsparseGetMatIndexBase().
Values:
-
enumerator HIPSPARSE_INDEX_BASE_ZERO#
Zero based indexing
-
enumerator HIPSPARSE_INDEX_BASE_ONE#
One based indexing
-
enumerator HIPSPARSE_INDEX_BASE_ZERO#
hipsparseOperation_t#
-
enum hipsparseOperation_t#
Specify whether the matrix is to be transposed or not.
The hipsparseOperation_t indicates the operation performed with the given matrix.
Values:
-
enumerator HIPSPARSE_OPERATION_NON_TRANSPOSE#
Operate with matrix
-
enumerator HIPSPARSE_OPERATION_TRANSPOSE#
Operate with transpose
-
enumerator HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE#
Operate with conj. transpose
-
enumerator HIPSPARSE_OPERATION_NON_TRANSPOSE#
hipsparseHybPartition_t#
-
enum hipsparseHybPartition_t#
HYB matrix partitioning type.
The hipsparseHybPartition_t type indicates how the hybrid format partitioning between COO and ELL storage formats is performed.
Values:
-
enumerator HIPSPARSE_HYB_PARTITION_AUTO#
Automatically decide on ELL nnz per row
-
enumerator HIPSPARSE_HYB_PARTITION_USER#
User given ELL nnz per row
-
enumerator HIPSPARSE_HYB_PARTITION_MAX#
Max ELL nnz per row, no COO part
-
enumerator HIPSPARSE_HYB_PARTITION_AUTO#
hipsparseSolvePolicy_t#
-
enum hipsparseSolvePolicy_t#
Specify policy in triangular solvers and factorizations.
The hipsparseSolvePolicy_t type indicates the solve policy for the triangular solve.
Values:
-
enumerator HIPSPARSE_SOLVE_POLICY_NO_LEVEL#
No level information generated
-
enumerator HIPSPARSE_SOLVE_POLICY_USE_LEVEL#
Generate level information
-
enumerator HIPSPARSE_SOLVE_POLICY_NO_LEVEL#
hipsparseSideMode_t#
hipsparseDirection_t#
-
enum hipsparseDirection_t#
Specify the matrix direction.
The hipsparseDirection_t indicates whether a dense matrix should be parsed by rows or by columns, assuming column-major storage.
Values:
-
enumerator HIPSPARSE_DIRECTION_ROW#
Parse the matrix by rows
-
enumerator HIPSPARSE_DIRECTION_COLUMN#
Parse the matrix by columns
-
enumerator HIPSPARSE_DIRECTION_ROW#
hipsparseFormat_t#
-
enum hipsparseFormat_t#
List of hipsparse sparse matrix formats.
This is a list of the hipsparseFormat_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_FORMAT_CSR#
-
enumerator HIPSPARSE_FORMAT_CSC#
-
enumerator HIPSPARSE_FORMAT_COO#
-
enumerator HIPSPARSE_FORMAT_COO_AOS#
-
enumerator HIPSPARSE_FORMAT_BLOCKED_ELL#
-
enumerator HIPSPARSE_FORMAT_CSR#
hipsparseOrder_t#
-
enum hipsparseOrder_t#
List of hipsparse dense matrix memory layout ordering.
This is a list of the hipsparseOrder_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_ORDER_ROW#
Row major
-
enumerator HIPSPARSE_DEPRECATED_MSG#
Column major
-
enumerator HIPSPARSE_ORDER_COL#
Column major
-
enumerator HIPSPARSE_ORDER_ROW#
hipsparseIndextype_t#
-
enum hipsparseIndexType_t#
List of hipsparse index type used by sparse matrix indices.
This is a list of the hipsparseIndexType_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_INDEX_16U#
16 bit unsigned integer indices
-
enumerator HIPSPARSE_INDEX_32I#
32 bit signed integer indices
-
enumerator HIPSPARSE_INDEX_64I#
64 bit signed integer indices
-
enumerator HIPSPARSE_INDEX_16U#
hipsparseCsr2CscAlg_t#
hipsparseSpMVAlg_t#
-
enum hipsparseSpMVAlg_t#
List of hipsparse SpMV algorithms.
This is a list of the hipsparseSpMVAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_MV_ALG_DEFAULT#
-
enumerator HIPSPARSE_COOMV_ALG#
-
enumerator HIPSPARSE_CSRMV_ALG1#
-
enumerator HIPSPARSE_CSRMV_ALG2#
-
enumerator HIPSPARSE_SPMV_ALG_DEFAULT#
-
enumerator HIPSPARSE_SPMV_COO_ALG1#
-
enumerator HIPSPARSE_SPMV_COO_ALG2#
-
enumerator HIPSPARSE_SPMV_CSR_ALG1#
-
enumerator HIPSPARSE_SPMV_CSR_ALG2#
-
enumerator HIPSPARSE_MV_ALG_DEFAULT#
hipsparseSpMMAlg_t#
-
enum hipsparseSpMMAlg_t#
List of hipsparse SpMM algorithms.
This is a list of the hipsparseSpMMAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_MM_ALG_DEFAULT#
-
enumerator HIPSPARSE_COOMM_ALG1#
-
enumerator HIPSPARSE_COOMM_ALG2#
-
enumerator HIPSPARSE_COOMM_ALG3#
-
enumerator HIPSPARSE_CSRMM_ALG1#
-
enumerator HIPSPARSE_SPMM_ALG_DEFAULT#
-
enumerator HIPSPARSE_SPMM_COO_ALG1#
-
enumerator HIPSPARSE_SPMM_COO_ALG2#
-
enumerator HIPSPARSE_SPMM_COO_ALG3#
-
enumerator HIPSPARSE_SPMM_COO_ALG4#
-
enumerator HIPSPARSE_SPMM_CSR_ALG1#
-
enumerator HIPSPARSE_SPMM_CSR_ALG2#
-
enumerator HIPSPARSE_SPMM_BLOCKED_ELL_ALG1#
-
enumerator HIPSPARSE_SPMM_CSR_ALG3#
-
enumerator HIPSPARSE_MM_ALG_DEFAULT#
hipsparseSparseToDenseAlg_t#
-
enum hipsparseSparseToDenseAlg_t#
List of hipsparse SparseToDense algorithms.
This is a list of the hipsparseSparseToDenseAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SPARSETODENSE_ALG_DEFAULT#
-
enumerator HIPSPARSE_SPARSETODENSE_ALG_DEFAULT#
hipsparseDenseToSparseAlg_t#
-
enum hipsparseDenseToSparseAlg_t#
List of hipsparse DenseToSparse algorithms.
This is a list of the hipsparseDenseToSparseAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_DENSETOSPARSE_ALG_DEFAULT#
-
enumerator HIPSPARSE_DENSETOSPARSE_ALG_DEFAULT#
hipsparseSDDMMAlg_t#
-
enum hipsparseSDDMMAlg_t#
List of hipsparse SDDMM algorithms.
This is a list of the hipsparseSDDMMAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SDDMM_ALG_DEFAULT#
-
enumerator HIPSPARSE_SDDMM_ALG_DEFAULT#
hipsparseSpSVAlg_t#
-
enum hipsparseSpSVAlg_t#
List of hipsparse SpSV algorithms.
This is a list of the hipsparseSpSVAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SPSV_ALG_DEFAULT#
-
enumerator HIPSPARSE_SPSV_ALG_DEFAULT#
hipsparseSpSMAlg_t#
-
enum hipsparseSpSMAlg_t#
List of hipsparse SpSM algorithms.
This is a list of the hipsparseSpSMAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SPSM_ALG_DEFAULT#
-
enumerator HIPSPARSE_SPSM_ALG_DEFAULT#
hipsparseSpMatAttribute_t#
-
enum hipsparseSpMatAttribute_t#
List of hipsparse attributes.
This is a list of the hipsparseSpMatAttribute_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SPMAT_FILL_MODE#
Fill mode attribute
-
enumerator HIPSPARSE_SPMAT_DIAG_TYPE#
Diag type attribute
-
enumerator HIPSPARSE_SPMAT_FILL_MODE#
hipsparseSpGEMMAlg_t#
-
enum hipsparseSpGEMMAlg_t#
List of hipsparse SpGEMM algorithms.
This is a list of the hipsparseSpGEMMAlg_t types that are used by the hipSPARSE library.
Values:
-
enumerator HIPSPARSE_SPGEMM_DEFAULT#
-
enumerator HIPSPARSE_SPGEMM_CSR_ALG_NONDETERMINISTIC#
-
enumerator HIPSPARSE_SPGEMM_CSR_ALG_DETERMINISTIC#
-
enumerator HIPSPARSE_SPGEMM_DEFAULT#
Exported Sparse Functions#
Auxiliary Functions#
Function name |
Sparse Level 1 Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
|||
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
|||
x |
x |
x |
x |
Sparse Level 2 Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
|
x |
x |
x |
x |
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Sparse Level 3 Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Sparse Extra Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Preconditioner Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Conversion Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
|||
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Reordering Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
Sparse Generic Functions#
Function name |
single |
double |
single complex |
double complex |
---|---|---|---|---|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
|
x |
x |
x |
x |
Storage schemes and indexing base#
hipSPARSE supports 0 and 1 based indexing.
The index base is selected by the hipsparseIndexBase_t
type which is either passed as standalone parameter or as part of the hipsparseMatDescr_t
type.
Furthermore, dense vectors are represented with a 1D array, stored linearly in memory. Sparse vectors are represented by a 1D data array stored linearly in memory that hold all non-zero elements and a 1D indexing array stored linearly in memory that hold the positions of the corresponding non-zero elements.
Pointer mode#
The auxiliary functions hipsparseSetPointerMode()
and hipsparseGetPointerMode()
are used to set and get the value of the state variable hipsparsePointerMode_t
.
If hipsparsePointerMode_t
is equal to HIPSPARSE_POINTER_MODE_HOST
, then scalar parameters must be allocated on the host.
If hipsparsePointerMode_t
is equal to HIPSPARSE_POINTER_MODE_DEVICE
, then scalar parameters must be allocated on the device.
There are two types of scalar parameter:
Scaling parameters, such as alpha and beta used in e.g.
hipsparseScsrmv()
,hipsparseSbsrmv()
, …Scalar results from functions such as
hipsparseSdoti()
,hipsparseCdotci()
, …
For scalar parameters such as alpha and beta, memory can be allocated on the host heap or stack, when hipsparsePointerMode_t
is equal to HIPSPARSE_POINTER_MODE_HOST
.
The kernel launch is asynchronous, and if the scalar parameter is on the heap, it can be freed after the return from the kernel launch.
When hipsparsePointerMode_t
is equal to HIPSPARSE_POINTER_MODE_DEVICE
, the scalar parameter must not be changed till the kernel completes.
For scalar results, when hipsparsePointerMode_t
is equal to HIPSPARSE_POINTER_MODE_HOST
, the function blocks the CPU till the GPU has copied the result back to the host.
Using hipsparsePointerMode_t
equal to HIPSPARSE_POINTER_MODE_DEVICE
, the function will return after the asynchronous launch.
Similarly to vector and matrix results, the scalar result is only available when the kernel has completed execution.
Asynchronous API#
Except a functions having memory allocation inside preventing asynchronicity, all hipSPARSE functions are configured to operate in non-blocking fashion with respect to CPU, meaning these library functions return immediately.
Sparse Auxiliary Functions#
This module holds all sparse auxiliary functions.
The functions that are contained in the auxiliary module describe all available helper functions that are required for subsequent library calls.
hipsparseCreate()#
-
hipsparseStatus_t hipsparseCreate(hipsparseHandle_t *handle)#
Create a hipsparse handle.
hipsparseCreate
creates the hipSPARSE library context. It must be initialized before any other hipSPARSE API function is invoked and must be passed to all subsequent library function calls. The handle should be destroyed at the end using hipsparseDestroy().
hipsparseDestroy()#
-
hipsparseStatus_t hipsparseDestroy(hipsparseHandle_t handle)#
Destroy a hipsparse handle.
hipsparseDestroy
destroys the hipSPARSE library context and releases all resources used by the hipSPARSE library.
hipsparseGetVersion()#
-
hipsparseStatus_t hipsparseGetVersion(hipsparseHandle_t handle, int *version)#
Get hipSPARSE version.
hipsparseGetVersion
gets the hipSPARSE library version number.patch = version % 100
minor = version / 100 % 1000
major = version / 100000
hipsparseGetGitRevision()#
-
hipsparseStatus_t hipsparseGetGitRevision(hipsparseHandle_t handle, char *rev)#
Get hipSPARSE git revision.
hipsparseGetGitRevision
gets the hipSPARSE library git commit revision (SHA-1).
hipsparseSetStream()#
-
hipsparseStatus_t hipsparseSetStream(hipsparseHandle_t handle, hipStream_t streamId)#
Specify user defined HIP stream.
hipsparseSetStream
specifies the stream to be used by the hipSPARSE library context and all subsequent function calls.
hipsparseGetStream()#
-
hipsparseStatus_t hipsparseGetStream(hipsparseHandle_t handle, hipStream_t *streamId)#
Get current stream from library context.
hipsparseGetStream
gets the hipSPARSE library context stream which is currently used for all subsequent function calls.
hipsparseSetPointerMode()#
-
hipsparseStatus_t hipsparseSetPointerMode(hipsparseHandle_t handle, hipsparsePointerMode_t mode)#
Specify pointer mode.
hipsparseSetPointerMode
specifies the pointer mode to be used by the hipSPARSE library context and all subsequent function calls. By default, all values are passed by reference on the host. Valid pointer modes are HIPSPARSE_POINTER_MODE_HOST or HIPSPARSE_POINTER_MODE_DEVICE.
hipsparseGetPointerMode()#
-
hipsparseStatus_t hipsparseGetPointerMode(hipsparseHandle_t handle, hipsparsePointerMode_t *mode)#
Get current pointer mode from library context.
hipsparseGetPointerMode
gets the hipSPARSE library context pointer mode which is currently used for all subsequent function calls.
hipsparseCreateMatDescr()#
-
hipsparseStatus_t hipsparseCreateMatDescr(hipsparseMatDescr_t *descrA)#
Create a matrix descriptor.
hipsparseCreateMatDescr
creates a matrix descriptor. It initializes hipsparseMatrixType_t to HIPSPARSE_MATRIX_TYPE_GENERAL and hipsparseIndexBase_t to HIPSPARSE_INDEX_BASE_ZERO. It should be destroyed at the end using hipsparseDestroyMatDescr().
hipsparseDestroyMatDescr()#
-
hipsparseStatus_t hipsparseDestroyMatDescr(hipsparseMatDescr_t descrA)#
Destroy a matrix descriptor.
hipsparseDestroyMatDescr
destroys a matrix descriptor and releases all resources used by the descriptor.
hipsparseCopyMatDescr()#
-
hipsparseStatus_t hipsparseCopyMatDescr(hipsparseMatDescr_t dest, const hipsparseMatDescr_t src)#
Copy a matrix descriptor.
hipsparseCopyMatDescr
copies a matrix descriptor. Both, source and destination matrix descriptors must be initialized prior to callinghipsparseCopyMatDescr
.
hipsparseSetMatType()#
-
hipsparseStatus_t hipsparseSetMatType(hipsparseMatDescr_t descrA, hipsparseMatrixType_t type)#
Specify the matrix type of a matrix descriptor.
hipsparseSetMatType
sets the matrix type of a matrix descriptor. Valid matrix types are HIPSPARSE_MATRIX_TYPE_GENERAL, HIPSPARSE_MATRIX_TYPE_SYMMETRIC, HIPSPARSE_MATRIX_TYPE_HERMITIAN or HIPSPARSE_MATRIX_TYPE_TRIANGULAR.
hipsparseGetMatType()#
-
hipsparseMatrixType_t hipsparseGetMatType(const hipsparseMatDescr_t descrA)#
Get the matrix type of a matrix descriptor.
hipsparseGetMatType
returns the matrix type of a matrix descriptor.
hipsparseSetMatFillMode()#
-
hipsparseStatus_t hipsparseSetMatFillMode(hipsparseMatDescr_t descrA, hipsparseFillMode_t fillMode)#
Specify the matrix fill mode of a matrix descriptor.
hipsparseSetMatFillMode
sets the matrix fill mode of a matrix descriptor. Valid fill modes are HIPSPARSE_FILL_MODE_LOWER or HIPSPARSE_FILL_MODE_UPPER.
hipsparseGetMatFillMode()#
-
hipsparseFillMode_t hipsparseGetMatFillMode(const hipsparseMatDescr_t descrA)#
Get the matrix fill mode of a matrix descriptor.
hipsparseGetMatFillMode
returns the matrix fill mode of a matrix descriptor.
hipsparseSetMatDiagType()#
-
hipsparseStatus_t hipsparseSetMatDiagType(hipsparseMatDescr_t descrA, hipsparseDiagType_t diagType)#
Specify the matrix diagonal type of a matrix descriptor.
hipsparseSetMatDiagType
sets the matrix diagonal type of a matrix descriptor. Valid diagonal types are HIPSPARSE_DIAG_TYPE_UNIT or HIPSPARSE_DIAG_TYPE_NON_UNIT.
hipsparseGetMatDiagType()#
-
hipsparseDiagType_t hipsparseGetMatDiagType(const hipsparseMatDescr_t descrA)#
Get the matrix diagonal type of a matrix descriptor.
hipsparseGetMatDiagType
returns the matrix diagonal type of a matrix descriptor.
hipsparseSetMatIndexBase()#
-
hipsparseStatus_t hipsparseSetMatIndexBase(hipsparseMatDescr_t descrA, hipsparseIndexBase_t base)#
Specify the index base of a matrix descriptor.
hipsparseSetMatIndexBase
sets the index base of a matrix descriptor. Valid options are HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE.
hipsparseGetMatIndexBase()#
-
hipsparseIndexBase_t hipsparseGetMatIndexBase(const hipsparseMatDescr_t descrA)#
Get the index base of a matrix descriptor.
hipsparseGetMatIndexBase
returns the index base of a matrix descriptor.
hipsparseCreateHybMat()#
-
hipsparseStatus_t hipsparseCreateHybMat(hipsparseHybMat_t *hybA)#
Create a
HYB
matrix structure.hipsparseCreateHybMat
creates a structure that holds the matrix inHYB
storage format. It should be destroyed at the end using hipsparseDestroyHybMat().
hipsparseDestroyHybMat()#
-
hipsparseStatus_t hipsparseDestroyHybMat(hipsparseHybMat_t hybA)#
Destroy a
HYB
matrix structure.hipsparseDestroyHybMat
destroys aHYB
structure.
hipsparseCreateBsrsv2Info()#
-
hipsparseStatus_t hipsparseCreateBsrsv2Info(bsrsv2Info_t *info)#
Create a bsrsv2 info structure.
hipsparseCreateBsrsv2Info
creates a structure that holds the bsrsv2 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyBsrsv2Info().
hipsparseDestroyBsrsv2Info()#
-
hipsparseStatus_t hipsparseDestroyBsrsv2Info(bsrsv2Info_t info)#
Destroy a bsrsv2 info structure.
hipsparseDestroyBsrsv2Info
destroys a bsrsv2 info structure.
hipsparseCreateBsrsm2Info()#
-
hipsparseStatus_t hipsparseCreateBsrsm2Info(bsrsm2Info_t *info)#
Create a bsrsm2 info structure.
hipsparseCreateBsrsm2Info
creates a structure that holds the bsrsm2 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyBsrsm2Info().
hipsparseDestroyBsrsm2Info()#
-
hipsparseStatus_t hipsparseDestroyBsrsm2Info(bsrsm2Info_t info)#
Destroy a bsrsm2 info structure.
hipsparseDestroyBsrsm2Info
destroys a bsrsm2 info structure.
hipsparseCreateBsrilu02Info()#
-
hipsparseStatus_t hipsparseCreateBsrilu02Info(bsrilu02Info_t *info)#
Create a bsrilu02 info structure.
hipsparseCreateBsrilu02Info
creates a structure that holds the bsrilu02 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyBsrilu02Info().
hipsparseDestroyBsrilu02Info()#
-
hipsparseStatus_t hipsparseDestroyBsrilu02Info(bsrilu02Info_t info)#
Destroy a bsrilu02 info structure.
hipsparseDestroyBsrilu02Info
destroys a bsrilu02 info structure.
hipsparseCreateBsric02Info()#
-
hipsparseStatus_t hipsparseCreateBsric02Info(bsric02Info_t *info)#
Create a bsric02 info structure.
hipsparseCreateBsric02Info
creates a structure that holds the bsric02 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyBsric02Info().
hipsparseDestroyBsric02Info()#
-
hipsparseStatus_t hipsparseDestroyBsric02Info(bsric02Info_t info)#
Destroy a bsric02 info structure.
hipsparseDestroyBsric02Info
destroys a bsric02 info structure.
hipsparseCreateCsrsv2Info()#
-
hipsparseStatus_t hipsparseCreateCsrsv2Info(csrsv2Info_t *info)#
Create a csrsv2 info structure.
hipsparseCreateCsrsv2Info
creates a structure that holds the csrsv2 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsrsv2Info().
hipsparseDestroyCsrsv2Info()#
-
hipsparseStatus_t hipsparseDestroyCsrsv2Info(csrsv2Info_t info)#
Destroy a csrsv2 info structure.
hipsparseDestroyCsrsv2Info
destroys a csrsv2 info structure.
hipsparseCreateCsrsm2Info()#
-
hipsparseStatus_t hipsparseCreateCsrsm2Info(csrsm2Info_t *info)#
Create a csrsm2 info structure.
hipsparseCreateCsrsm2Info
creates a structure that holds the csrsm2 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsrsm2Info().
hipsparseDestroyCsrsm2Info()#
-
hipsparseStatus_t hipsparseDestroyCsrsm2Info(csrsm2Info_t info)#
Destroy a csrsm2 info structure.
hipsparseDestroyCsrsm2Info
destroys a csrsm2 info structure.
hipsparseCreateCsrilu02Info()#
-
hipsparseStatus_t hipsparseCreateCsrilu02Info(csrilu02Info_t *info)#
Create a csrilu02 info structure.
hipsparseCreateCsrilu02Info
creates a structure that holds the csrilu02 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsrilu02Info().
hipsparseDestroyCsrilu02Info()#
-
hipsparseStatus_t hipsparseDestroyCsrilu02Info(csrilu02Info_t info)#
Destroy a csrilu02 info structure.
hipsparseDestroyCsrilu02Info
destroys a csrilu02 info structure.
hipsparseCreateCsric02Info()#
-
hipsparseStatus_t hipsparseCreateCsric02Info(csric02Info_t *info)#
Create a csric02 info structure.
hipsparseCreateCsric02Info
creates a structure that holds the csric02 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsric02Info().
hipsparseDestroyCsric02Info()#
-
hipsparseStatus_t hipsparseDestroyCsric02Info(csric02Info_t info)#
Destroy a csric02 info structure.
hipsparseDestroyCsric02Info
destroys a csric02 info structure.
hipsparseCreateCsru2csrInfo()#
-
hipsparseStatus_t hipsparseCreateCsru2csrInfo(csru2csrInfo_t *info)#
Create a csru2csr info structure.
hipsparseCreateCsru2csrInfo
creates a structure that holds the csru2csr info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsru2csrInfo().
hipsparseDestroyCsru2csrInfo()#
-
hipsparseStatus_t hipsparseDestroyCsru2csrInfo(csru2csrInfo_t info)#
Destroy a csru2csr info structure.
hipsparseDestroyCsru2csrInfo
destroys a csru2csr info structure.
hipsparseCreateColorInfo()#
-
hipsparseStatus_t hipsparseCreateColorInfo(hipsparseColorInfo_t *info)#
Create a color info structure.
hipsparseCreateColorInfo
creates a structure that holds the color info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyColorInfo().
hipsparseDestroyColorInfo()#
-
hipsparseStatus_t hipsparseDestroyColorInfo(hipsparseColorInfo_t info)#
Destroy a color info structure.
hipsparseDestroyColorInfo
destroys a color info structure.
hipsparseCreateCsrgemm2Info()#
-
hipsparseStatus_t hipsparseCreateCsrgemm2Info(csrgemm2Info_t *info)#
Create a csrgemm2 info structure.
hipsparseCreateCsrgemm2Info
creates a structure that holds the csrgemm2 info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyCsrgemm2Info().
hipsparseDestroyCsrgemm2Info()#
-
hipsparseStatus_t hipsparseDestroyCsrgemm2Info(csrgemm2Info_t info)#
Destroy a csrgemm2 info structure.
hipsparseDestroyCsrgemm2Info
destroys a csrgemm2 info structure.
hipsparseCreatePruneInfo()#
-
hipsparseStatus_t hipsparseCreatePruneInfo(pruneInfo_t *info)#
Create a prune info structure.
hipsparseCreatePruneInfo
creates a structure that holds the prune info data that is gathered during the analysis routines available. It should be destroyed at the end using hipsparseDestroyPruneInfo().
hipsparseDestroyPruneInfo()#
-
hipsparseStatus_t hipsparseDestroyPruneInfo(pruneInfo_t info)#
Destroy a prune info structure.
hipsparseDestroyPruneInfo
destroys a prune info structure.
hipsparseCreateSpVec()#
-
hipsparseStatus_t hipsparseCreateSpVec(hipsparseSpVecDescr_t *spVecDescr, int64_t size, int64_t nnz, void *indices, void *values, hipsparseIndexType_t idxType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse vector.
hipsparseCreateSpVec
creates a sparse vector descriptor. It should be destroyed at the end using hipsparseDestroyMatDescr().
hipsparseDestroySpVec()#
-
hipsparseStatus_t hipsparseDestroySpVec(hipsparseSpVecDescr_t spVecDescr)#
Description: Destroy a sparse vector.
hipsparseDestroySpVec
destroys a sparse vector descriptor and releases all resources used by the descriptor.
hipsparseSpVecGet()#
-
hipsparseStatus_t hipsparseSpVecGet(const hipsparseSpVecDescr_t spVecDescr, int64_t *size, int64_t *nnz, void **indices, void **values, hipsparseIndexType_t *idxType, hipsparseIndexBase_t *idxBase, hipDataType *valueType)#
Description: Get the fields of the sparse vector descriptor.
hipsparseSpVecGet
gets the fields of the sparse vector descriptor
hipsparseSpVecGetIndexBase()#
-
hipsparseStatus_t hipsparseSpVecGetIndexBase(const hipsparseSpVecDescr_t spVecDescr, hipsparseIndexBase_t *idxBase)#
Description: Get index base of a sparse vector.
hipsparseSpVecGetValues()#
-
hipsparseStatus_t hipsparseSpVecGetValues(const hipsparseSpVecDescr_t spVecDescr, void **values)#
Description: Get pointer to a sparse vector data array.
hipsparseSpVecSetValues()#
-
hipsparseStatus_t hipsparseSpVecSetValues(hipsparseSpVecDescr_t spVecDescr, void *values)#
Description: Set pointer of a sparse vector data array.
hipsparseCreateCoo()#
-
hipsparseStatus_t hipsparseCreateCoo(hipsparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *cooRowInd, void *cooColInd, void *cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse COO matrix descriptor.
hipsparseCreateCoo
creates a sparse COO matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat
.
hipsparseCreateCooAoS()#
-
hipsparseStatus_t hipsparseCreateCooAoS(hipsparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *cooInd, void *cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse COO (AoS) matrix descriptor.
hipsparseCreateCooAoS
creates a sparse COO (AoS) matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat
.
hipsparseCreateCsr()#
-
hipsparseStatus_t hipsparseCreateCsr(hipsparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *csrRowOffsets, void *csrColInd, void *csrValues, hipsparseIndexType_t csrRowOffsetsType, hipsparseIndexType_t csrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse CSR matrix descriptor.
hipsparseCreateCsr
creates a sparse CSR matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat
.
hipsparseCreateCsc()#
-
hipsparseStatus_t hipsparseCreateCsc(hipsparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void *cscColOffsets, void *cscRowInd, void *cscValues, hipsparseIndexType_t cscColOffsetsType, hipsparseIndexType_t cscRowIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse CSC matrix descriptor.
hipsparseCreateCsr
creates a sparse CSC matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat
.
hipsparseCreateBlockedEll()#
-
hipsparseStatus_t hipsparseCreateBlockedEll(hipsparseSpMatDescr_t *spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, void *ellColInd, void *ellValue, hipsparseIndexType_t ellIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)#
Description: Create a sparse Blocked ELL matrix descriptor.
hipsparseCreateCsr
creates a sparse Blocked ELL matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat
.
hipsparseDestroySpMat()#
-
hipsparseStatus_t hipsparseDestroySpMat(hipsparseSpMatDescr_t spMatDescr)#
Description: Destroy a sparse matrix descriptor.
hipsparseDestroySpMat
destroys a sparse matrix descriptor and releases all resources used by the descriptor.
hipsparseCooGet()#
-
hipsparseStatus_t hipsparseCooGet(const hipsparseSpMatDescr_t spMatDescr, int64_t *rows, int64_t *cols, int64_t *nnz, void **cooRowInd, void **cooColInd, void **cooValues, hipsparseIndexType_t *idxType, hipsparseIndexBase_t *idxBase, hipDataType *valueType)#
Description: Get pointers of a sparse COO matrix.
hipsparseCooGet
gets the fields of the sparse COO matrix descriptor
hipsparseCooAoSGet()#
-
hipsparseStatus_t hipsparseCooAoSGet(const hipsparseSpMatDescr_t spMatDescr, int64_t *rows, int64_t *cols, int64_t *nnz, void **cooInd, void **cooValues, hipsparseIndexType_t *idxType, hipsparseIndexBase_t *idxBase, hipDataType *valueType)#
Description: Get pointers of a sparse COO (AoS) matrix.
hipsparseCooAoSGet
gets the fields of the sparse COO (AoS) matrix descriptor
hipsparseCsrGet()#
-
hipsparseStatus_t hipsparseCsrGet(const hipsparseSpMatDescr_t spMatDescr, int64_t *rows, int64_t *cols, int64_t *nnz, void **csrRowOffsets, void **csrColInd, void **csrValues, hipsparseIndexType_t *csrRowOffsetsType, hipsparseIndexType_t *csrColIndType, hipsparseIndexBase_t *idxBase, hipDataType *valueType)#
Description: Get pointers of a sparse CSR matrix.
hipsparseCsrGet
gets the fields of the sparse CSR matrix descriptor
hipsparseBlockedEllGet()#
-
hipsparseStatus_t hipsparseBlockedEllGet(const hipsparseSpMatDescr_t spMatDescr, int64_t *rows, int64_t *cols, int64_t *ellBlockSize, int64_t *ellCols, void **ellColInd, void **ellValue, hipsparseIndexType_t *ellIdxType, hipsparseIndexBase_t *idxBase, hipDataType *valueType)#
Description: Get pointers of a sparse blocked ELL matrix.
hipsparseBlockedEllGet
gets the fields of the sparse blocked ELL matrix descriptor
hipsparseCsrSetPointers()#
-
hipsparseStatus_t hipsparseCsrSetPointers(hipsparseSpMatDescr_t spMatDescr, void *csrRowOffsets, void *csrColInd, void *csrValues)#
Description: Set pointers of a sparse CSR matrix.
hipsparseCsrSetPointers
sets the fields of the sparse CSR matrix descriptor
hipsparseCscSetPointers()#
-
hipsparseStatus_t hipsparseCscSetPointers(hipsparseSpMatDescr_t spMatDescr, void *cscColOffsets, void *cscRowInd, void *cscValues)#
Description: Set pointers of a sparse CSC matrix.
hipsparseCscSetPointers
sets the fields of the sparse CSC matrix descriptor
hipsparseCooSetPointers()#
-
hipsparseStatus_t hipsparseCooSetPointers(hipsparseSpMatDescr_t spMatDescr, void *cooRowInd, void *cooColInd, void *cooValues)#
Description: Set pointers of a sparse COO matrix.
hipsparseCooSetPointers
sets the fields of the sparse COO matrix descriptor
hipsparseSpMatGetSize()#
-
hipsparseStatus_t hipsparseSpMatGetSize(hipsparseSpMatDescr_t spMatDescr, int64_t *rows, int64_t *cols, int64_t *nnz)#
Description: Get the sizes of a sparse matrix.
hipsparseSpMatGetFormat()#
-
hipsparseStatus_t hipsparseSpMatGetFormat(const hipsparseSpMatDescr_t spMatDescr, hipsparseFormat_t *format)#
Description: Get the format of a sparse matrix.
hipsparseSpMatGetIndexBase()#
-
hipsparseStatus_t hipsparseSpMatGetIndexBase(const hipsparseSpMatDescr_t spMatDescr, hipsparseIndexBase_t *idxBase)#
Description: Get the index base of a sparse matrix.
hipsparseSpMatGetValues()#
-
hipsparseStatus_t hipsparseSpMatGetValues(hipsparseSpMatDescr_t spMatDescr, void **values)#
Description: Get the pointer of the values array of a sparse matrix.
hipsparseSpMatSetValues()#
-
hipsparseStatus_t hipsparseSpMatSetValues(hipsparseSpMatDescr_t spMatDescr, void *values)#
Description: Set the pointer of the values array of a sparse matrix.
hipsparseSpMatGetAttribute()#
-
hipsparseStatus_t hipsparseSpMatGetAttribute(hipsparseSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, void *data, size_t dataSize)#
Description: Get attribute from sparse matrix descriptor.
hipsparseSpMatSetAttribute()#
-
hipsparseStatus_t hipsparseSpMatSetAttribute(hipsparseSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, const void *data, size_t dataSize)#
Description: Set attribute in sparse matrix descriptor.
hipsparseCreateDnVec()#
-
hipsparseStatus_t hipsparseCreateDnVec(hipsparseDnVecDescr_t *dnVecDescr, int64_t size, void *values, hipDataType valueType)#
Description: Create dense vector.
hipsparseCreateDnVec
creates a dense vector descriptor. It should be destroyed at the end using hipsparseDestroyDnVec().
hipsparseDestroyDnVec()#
-
hipsparseStatus_t hipsparseDestroyDnVec(hipsparseDnVecDescr_t dnVecDescr)#
Description: Destroy dense vector.
hipsparseDestroyDnVec
destroys a dense vector descriptor and releases all resources used by the descriptor.
hipsparseDnVecGet()#
-
hipsparseStatus_t hipsparseDnVecGet(const hipsparseDnVecDescr_t dnVecDescr, int64_t *size, void **values, hipDataType *valueType)#
Description: Get the fields from a dense vector.
hipsparseDnVecGet
gets the fields of the dense vector descriptor
hipsparseDnVecGetValues()#
-
hipsparseStatus_t hipsparseDnVecGetValues(const hipsparseDnVecDescr_t dnVecDescr, void **values)#
Description: Get value pointer from a dense vector.
hipsparseDnVecGetValues
gets the fields of the dense vector descriptor
hipsparseDnVecSetValues()#
-
hipsparseStatus_t hipsparseDnVecSetValues(hipsparseDnVecDescr_t dnVecDescr, void *values)#
Description: Set value pointer of a dense vector.
hipsparseDnVecSetValues
sets the fields of the dense vector descriptor
hipsparseCreateDnMat()#
-
hipsparseStatus_t hipsparseCreateDnMat(hipsparseDnMatDescr_t *dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void *values, hipDataType valueType, hipsparseOrder_t order)#
Description: Create dense matrix.
hipsparseCreateDnMat
creates a dense matrix descriptor. It should be destroyed at the end using hipsparseDestroyDnMat().
hipsparseDestroyDnMat()#
-
hipsparseStatus_t hipsparseDestroyDnMat(hipsparseDnMatDescr_t dnMatDescr)#
Description: Destroy dense matrix.
hipsparseDestroyDnMat
destroys a dense matrix descriptor and releases all resources used by the descriptor.
hipsparseDnMatGet()#
-
hipsparseStatus_t hipsparseDnMatGet(const hipsparseDnMatDescr_t dnMatDescr, int64_t *rows, int64_t *cols, int64_t *ld, void **values, hipDataType *valueType, hipsparseOrder_t *order)#
Description: Get fields from a dense matrix.
hipsparseDnMatGetValues()#
-
hipsparseStatus_t hipsparseDnMatGetValues(const hipsparseDnMatDescr_t dnMatDescr, void **values)#
Description: Get value pointer from a dense matrix.
hipsparseDnMatSetValues()#
-
hipsparseStatus_t hipsparseDnMatSetValues(hipsparseDnMatDescr_t dnMatDescr, void *values)#
Description: Set value pointer of a dense matrix.
Sparse Level 1 Functions#
The sparse level 1 routines describe operations between a vector in sparse format and a vector in dense format. This section describes all hipSPARSE level 1 sparse linear algebra functions.
hipsparseXaxpyi()#
-
hipsparseStatus_t hipsparseSaxpyi(hipsparseHandle_t handle, int nnz, const float *alpha, const float *xVal, const int *xInd, float *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDaxpyi(hipsparseHandle_t handle, int nnz, const double *alpha, const double *xVal, const int *xInd, double *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseCaxpyi(hipsparseHandle_t handle, int nnz, const hipComplex *alpha, const hipComplex *xVal, const int *xInd, hipComplex *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZaxpyi(hipsparseHandle_t handle, int nnz, const hipDoubleComplex *alpha, const hipDoubleComplex *xVal, const int *xInd, hipDoubleComplex *y, hipsparseIndexBase_t idxBase)#
Scale a sparse vector and add it to a dense vector.
hipsparseXaxpyi
multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\), such that\[ y := y + \alpha \cdot x \]for(i = 0; i < nnz; ++i) { y[x_ind[i]] = y[x_ind[i]] + alpha * x_val[i]; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXdoti()#
-
hipsparseStatus_t hipsparseSdoti(hipsparseHandle_t handle, int nnz, const float *xVal, const int *xInd, const float *y, float *result, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDdoti(hipsparseHandle_t handle, int nnz, const double *xVal, const int *xInd, const double *y, double *result, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseCdoti(hipsparseHandle_t handle, int nnz, const hipComplex *xVal, const int *xInd, const hipComplex *y, hipComplex *result, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZdoti(hipsparseHandle_t handle, int nnz, const hipDoubleComplex *xVal, const int *xInd, const hipDoubleComplex *y, hipDoubleComplex *result, hipsparseIndexBase_t idxBase)#
Compute the dot product of a sparse vector with a dense vector.
hipsparseXdoti
computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that\[ \text{result} := y^T x \]for(i = 0; i < nnz; ++i) { result += x_val[i] * y[x_ind[i]]; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXdotci()#
-
hipsparseStatus_t hipsparseCdotci(hipsparseHandle_t handle, int nnz, const hipComplex *xVal, const int *xInd, const hipComplex *y, hipComplex *result, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZdotci(hipsparseHandle_t handle, int nnz, const hipDoubleComplex *xVal, const int *xInd, const hipDoubleComplex *y, hipDoubleComplex *result, hipsparseIndexBase_t idxBase)#
Compute the dot product of a complex conjugate sparse vector with a dense vector.
hipsparseXdotci
computes the dot product of the complex conjugate sparse vector \(x\) with the dense vector \(y\), such that\[ \text{result} := \bar{x}^H y \]for(i = 0; i < nnz; ++i) { result += conj(x_val[i]) * y[x_ind[i]]; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXgthr()#
-
hipsparseStatus_t hipsparseSgthr(hipsparseHandle_t handle, int nnz, const float *y, float *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDgthr(hipsparseHandle_t handle, int nnz, const double *y, double *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseCgthr(hipsparseHandle_t handle, int nnz, const hipComplex *y, hipComplex *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZgthr(hipsparseHandle_t handle, int nnz, const hipDoubleComplex *y, hipDoubleComplex *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
Gather elements from a dense vector and store them into a sparse vector.
hipsparseXgthr
gathers the elements that are listed inx_ind
from the dense vector \(y\) and stores them in the sparse vector \(x\).for(i = 0; i < nnz; ++i) { x_val[i] = y[x_ind[i]]; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXgthrz()#
-
hipsparseStatus_t hipsparseSgthrz(hipsparseHandle_t handle, int nnz, float *y, float *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDgthrz(hipsparseHandle_t handle, int nnz, double *y, double *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseCgthrz(hipsparseHandle_t handle, int nnz, hipComplex *y, hipComplex *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZgthrz(hipsparseHandle_t handle, int nnz, hipDoubleComplex *y, hipDoubleComplex *xVal, const int *xInd, hipsparseIndexBase_t idxBase)#
Gather and zero out elements from a dense vector and store them into a sparse vector.
hipsparseXgthrz
gathers the elements that are listed inx_ind
from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.for(i = 0; i < nnz; ++i) { x_val[i] = y[x_ind[i]]; y[x_ind[i]] = 0; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXroti()#
-
hipsparseStatus_t hipsparseSroti(hipsparseHandle_t handle, int nnz, float *xVal, const int *xInd, float *y, const float *c, const float *s, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDroti(hipsparseHandle_t handle, int nnz, double *xVal, const int *xInd, double *y, const double *c, const double *s, hipsparseIndexBase_t idxBase)#
Apply Givens rotation to a dense and a sparse vector.
hipsparseXroti
applies the Givens rotation matrix \(G\) to the sparse vector \(x\) and the dense vector \(y\), where\[\begin{split} G = \begin{pmatrix} c & s \\ -s & c \end{pmatrix} \end{split}\]for(i = 0; i < nnz; ++i) { x_tmp = x_val[i]; y_tmp = y[x_ind[i]]; x_val[i] = c * x_tmp + s * y_tmp; y[x_ind[i]] = c * y_tmp - s * x_tmp; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXsctr()#
-
hipsparseStatus_t hipsparseSsctr(hipsparseHandle_t handle, int nnz, const float *xVal, const int *xInd, float *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseDsctr(hipsparseHandle_t handle, int nnz, const double *xVal, const int *xInd, double *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseCsctr(hipsparseHandle_t handle, int nnz, const hipComplex *xVal, const int *xInd, hipComplex *y, hipsparseIndexBase_t idxBase)#
-
hipsparseStatus_t hipsparseZsctr(hipsparseHandle_t handle, int nnz, const hipDoubleComplex *xVal, const int *xInd, hipDoubleComplex *y, hipsparseIndexBase_t idxBase)#
Scatter elements from a dense vector across a sparse vector.
hipsparseXsctr
scatters the elements that are listed inx_ind
from the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed inx_ind
remain unchanged.for(i = 0; i < nnz; ++i) { y[x_ind[i]] = x_val[i]; }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Sparse Level 2 Functions#
This module holds all sparse level 2 routines.
The sparse level 2 routines describe operations between a matrix in sparse format and a vector in dense format.
hipsparseXcsrmv()#
-
hipsparseStatus_t hipsparseScsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const float *alpha, const hipsparseMatDescr_t descrA, const float *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, const float *x, const float *beta, float *y)#
-
hipsparseStatus_t hipsparseDcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const double *alpha, const hipsparseMatDescr_t descrA, const double *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, const double *x, const double *beta, double *y)#
-
hipsparseStatus_t hipsparseCcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const hipComplex *alpha, const hipsparseMatDescr_t descrA, const hipComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, const hipComplex *x, const hipComplex *beta, hipComplex *y)#
-
hipsparseStatus_t hipsparseZcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, const hipDoubleComplex *x, const hipDoubleComplex *beta, hipDoubleComplex *y)#
Sparse matrix vector multiplication using CSR storage format.
hipsparseXcsrmv
multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in CSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that\[ y := \alpha \cdot op(A) \cdot x + \beta \cdot y, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]for(i = 0; i < m; ++i) { y[i] = beta * y[i]; for(j = csr_row_ptr[i]; j < csr_row_ptr[i + 1]; ++j) { y[i] = y[i] + alpha * csr_val[j] * x[csr_col_ind[j]]; } }
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.
hipsparseXcsrsv2_zeroPivot()#
-
hipsparseStatus_t hipsparseXcsrsv2_zeroPivot(hipsparseHandle_t handle, csrsv2Info_t info, int *position)#
Sparse triangular solve using CSR storage format.
hipsparseXcsrsv2_zeroPivot
returns HIPSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrsv2_solve() or hipsparseZcsrsv2_solve() computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition
, using same index base as the CSR matrix.position
can be in host or device memory. If no zero pivot has been found,position
is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.Note
hipsparseXcsrsv2_zeroPivot
is a blocking function. It might influence performance negatively.
hipsparseXcsrsv2_bufferSize()#
-
hipsparseStatus_t hipsparseScsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, float *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseDcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, double *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseCcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseZcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, int *pBufferSizeInBytes)#
Sparse triangular solve using CSR storage format.
hipsparseXcsrsv2_bufferSize
returns the size of the temporary storage buffer that is required by hipsparseScsrsv2_analysis(), hipsparseDcsrsv2_analysis(), hipsparseCcsrsv2_analysis(), hipsparseZcsrsv2_analysis(), hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrsv2_solve() and hipsparseZcsrsv2_solve(). The temporary storage buffer must be allocated by the user.
hipsparseXcsrsv2_bufferSizeExt()#
-
hipsparseStatus_t hipsparseScsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, float *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseDcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, double *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseCcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseZcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, size_t *pBufferSize)#
Sparse triangular solve using CSR storage format.
hipsparseXcsrsv2_bufferSizeExt
returns the size of the temporary storage buffer that is required by hipsparseScsrsv2_analysis(), hipsparseDcsrsv2_analysis(), hipsparseCcsrsv2_analysis(), hipsparseZcsrsv2_analysis(), hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrsv2_solve() and hipsparseZcsrsv2_solve(). The temporary storage buffer must be allocated by the user.
hipsparseXcsrsv2_analysis()#
-
hipsparseStatus_t hipsparseScsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const float *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseDcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const double *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseCcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseZcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
Sparse triangular solve using CSR storage format.
hipsparseXcsrsv2_analysis
performs the analysis step for hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrsv2_solve() and hipsparseZcsrsv2_solve().Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXcsrsv2_solve()#
-
hipsparseStatus_t hipsparseScsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const float *alpha, const hipsparseMatDescr_t descrA, const float *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, const float *f, float *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseDcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const double *alpha, const hipsparseMatDescr_t descrA, const double *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, const double *f, double *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseCcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipComplex *alpha, const hipsparseMatDescr_t descrA, const hipComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, const hipComplex *f, hipComplex *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseZcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex *csrSortedValA, const int *csrSortedRowPtrA, const int *csrSortedColIndA, csrsv2Info_t info, const hipDoubleComplex *f, hipDoubleComplex *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
Sparse triangular solve using CSR storage format.
hipsparseXcsrsv2_solve
solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in CSR storage format, a dense solution vector \(y\) and the right-hand side \(x\) that is multiplied by \(\alpha\), such that\[ op(A) \cdot y = \alpha \cdot x, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]hipsparseXcsrsv2_solve
requires a user allocated temporary buffer. Its size is returned by hipsparseXcsrsv2_bufferSize() or hipsparseXcsrsv2_bufferSizeExt(). Furthermore, analysis meta data is required. It can be obtained by hipsparseXcsrsv2_analysis().hipsparseXcsrsv2_solve
reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling hipsparseXcsrsv2_zeroPivot(). If hipsparseDiagType_t == HIPSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if \(A_{j,j} = 0\) for some \(j\).Note
The sparse CSR matrix has to be sorted. This can be achieved by calling hipsparseXcsrsort().
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE andtrans
== HIPSPARSE_OPERATION_TRANSPOSE is supported.
hipsparseXhybmv()#
-
hipsparseStatus_t hipsparseShybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const float *alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const float *x, const float *beta, float *y)#
-
hipsparseStatus_t hipsparseDhybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const double *alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const double *x, const double *beta, double *y)#
-
hipsparseStatus_t hipsparseChybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const hipComplex *alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const hipComplex *x, const hipComplex *beta, hipComplex *y)#
-
hipsparseStatus_t hipsparseZhybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const hipDoubleComplex *x, const hipDoubleComplex *beta, hipDoubleComplex *y)#
Sparse matrix vector multiplication using HYB storage format.
hipsparseXhybmv
multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in HYB storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that\[ y := \alpha \cdot op(A) \cdot x + \beta \cdot y, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.
hipsparseXbsrmv()#
-
hipsparseStatus_t hipsparseSbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const float *alpha, const hipsparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const float *x, const float *beta, float *y)#
-
hipsparseStatus_t hipsparseDbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const double *alpha, const hipsparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const double *x, const double *beta, double *y)#
-
hipsparseStatus_t hipsparseCbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const hipComplex *alpha, const hipsparseMatDescr_t descrA, const hipComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const hipComplex *x, const hipComplex *beta, hipComplex *y)#
-
hipsparseStatus_t hipsparseZbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const hipDoubleComplex *x, const hipDoubleComplex *beta, hipDoubleComplex *y)#
Sparse matrix vector multiplication using BSR storage format.
hipsparseXbsrmv
multiplies the scalar \(\alpha\) with a sparse \((mb \cdot \text{block_dim}) \times (nb \cdot \text{block_dim})\) matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that\[ y := \alpha \cdot op(A) \cdot x + \beta \cdot y, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.
hipsparseXbsrxmv()#
-
hipsparseStatus_t hipsparseSbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const float *alpha, const hipsparseMatDescr_t descr, const float *bsrVal, const int *bsrMaskPtr, const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd, int blockDim, const float *x, const float *beta, float *y)#
-
hipsparseStatus_t hipsparseDbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const double *alpha, const hipsparseMatDescr_t descr, const double *bsrVal, const int *bsrMaskPtr, const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd, int blockDim, const double *x, const double *beta, double *y)#
-
hipsparseStatus_t hipsparseCbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const hipComplex *alpha, const hipsparseMatDescr_t descr, const hipComplex *bsrVal, const int *bsrMaskPtr, const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd, int blockDim, const hipComplex *x, const hipComplex *beta, hipComplex *y)#
-
hipsparseStatus_t hipsparseZbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descr, const hipDoubleComplex *bsrVal, const int *bsrMaskPtr, const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd, int blockDim, const hipDoubleComplex *x, const hipDoubleComplex *beta, hipDoubleComplex *y)#
Sparse matrix vector multiplication with mask operation using BSR storage format.
hipsparseXbsrxmv
multiplies the scalar \(\alpha\) with a sparse \((mb \cdot \text{block_dim}) \times (nb \cdot \text{block_dim})\) modified matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that\[ y := \left( \alpha \cdot op(A) \cdot x + \beta \cdot y \right)\left( \text{mask} \right), \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]The \(\text{mask}\) is defined as an array of block row indices. The input sparse matrix is defined with a modified BSR storage format where the beginning and the end of each row is defined with two arrays,
bsr_row_ptr
andbsr_end_ptr
(both of sizemb
), rather the usualbsr_row_ptr
of sizemb
+ 1.Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE is supported. Currently,block_dim
== 1 is not supported.
hipsparseXbsrsv2_zeroPivot()#
-
hipsparseStatus_t hipsparseXbsrsv2_zeroPivot(hipsparseHandle_t handle, bsrsv2Info_t info, int *position)#
Sparse triangular solve using BSR storage format.
hipsparseXbsrsv2_zeroPivot
returns HIPSPARSE_STATUS_ZERO_PIVOT, if either a structural or numerical zero has been found during hipsparseXbsrsv2_analysis() or hipsparseXbsrsv2_solve() computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition
, using same index base as the BSR matrix.position
can be in host or device memory. If no zero pivot has been found,position
is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.Note
hipsparseXbsrsv2_zeroPivot
is a blocking function. It might influence performance negatively.
hipsparseXbsrsv2_bufferSize()#
-
hipsparseStatus_t hipsparseSbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseDbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseCbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)#
-
hipsparseStatus_t hipsparseZbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)#
Sparse triangular solve using BSR storage format.
hipsparseXbsrsv2_bufferSize
returns the size of the temporary storage buffer that is required by hipsparseXbsrsv2_analysis() and hipsparseXbsrsv2_solve(). The temporary storage buffer must be allocated by the user.
hipsparseXbsrsv2_bufferSizeExt()#
-
hipsparseStatus_t hipsparseSbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseDbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseCbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t *pBufferSize)#
-
hipsparseStatus_t hipsparseZbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t *pBufferSize)#
Sparse triangular solve using BSR storage format.
hipsparseXbsrsv2_bufferSizeExt
returns the size of the temporary storage buffer that is required by hipsparseXbsrsv2_analysis() and hipsparseXbsrsv2_solve(). The temporary storage buffer must be allocated by the user.
hipsparseXbsrsv2_analysis()#
-
hipsparseStatus_t hipsparseSbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseDbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseCbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseZbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void *pBuffer)#
Sparse triangular solve using BSR storage format.
hipsparseXbsrsv2_analysis
performs the analysis step for hipsparseXbsrsv2_solve().Note
If the matrix sparsity pattern changes, the gathered information will become invalid.
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
hipsparseXbsrsv2_solve()#
-
hipsparseStatus_t hipsparseSbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const float *alpha, const hipsparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float *f, float *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseDbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const double *alpha, const hipsparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double *f, double *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseCbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipComplex *alpha, const hipsparseMatDescr_t descrA, const hipComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipComplex *f, hipComplex *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
-
hipsparseStatus_t hipsparseZbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipDoubleComplex *alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipDoubleComplex *f, hipDoubleComplex *x, hipsparseSolvePolicy_t policy, void *pBuffer)#
Sparse triangular solve using BSR storage format.
hipsparseXbsrsv2_solve
solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in BSR storage format, a dense solution vector \(y\) and the right-hand side \(x\) that is multiplied by \(\alpha\), such that\[ op(A) \cdot y = \alpha \cdot x, \]with\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \end{split}\]hipsparseXbsrsv2_solve
requires a user allocated temporary buffer. Its size is returned by hipsparseXbsrsv2_bufferSize() or hipsparseXbsrsv2_bufferSizeExt(). Furthermore, analysis meta data is required. It can be obtained by hipsparseXbsrsv2_analysis().hipsparseXbsrsv2_solve
reports the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling hipsparseXbsrsv2_zeroPivot(). If hipsparseDiagType_t == HIPSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if \(A_{j,j} = 0\) for some \(j\).Note
The sparse BSR matrix has to be sorted.
Note
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Note
Currently, only
trans
== HIPSPARSE_OPERATION_NON_TRANSPOSE andtrans
== HIPSPARSE_OPERATION_TRANSPOSE is supported.
hipsparseXgemvi_bufferSize()#
-
hipsparseStatus_t hipsparseSgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int *pBufferSize)#
-
hipsparseStatus_t hipsparseDgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int *pBufferSize)#
-
hipsparseStatus_t hipsparseCgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int *pBufferSize)#
-
hipsparseStatus_t hipsparseZgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int *pBufferSize)#
Dense matrix sparse vector multiplication.
hipsparseXgemvi_bufferSize
returns the size of the temporary storage buffer required by hipsparseXgemvi(). The temporary storage buffer must be allocated by the user.
hipsparseXgemvi()#
-
hipsparseStatus_t hipsparseSgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const float *alpha, const float *A, int lda, int nnz, const float *x, const int *xInd, const float *beta, float *y, hipsparseIndexBase_t idxBase, void *pBuffer)#