Basics#

Device and Stream Management#

hipSetDevice() and hipGetDevice() are HIP device management APIs. They are NOT part of the rocSPARSE API.

Asynchronous Execution#

All rocSPARSE 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 rocSPARSE 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 rocSPARSE. rocSPARSE honors the approach above and assumes users have already set the device before a rocSPARSE routine call.

Once users set the device, they create a handle with rocsparse_create_handle().

Subsequent rocSPARSE routines take this handle as an input parameter. rocSPARSE ONLY queries (by hipGetDevice()) the user’s device; rocSPARSE does NOT set the device for users. If rocSPARSE does not see a valid device, it returns an error message. It is the users’ responsibility to provide a valid device to rocSPARSE and ensure the device safety.

Users CANNOT switch devices between rocsparse_create_handle() and rocsparse_destroy_handle(). If users want to change device, they must destroy the current handle and create another rocSPARSE 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 rocSPARSE handle using rocsparse_set_stream(). HIP kernels are invoked in rocSPARSE routines. The rocSPARSE handle is always associated with a stream, and rocSPARSE passes its stream to the kernels inside the routine. One rocSPARSE 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 rocSPARSE handles concurrently, but can NOT run a single rocSPARSE 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 nnz elements containing the data (floating point).

coo_row_ind

array of nnz elements containing the row indices (integer).

coo_col_ind

array of nnz elements containing the column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 2.0 & 0.0 & 3.0 & 0.0 \\ 0.0 & 4.0 & 5.0 & 0.0 & 0.0 \\ 6.0 & 0.0 & 0.0 & 7.0 & 8.0 \\ \end{pmatrix}\end{split}\]

where

\[\begin{split}\begin{array}{ll} \text{coo_val}[8] & = \{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0\} \\ \text{coo_row_ind}[8] & = \{0, 0, 0, 1, 1, 2, 2, 2\} \\ \text{coo_col_ind}[8] & = \{0, 1, 3, 1, 2, 0, 3, 4\} \end{array}\end{split}\]

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 nnz elements containing the data (floating point).

coo_ind

array of 2 * nnz elements containing alternating row and column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 2.0 & 0.0 & 3.0 & 0.0 \\ 0.0 & 4.0 & 5.0 & 0.0 & 0.0 \\ 6.0 & 0.0 & 0.0 & 7.0 & 8.0 \\ \end{pmatrix}\end{split}\]

where

\[\begin{split}\begin{array}{ll} \text{coo_val}[8] & = \{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0\} \\ \text{coo_ind}[16] & = \{0, 0, 0, 1, 0, 3, 1, 1, 1, 2, 2, 0, 2, 3, 2, 4\} \\ \end{array}\end{split}\]

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 nnz elements containing the data (floating point).

csr_row_ptr

array of m+1 elements that point to the start of every row (integer).

csr_col_ind

array of nnz elements containing the column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 2.0 & 0.0 & 3.0 & 0.0 \\ 0.0 & 4.0 & 5.0 & 0.0 & 0.0 \\ 6.0 & 0.0 & 0.0 & 7.0 & 8.0 \\ \end{pmatrix}\end{split}\]

where

\[\begin{split}\begin{array}{ll} \text{csr_val}[8] & = \{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0\} \\ \text{csr_row_ptr}[4] & = \{1, 4, 6, 9\} \\ \text{csr_col_ind}[8] & = \{1, 2, 4, 2, 3, 1, 4, 5\} \end{array}\end{split}\]

CSC storage format#

The Compressed Sparse Column (CSC) 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).

csc_val

array of nnz elements containing the data (floating point).

csc_col_ptr

array of n+1 elements that point to the start of every column (integer).

csc_row_ind

array of nnz elements containing the row indices (integer).

The CSC matrix is expected to be sorted by row indices within each column. Furthermore, each pair of indices should appear only once. Consider the following \(3 \times 5\) matrix and the corresponding CSC structures, with \(m = 3, n = 5\) and \(\text{nnz} = 8\) using one based indexing:

\[\begin{split}A = \begin{pmatrix} 1.0 & 2.0 & 0.0 & 3.0 & 0.0 \\ 0.0 & 4.0 & 5.0 & 0.0 & 0.0 \\ 6.0 & 0.0 & 0.0 & 7.0 & 8.0 \\ \end{pmatrix}\end{split}\]

where

\[\begin{split}\begin{array}{ll} \text{csc_val}[8] & = \{1.0, 6.0, 2.0, 4.0, 5.0, 3.0, 7.0, 8.0\} \\ \text{csc_col_ptr}[6] & = \{1, 3, 5, 6, 8, 9\} \\ \text{csc_row_ind}[8] & = \{1, 3, 1, 2, 2, 1, 3, 3\} \end{array}\end{split}\]

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 nnzb * bsr_dim * bsr_dim elements containing the data (floating point). Blocks can be stored column-major or row-major.

bsr_row_ptr

array of mb+1 elements that point to the start of every block row (integer).

bsr_col_ind

array of nnzb elements containing the block column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 0.0 & 2.0 \\ 3.0 & 0.0 & 4.0 \\ 5.0 & 6.0 & 0.0 \\ 7.0 & 0.0 & 8.0 \\ \end{pmatrix}\end{split}\]

with the blocks \(A_{ij}\)

\[\begin{split}A_{00} = \begin{pmatrix} 1.0 & 0.0 \\ 3.0 & 0.0 \\ \end{pmatrix}, A_{01} = \begin{pmatrix} 2.0 & 0.0 \\ 4.0 & 0.0 \\ \end{pmatrix}, A_{10} = \begin{pmatrix} 5.0 & 6.0 \\ 7.0 & 0.0 \\ \end{pmatrix}, A_{11} = \begin{pmatrix} 0.0 & 0.0 \\ 8.0 & 0.0 \\ \end{pmatrix}\end{split}\]

such that

\[\begin{split}A = \begin{pmatrix} A_{00} & A_{01} \\ A_{10} & A_{11} \\ \end{pmatrix}\end{split}\]

with arrays representation

\[\begin{split}\begin{array}{ll} \text{bsr_val}[16] & = \{1.0, 3.0, 0.0, 0.0, 2.0, 4.0, 0.0, 0.0, 5.0, 7.0, 6.0, 0.0, 0.0, 8.0, 0.0, 0.0\} \\ \text{bsr_row_ptr}[3] & = \{0, 2, 4\} \\ \text{bsr_col_ind}[4] & = \{0, 1, 0, 1\} \end{array}\end{split}\]

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 nnzb * bsr_row_dim * bsr_col_dim elements containing the data (floating point). Blocks can be stored column-major or row-major.

bsr_row_ptr

array of mb+1 elements that point to the start of every block row (integer).

bsr_col_ind

array of nnzb elements containing the block column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 0.0 & 0.0 & 2.0 & 0.0 \\ 3.0 & 0.0 & 4.0 & 0.0 & 0.0 \\ 5.0 & 6.0 & 0.0 & 7.0 & 0.0 \\ 0.0 & 0.0 & 8.0 & 0.0 & 9.0 \\ \end{pmatrix}\end{split}\]

with the blocks \(A_{ij}\)

\[\begin{split}A_{00} = \begin{pmatrix} 1.0 & 0.0 & 0.0 \\ 3.0 & 0.0 & 4.0 \\ \end{pmatrix}, A_{01} = \begin{pmatrix} 2.0 & 0.0 & 0.0 \\ 0.0 & 0.0 & 0.0 \\ \end{pmatrix}, A_{10} = \begin{pmatrix} 5.0 & 6.0 & 0.0 \\ 0.0 & 0.0 & 8.0 \\ \end{pmatrix}, A_{11} = \begin{pmatrix} 7.0 & 0.0 & 0.0 \\ 0.0 & 9.0 & 0.0 \\ \end{pmatrix}\end{split}\]

such that

\[\begin{split}A = \begin{pmatrix} A_{00} & A_{01} \\ A_{10} & A_{11} \\ \end{pmatrix}\end{split}\]

with arrays representation

\[\begin{split}\begin{array}{ll} \text{bsr_val}[24] & = \{1.0, 3.0, 0.0, 0.0, 0.0, 4.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.0, 0.0, 6.0, 0.0, 0.0, 8.0, 7.0, 0.0, 0.0, 9.0, 0.0, 0.0\} \\ \text{bsr_row_ptr}[3] & = \{0, 2, 4\} \\ \text{bsr_col_ind}[4] & = \{0, 1, 0, 1\} \end{array}\end{split}\]

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 m * ell_width elements containing the data (floating point).

ell_col_ind

array of m * ell_width elements containing the column indices (integer).

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:

\[\begin{split}A = \begin{pmatrix} 1.0 & 2.0 & 0.0 & 3.0 & 0.0 \\ 0.0 & 4.0 & 5.0 & 0.0 & 0.0 \\ 6.0 & 0.0 & 0.0 & 7.0 & 8.0 \\ \end{pmatrix}\end{split}\]

where

\[\begin{split}\begin{array}{ll} \text{ell_val}[9] & = \{1.0, 4.0, 6.0, 2.0, 5.0, 7.0, 3.0, 0.0, 8.0\} \\ \text{ell_col_ind}[9] & = \{0, 1, 0, 1, 2, 3, 3, -1, 4\} \end{array}\end{split}\]

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 m * ell_width elements containing the ELL part data (floating point).

ell_col_ind

array of m * ell_width elements containing the ELL part column indices (integer).

coo_val

array of nnz elements containing the COO part data (floating point).

coo_row_ind

array of nnz elements containing the COO part row indices (integer).

coo_col_ind

array of nnz elements containing the COO part column indices (integer).

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 rocsparse_hyb_partition.

Exported Sparse Functions#

Auxiliary Functions#

Function name

rocsparse_create_handle()

rocsparse_destroy_handle()

rocsparse_set_stream()

rocsparse_get_stream()

rocsparse_set_pointer_mode()

rocsparse_get_pointer_mode()

rocsparse_get_version()

rocsparse_get_git_rev()

rocsparse_create_mat_descr()

rocsparse_destroy_mat_descr()

rocsparse_copy_mat_descr()

rocsparse_set_mat_index_base()

rocsparse_get_mat_index_base()

rocsparse_set_mat_type()

rocsparse_get_mat_type()

rocsparse_set_mat_fill_mode()

rocsparse_get_mat_fill_mode()

rocsparse_set_mat_diag_type()

rocsparse_get_mat_diag_type()

rocsparse_set_mat_storage_mode()

rocsparse_get_mat_storage_mode()

rocsparse_create_hyb_mat()

rocsparse_destroy_hyb_mat()

rocsparse_copy_hyb_mat()

rocsparse_create_mat_info()

rocsparse_copy_mat_info()

rocsparse_destroy_mat_info()

rocsparse_create_color_info()

rocsparse_destroy_color_info()

rocsparse_copy_color_info()

rocsparse_create_spvec_descr()

rocsparse_destroy_spvec_descr()

rocsparse_spvec_get()

rocsparse_spvec_get_index_base()

rocsparse_spvec_get_values()

rocsparse_spvec_set_values()

rocsparse_create_coo_descr()

rocsparse_create_coo_aos_descr()

rocsparse_create_csr_descr()

rocsparse_create_csc_descr()

rocsparse_create_ell_descr()

rocsparse_create_bell_descr()

rocsparse_destroy_spmat_descr()

rocsparse_coo_get()

rocsparse_coo_aos_get()

rocsparse_csr_get()

rocsparse_ell_get()

rocsparse_bell_get()

rocsparse_coo_set_pointers()

rocsparse_coo_aos_set_pointers()

rocsparse_csr_set_pointers()

rocsparse_csc_set_pointers()

rocsparse_ell_set_pointers()

rocsparse_bsr_set_pointers()

rocsparse_spmat_get_size()

rocsparse_spmat_get_format()

rocsparse_spmat_get_index_base()

rocsparse_spmat_get_values()

rocsparse_spmat_set_values()

rocsparse_spmat_get_strided_batch()

rocsparse_spmat_set_strided_batch()

rocsparse_coo_set_strided_batch()

rocsparse_csr_set_strided_batch()

rocsparse_csc_set_strided_batch()

rocsparse_spmat_get_attribute()

rocsparse_spmat_set_attribute()

rocsparse_create_dnvec_descr()

rocsparse_destroy_dnvec_descr()

rocsparse_dnvec_get()

rocsparse_dnvec_get_values()

rocsparse_dnvec_set_values()

rocsparse_create_dnmat_descr()

rocsparse_destroy_dnmat_descr()

rocsparse_dnmat_get()

rocsparse_dnmat_get_values()

rocsparse_dnmat_set_values()

rocsparse_dnmat_get_strided_batch()

rocsparse_dnmat_set_strided_batch()

Sparse Level 1 Functions#

Function name

single

double

single complex

double complex

rocsparse_Xaxpyi()

x

x

x

x

rocsparse_Xdoti()

x

x

x

x

rocsparse_Xdotci()

x

x

rocsparse_Xgthr()

x

x

x

x

rocsparse_Xgthrz()

x

x

x

x

rocsparse_Xroti()

x

x

rocsparse_Xsctr()

x

x

x

x

Sparse Level 2 Functions#

Sparse Level 3 Functions#

Sparse Extra Functions#

Preconditioner Functions#

Conversion Functions#

Function name

single

double

single complex

double complex

rocsparse_csr2coo()

rocsparse_csr2csc_buffer_size()

rocsparse_Xcsr2csc()

x

x

x

x

rocsparse_Xgebsr2gebsc_buffer_size()

x

x

x

x

rocsparse_Xgebsr2gebsc()

x

x

x

x

rocsparse_csr2ell_width()

rocsparse_Xcsr2ell()

x

x

x

x

rocsparse_Xcsr2hyb()

x

x

x

x

rocsparse_csr2bsr_nnz()

rocsparse_Xcsr2bsr()

x

x

x

x

rocsparse_csr2gebsr_nnz()

rocsparse_Xcsr2gebsr_buffer_size()

x

x

x

x

rocsparse_Xcsr2gebsr()

x

x

x

x

rocsparse_coo2csr()

rocsparse_ell2csr_nnz()

rocsparse_Xell2csr()

x

x

x

x

rocsparse_hyb2csr_buffer_size()

rocsparse_Xhyb2csr()

x

x

x

x

rocsparse_Xbsr2csr()

x

x

x

x

rocsparse_Xgebsr2csr()

x

x

x

x

rocsparse_Xgebsr2gebsr_buffer_size()

x

x

x

x

rocsparse_gebsr2gebsr_nnz()

rocsparse_Xgebsr2gebsr()

x

x

x

x

rocsparse_Xcsr2csr_compress()

x

x

x

x

rocsparse_create_identity_permutation()

rocsparse_inverse_permutation()

rocsparse_cscsort_buffer_size()

rocsparse_cscsort()

rocsparse_csrsort_buffer_size()

rocsparse_csrsort()

rocsparse_coosort_buffer_size()

rocsparse_coosort_by_row()

rocsparse_coosort_by_column()

rocsparse_Xdense2csr()

x

x

x

x

rocsparse_Xdense2csc()

x

x

x

x

rocsparse_Xdense2coo()

x

x

x

x

rocsparse_Xcsr2dense()

x

x

x

x

rocsparse_Xcsc2dense()

x

x

x

x

rocsparse_Xcoo2dense()

x

x

x

x

rocsparse_Xnnz_compress()

x

x

x

x

rocsparse_Xnnz()

x

x

x

x

rocsparse_Xprune_dense2csr_buffer_size()

x

x

rocsparse_Xprune_dense2csr_nnz()

x

x

rocsparse_Xprune_dense2csr()

x

x

rocsparse_Xprune_csr2csr_buffer_size()

x

x

rocsparse_Xprune_csr2csr_nnz()

x

x

rocsparse_Xprune_csr2csr()

x

x

rocsparse_Xprune_dense2csr_by_percentage_buffer_size()

x

x

rocsparse_Xprune_dense2csr_nnz_by_percentage()

x

x

rocsparse_Xprune_dense2csr_by_percentage()

x

x

rocsparse_Xprune_csr2csr_by_percentage_buffer_size()

x

x

rocsparse_Xprune_csr2csr_nnz_by_percentage()

x

x

rocsparse_Xprune_csr2csr_by_percentage()

x

x

rocsparse_Xbsrpad_value()

x

x

x

x

Reordering Functions#

Function name

single

double

single complex

double complex

rocsparse_Xcsrcolor()

x

x

x

x

Utility Functions#

Sparse Generic Functions#

Storage schemes and indexing base#

rocSPARSE supports 0 and 1 based indexing. The index base is selected by the rocsparse_index_base type which is either passed as standalone parameter or as part of the rocsparse_mat_descr 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 rocsparse_set_pointer_mode() and rocsparse_get_pointer_mode() are used to set and get the value of the state variable rocsparse_pointer_mode. If rocsparse_pointer_mode is equal to rocsparse_pointer_mode_host, then scalar parameters must be allocated on the host. If rocsparse_pointer_mode is equal to rocsparse_pointer_mode_device, then scalar parameters must be allocated on the device.

There are two types of scalar parameter:

  1. Scaling parameters, such as alpha and beta used in e.g. rocsparse_scsrmv(), rocsparse_scoomv(), …

  2. Scalar results from functions such as rocsparse_sdoti(), rocsparse_cdotci(), …

For scalar parameters such as alpha and beta, memory can be allocated on the host heap or stack, when rocsparse_pointer_mode is equal to rocsparse_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 rocsparse_pointer_mode is equal to rocsparse_pointer_mode_device, the scalar parameter must not be changed till the kernel completes.

For scalar results, when rocsparse_pointer_mode is equal to rocsparse_pointer_mode_host, the function blocks the CPU till the GPU has copied the result back to the host. Using rocsparse_pointer_mode equal to rocsparse_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 rocSPARSE functions are configured to operate in non-blocking fashion with respect to CPU, meaning these library functions return immediately.

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. hipSPARSE can be found on GitHub.