hipsparsescsr2dense Interface Reference#
hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.
More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2dense_ (handle, m, n, descr, csrval, csrrowptr, csrcolind, a, ld) |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2dense_rank_0 (handle, m, n, descr, csrval, csrrowptr, csrcolind, a, ld) |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2dense_rank_1 (handle, m, n, descr, csrval, csrrowptr, csrcolind, a, ld) |
| integer(kind(hipsparse_status_success)) function | hipsparsescsr2dense_full_rank (handle, m, n, descr, csrval, csrrowptr, csrcolind, a, ld) |
Detailed Description
hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.
Given the input CSR matrix of size mxn, the routine writes the matrix to the dense array A such that A has leading dimension ld and is column ordered. This means that A has size ldxn where ld>=m. All the parameters are assumed to have been preallocated by the user. If the input CSR matrix has index base of one, it must be set in the hipsparseMatDescr_t. See hipsparseSetMatIndexBase () prior to calling hipsparseXcsr2dense.
For example, consider the sparse CSR matrix:
\[ \begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 & 7 \end{bmatrix} \\% \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 0 & 1 & 0 & 2 & 3 \end{bmatrix} \\% \text{csrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 \end{bmatrix} \\% \end{align} \]
hipsparseXcsr2dense is used to convert to the dense matrix:
\[ \begin{bmatrix} 1 & 0 & 0 & 2 \\% 3 & 4 & 0 & 0 \\% 5 & 0 & 6 & 7 \end{bmatrix} \]
where the values in the A array are column ordered:
\[ \text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\% \]
- Note
- This function is executed asynchronously with respect to the host and can return control to the application on the host before the entire result is ready.
- Deprecated:
- This function is deprecated when using the CUDA backend (CUDA 11.0+) and will be removed in CUDA 12.0. This deprecation does not apply to the ROCm backend.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] m - number of rows of the dense matrix A. Must be non-negative.[in] n - number of columns of the dense matrix A. Must be non-negative.[in] descr - the descriptor of the dense matrix A, the supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.[in] csrVal - array of nnz ( = csrRowPtr[m] -csrRowPtr[0] ) non-zero elements of matrixA.[in] csrRowPtr - integer array of m+1elements that contains the start of every row and the end of the last row plus one.[in] csrColInd - integer array of nnz ( = csrRowPtr[m] -csrRowPtr[0] ) column indices of the non-zero elements of matrixA.[out] A - array of dimensions ( ld,n).[in] ld - leading dimension of dense array A. Must be at leastm.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_NOT_INITIALIZED handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE handle,descr,csrVal,csrRowPtr,csrColInd, orAis nullptr,mornis negative, orldis invalid.
Member Function/Subroutine Documentation
◆ hipsparsescsr2dense_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2dense::hipsparsescsr2dense_ | ( | type(c_ptr), value | handle, |
| integer(c_int), value | m, | ||
| integer(c_int), value | n, | ||
| type(c_ptr), value | descr, | ||
| type(c_ptr), value | csrval, | ||
| type(c_ptr), value | csrrowptr, | ||
| type(c_ptr), value | csrcolind, | ||
| type(c_ptr), value | a, | ||
| integer(c_int), value | ld | ||
| ) |
◆ hipsparsescsr2dense_full_rank()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2dense::hipsparsescsr2dense_full_rank | ( | type(c_ptr) | handle, |
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| type(c_ptr) | descr, | ||
| real(c_float), dimension(:), target | csrval, | ||
| integer(c_int), dimension(:), target | csrrowptr, | ||
| integer(c_int), dimension(:), target | csrcolind, | ||
| real(c_float), dimension(:,:), target | a, | ||
| integer(c_int) | ld | ||
| ) |
◆ hipsparsescsr2dense_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2dense::hipsparsescsr2dense_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| type(c_ptr) | descr, | ||
| real(c_float), target | csrval, | ||
| integer(c_int), target | csrrowptr, | ||
| integer(c_int), target | csrcolind, | ||
| real(c_float), target | a, | ||
| integer(c_int) | ld | ||
| ) |
◆ hipsparsescsr2dense_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsr2dense::hipsparsescsr2dense_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int) | m, | ||
| integer(c_int) | n, | ||
| type(c_ptr) | descr, | ||
| real(c_float), dimension(:), target | csrval, | ||
| integer(c_int), dimension(:), target | csrrowptr, | ||
| integer(c_int), dimension(:), target | csrcolind, | ||
| real(c_float), dimension(:), target | a, | ||
| integer(c_int) | ld | ||
| ) |
The documentation for this interface was generated from the following file: