hipsparsesgebsr2csr Interface Reference#
Convert a sparse GEBSR matrix into a sparse CSR matrix. More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsesgebsr2csr_ (handle, dira, mb, nb, descra, bsrvala, bsrrowptra, bsrcolinda, rowblockdim, colblockdim, descrc, csrvalc, csrrowptrc, csrcolindc) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgebsr2csr_rank_0 (handle, dira, mb, nb, descra, bsrvala, bsrrowptra, bsrcolinda, rowblockdim, colblockdim, descrc, csrvalc, csrrowptrc, csrcolindc) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgebsr2csr_rank_1 (handle, dira, mb, nb, descra, bsrvala, bsrrowptra, bsrcolinda, rowblockdim, colblockdim, descrc, csrvalc, csrrowptrc, csrcolindc) |
Detailed Description
Convert a sparse GEBSR matrix into a sparse CSR matrix.
hipsparseXgebsr2csr converts a GEBSR matrix into a CSR matrix. It is assumed that csrValC, csrColIndC, and csrRowPtrC are already allocated prior to calling hipsparseXgebsr2csr. Allocation size for csrRowPtrC equals m+1 where:
\[ \begin{align} \text{m} &= \text{mb * rowBlockDim} \\% \text{n} &= \text{nb * colBlockDim} \end{align} \]
Allocation size for csrValC and csrColIndC is computed by the the number of blocks in the GEBSR matrix, nnzb, multiplied by the product of the block dimensions, that is, nnz=nnzb*rocBlockDim*colBlockDim.
For example, given the GEBSR matrix:
\[ \left[ \begin{array}{c | c | c} \begin{array}{c c} 6 & 2 \\% 1 & 4 \\% 5 & 4 \end{array} & \begin{array}{c c} 0 & 3 \\% 5 & 0 \\% 0 & 7 \end{array} & \begin{array}{c c} 0 & 0 \\% 0 & 0 \\% 0 & 0 \end{array} \\% \hline \begin{array}{c c} 0 & 0 \\% 0 & 0 \\% 0 & 0 \end{array} & \begin{array}{c c} 3 & 0 \\% 0 & 0 \\% 0 & 7 \end{array} & \begin{array}{c c} 2 & 2 \\% 4 & 3 \\% 1 & 4 \end{array} \\% \end{array} \right] \]
- Note
- 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] dirA - the storage format of the blocks, HIPSPARSE_DIRECTION_ROWorHIPSPARSE_DIRECTION_COLUMN.[in] mb - number of block rows in the sparse general BSR matrix. [in] nb - number of block columns in the sparse general BSR matrix. [in] descrA - descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERALis supported.[in] bsrValA - array of nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.[in] bsrRowPtrA - array of mb+1elements that point to the start of every block row of the sparse BSR matrix.[in] bsrColIndA - array of nnzbelements containing the block column indices of the sparse BSR matrix.[in] rowBlockDim - row size of the blocks in the sparse general BSR matrix. [in] colBlockDim - column size of the blocks in the sparse general BSR matrix. [in] descrC - descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERALis supported.[out] csrValC - array of nnzb*rowBlockDim*colBlockDimelements containing the values of the sparse CSR matrix.[out] csrRowPtrC - array of m+1wherem=mb*rowBlockDimelements that point to the start of every row of the sparse CSR matrix.[out] csrColIndC - array of nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle,mb,nb,block_dim,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC, orcsrColIndCpointer is invalid.
Member Function/Subroutine Documentation
◆ hipsparsesgebsr2csr_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgebsr2csr::hipsparsesgebsr2csr_ | ( | type(c_ptr), value | handle, |
| integer(kind(hipsparse_direction_row)), value | dira, | ||
| integer(c_int), value | mb, | ||
| integer(c_int), value | nb, | ||
| type(c_ptr), value | descra, | ||
| type(c_ptr), value | bsrvala, | ||
| type(c_ptr), value | bsrrowptra, | ||
| type(c_ptr), value | bsrcolinda, | ||
| integer(c_int), value | rowblockdim, | ||
| integer(c_int), value | colblockdim, | ||
| type(c_ptr), value | descrc, | ||
| type(c_ptr), value | csrvalc, | ||
| type(c_ptr), value | csrrowptrc, | ||
| type(c_ptr), value | csrcolindc | ||
| ) |
◆ hipsparsesgebsr2csr_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgebsr2csr::hipsparsesgebsr2csr_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(hipsparse_direction_row)) | dira, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| type(c_ptr) | descra, | ||
| real(c_float), target | bsrvala, | ||
| integer(c_int), target | bsrrowptra, | ||
| integer(c_int), target | bsrcolinda, | ||
| integer(c_int) | rowblockdim, | ||
| integer(c_int) | colblockdim, | ||
| type(c_ptr) | descrc, | ||
| real(c_float), target | csrvalc, | ||
| integer(c_int), target | csrrowptrc, | ||
| integer(c_int), target | csrcolindc | ||
| ) |
◆ hipsparsesgebsr2csr_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgebsr2csr::hipsparsesgebsr2csr_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(hipsparse_direction_row)) | dira, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nb, | ||
| type(c_ptr) | descra, | ||
| real(c_float), dimension(:), target | bsrvala, | ||
| integer(c_int), dimension(:), target | bsrrowptra, | ||
| integer(c_int), dimension(:), target | bsrcolinda, | ||
| integer(c_int) | rowblockdim, | ||
| integer(c_int) | colblockdim, | ||
| type(c_ptr) | descrc, | ||
| real(c_float), dimension(:), target | csrvalc, | ||
| integer(c_int), dimension(:), target | csrrowptrc, | ||
| integer(c_int), dimension(:), target | csrcolindc | ||
| ) |
The documentation for this interface was generated from the following file: