hipsparsesbsrsv2_solve Interface Reference#
Sparse triangular solve using the BSR storage format. More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsesbsrsv2_solve_ (handle, dira, transa, mb, nnzb, alpha, descra, bsrsortedvala, bsrsortedrowptra, bsrsortedcolinda, blockdim, myinfo, f, x, policy, pbuffer) |
| integer(kind(hipsparse_status_success)) function | hipsparsesbsrsv2_solve_rank_0 (handle, dira, transa, mb, nnzb, alpha, descra, bsrsortedvala, bsrsortedrowptra, bsrsortedcolinda, blockdim, myinfo, f, x, policy, pbuffer) |
| integer(kind(hipsparse_status_success)) function | hipsparsesbsrsv2_solve_rank_1 (handle, dira, transa, mb, nnzb, alpha, descra, bsrsortedvala, bsrsortedrowptra, bsrsortedcolinda, blockdim, myinfo, f, x, policy, pbuffer) |
Detailed Description
Sparse triangular solve using the 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
\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\% A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \end{array} \right. \]
Performing the above operation requires three steps. First, the user calls hipsparseSbsrsv2_bufferSize "hipsparseXbsrsv2_bufferSize()", which will determine the size of the required temporary storage buffer. The user then allocates this buffer and calls hipsparseSbsrsv2_analysis "hipsparseXbsrsv2_analysis()", which will perform analysis on the sparse matrix \(op(A)\). Finally, the user completes the computation by calling hipsparseXbsrsv2_solve. The buffer size, buffer allocation, and analysis only need to be called once for a given sparse matrix \(op(A)\), while the computation stage can be repeatedly used with different \(x\) and \(y\) vectors. After all calls to hipsparseXbsrsv2_solve are complete, the temporary buffer can be deallocated.
Solving a triangular system involves inverting the diagonal blocks. This means that if the sparse matrix is missing the diagonal block (referred to as a structural zero) or the diagonal block is not invertible (referred to as a numerical zero) then a solution is not possible. hipsparseXbsrsv2_solve tracks the location of the first zero pivot (either numerical or structural zero). The zero pivot status can be checked calling hipsparseXbsrsv2_zeroPivot (). If hipsparseXbsrsv2_zeroPivot () returns HIPSPARSE_STATUS_SUCCESS, then no zero pivot was found and therefore the matrix does not have a structural or numerical zero.
The user can specify that the sparse matrix should be interpreted as having identity blocks on the diagonal by setting the diagonal type on the descriptor descrA to HIPSPARSE_DIAG_TYPE_UNIT using hipsparseSetMatDiagType. If hipsparseDiagType_t == HIPSPARSE_DIAG_TYPE_UNIT, no zero pivot will be reported, even if the diagonal block \(A_{j,j}\) for some \(j\) is not invertible.
The sparse CSR matrix passed to hipsparseXbsrsv2_solve does not actually have to be a triangular matrix. Instead, the triangular upper or lower part of the sparse matrix is solved based on hipsparseFillMode_t set on the descriptor descrA. If the fill mode is set to HIPSPARSE_FILL_MODE_LOWER, then the lower triangular matrix is solved. If the fill mode is set to HIPSPARSE_FILL_MODE_UPPER, then the upper triangular matrix is solved.
- Note
- The sparse BSR matrix has to be sorted.
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
-
Currently, only
transA==HIPSPARSE_OPERATION_NON_TRANSPOSEandtransA==HIPSPARSE_OPERATION_TRANSPOSEis supported.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] dirA - matrix storage of BSR blocks. [in] transA - matrix operation type. [in] mb - number of block rows of the sparse BSR matrix. [in] nnzb - number of non-zero blocks of the sparse BSR matrix. [in] alpha - scalar \(\alpha\). [in] descrA - descriptor of the sparse BSR matrix. [in] bsrSortedValA - array of nnzbblocks of the sparse BSR matrix.[in] bsrSortedRowPtrA - array of mb+1elements that point to the start of every block row of the sparse BSR matrix.[in] bsrSortedColIndA - array of nnzcontaining the block column indices of the sparse BSR matrix.[in] blockDim - block dimension of the sparse BSR matrix. [in] myInfo - structure that holds the information collected during the analysis step. [in] f - array of melements, holding the right-hand side.[out] x - array of melements, holding the solution.[in] policy - HIPSPARSE_SOLVE_POLICY_NO_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.[in] pBuffer - temporary storage buffer allocated by the user.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle,mb,nnzb,blockDim,descrA,alpha,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,f, orxis invalid.HIPSPARSE_STATUS_ARCH_MISMATCH the device is not supported. HIPSPARSE_STATUS_INTERNAL_ERROR an internal error occurred. HIPSPARSE_STATUS_NOT_SUPPORTED transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
Member Function/Subroutine Documentation
◆ hipsparsesbsrsv2_solve_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrsv2_solve::hipsparsesbsrsv2_solve_ | ( | type(c_ptr), value | handle, |
| integer(kind(hipsparse_direction_row)), value | dira, | ||
| integer(kind(hipsparse_operation_non_transpose)), value | transa, | ||
| integer(c_int), value | mb, | ||
| integer(c_int), value | nnzb, | ||
| real(c_float) | alpha, | ||
| type(c_ptr), value | descra, | ||
| type(c_ptr), value | bsrsortedvala, | ||
| type(c_ptr), value | bsrsortedrowptra, | ||
| type(c_ptr), value | bsrsortedcolinda, | ||
| integer(c_int), value | blockdim, | ||
| type(c_ptr), value | myinfo, | ||
| type(c_ptr), value | f, | ||
| type(c_ptr), value | x, | ||
| integer(kind(hipsparse_solve_policy_no_level)), value | policy, | ||
| type(c_ptr), value | pbuffer | ||
| ) |
◆ hipsparsesbsrsv2_solve_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrsv2_solve::hipsparsesbsrsv2_solve_rank_0 | ( | type(c_ptr) | handle, |
| integer(kind(hipsparse_direction_row)) | dira, | ||
| integer(kind(hipsparse_operation_non_transpose)) | transa, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nnzb, | ||
| real(c_float) | alpha, | ||
| type(c_ptr) | descra, | ||
| real(c_float), target | bsrsortedvala, | ||
| integer(c_int), target | bsrsortedrowptra, | ||
| integer(c_int), target | bsrsortedcolinda, | ||
| integer(c_int) | blockdim, | ||
| type(c_ptr) | myinfo, | ||
| real(c_float), target | f, | ||
| real(c_float), target | x, | ||
| integer(kind(hipsparse_solve_policy_no_level)) | policy, | ||
| type(c_ptr) | pbuffer | ||
| ) |
◆ hipsparsesbsrsv2_solve_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesbsrsv2_solve::hipsparsesbsrsv2_solve_rank_1 | ( | type(c_ptr) | handle, |
| integer(kind(hipsparse_direction_row)) | dira, | ||
| integer(kind(hipsparse_operation_non_transpose)) | transa, | ||
| integer(c_int) | mb, | ||
| integer(c_int) | nnzb, | ||
| real(c_float) | alpha, | ||
| type(c_ptr) | descra, | ||
| real(c_float), dimension(:), target | bsrsortedvala, | ||
| integer(c_int), dimension(:), target | bsrsortedrowptra, | ||
| integer(c_int), dimension(:), target | bsrsortedcolinda, | ||
| integer(c_int) | blockdim, | ||
| type(c_ptr) | myinfo, | ||
| real(c_float), dimension(:), target | f, | ||
| real(c_float), dimension(:), target | x, | ||
| integer(kind(hipsparse_solve_policy_no_level)) | policy, | ||
| type(c_ptr) | pbuffer | ||
| ) |
The documentation for this interface was generated from the following file: