hipsparsexcoo2csr Interface Reference#
Convert a sparse COO matrix into a sparse CSR matrix. More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsexcoo2csr_ (handle, coorowind, nnz, m, csrrowptr, idxbase) |
| integer(kind(hipsparse_status_success)) function | hipsparsexcoo2csr_rank_0 (handle, coorowind, nnz, m, csrrowptr, idxbase) |
| integer(kind(hipsparse_status_success)) function | hipsparsexcoo2csr_rank_1 (handle, coorowind, nnz, m, csrrowptr, idxbase) |
Detailed Description
Convert a sparse COO matrix into a sparse CSR matrix.
hipsparseXcoo2csr converts the COO array containing the row indices into a CSR array of row offsets that point to the start of every row. It is assumed that the COO row index array is sorted and that all arrays have been allocated prior to calling hipsparseXcoo2csr.
For example, given the COO row indices array:
\[ \begin{align} \text{cooRowInd} &= \begin{bmatrix} 0 & 0 & 1 & 2 & 2 & 4 & 4 & 4 \end{bmatrix} \end{align} \]
the resulting CSR row pointer array after calling hipsparseXcoo2csr is:
\[ \begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 3 & 5 & 8 \end{bmatrix} \end{align} \]
- Note
- This function can also be used to convert a COO array containing the column indices into a CSC array of column offsets that point to the start of every column. In this case, it is assumed that the COO column index array is sorted instead.
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] cooRowInd - array of nnzelements containing the row indices of the sparse COO matrix.[in] nnz - number of non-zero entries of the sparse CSR matrix. Must be non-negative. [in] m - number of rows of the sparse CSR matrix. Must be non-negative. [out] csrRowPtr - array of m+1elements that point to the start of every row of the sparse CSR matrix.[in] idxBase - index base. HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_NOT_INITIALIZED handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE handleis nullptr,mornnzis negative,cooRowIndorcsrRowPtris nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
Member Function/Subroutine Documentation
◆ hipsparsexcoo2csr_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsexcoo2csr::hipsparsexcoo2csr_ | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | coorowind, | ||
| integer(c_int), value | nnz, | ||
| integer(c_int), value | m, | ||
| type(c_ptr), value | csrrowptr, | ||
| integer(kind(hipsparse_index_base_zero)), value | idxbase | ||
| ) |
◆ hipsparsexcoo2csr_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsexcoo2csr::hipsparsexcoo2csr_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int), target | coorowind, | ||
| integer(c_int) | nnz, | ||
| integer(c_int) | m, | ||
| integer(c_int), target | csrrowptr, | ||
| integer(kind(hipsparse_index_base_zero)) | idxbase | ||
| ) |
◆ hipsparsexcoo2csr_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsexcoo2csr::hipsparsexcoo2csr_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int), dimension(:), target | coorowind, | ||
| integer(c_int) | nnz, | ||
| integer(c_int) | m, | ||
| integer(c_int), dimension(:), target | csrrowptr, | ||
| integer(kind(hipsparse_index_base_zero)) | idxbase | ||
| ) |
The documentation for this interface was generated from the following file: