Skip to main content

cusparseDbsrsv2_analysis

Function cusparseDbsrsv2_analysis 

Source
pub unsafe extern "C" fn cusparseDbsrsv2_analysis(
    handle: cusparseHandle_t,
    dirA: cusparseDirection_t,
    transA: cusparseOperation_t,
    mb: c_int,
    nnzb: c_int,
    descrA: cusparseMatDescr_t,
    bsrSortedValA: *const f64,
    bsrSortedRowPtrA: *const c_int,
    bsrSortedColIndA: *const c_int,
    blockDim: c_int,
    info: bsrsv2Info_t,
    policy: cusparseSolvePolicy_t,
    pBuffer: *mut c_void,
) -> cusparseStatus_t
Expand description

This function performs the analysis phase of bsrsv2, a new sparse triangular linear system op(A)*y =$\alpha$x.

A is an (mb*blockDim)x(mb*blockDim) sparse matrix that is defined in BSR storage format by the three arrays bsrValA, bsrRowPtrA, and bsrColIndA); x and y are the right-hand side and the solution vectors; $\alpha$ is a scalar; and: $$ \operatorname{op}(A) = \begin{cases} A & \text{if } trans = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \ A^T & \text{if } trans = \text{CUSPARSE_OPERATION_TRANSPOSE} \ A^H & \text{if } trans = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{cases} $$

The block of BSR format is of size blockDim*blockDim, stored as column-major or row-major as determined by parameter dirA, which is either cusparseDirection_t::CUSPARSE_DIRECTION_COLUMN or cusparseDirection_t::CUSPARSE_DIRECTION_ROW. The matrix type must be cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL, and the fill mode and diagonal type are ignored.

It is expected that this function will be executed only once for a given matrix and a particular operation type.

This function requires a buffer size returned by bsrsv2_bufferSize(). The address of pBuffer must be multiple of 128 bytes. If it is not, cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE is returned.

Function bsrsv2_analysis() reports a structural zero and computes level information, which stored in the opaque structure info. The level information can extract more parallelism for a triangular solver. However bsrsv2_solve() can be done without level information. To disable level information, the user needs to specify the policy of the triangular solver as cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL.

Function bsrsv2_analysis() always reports the first structural zero, even when parameter policy is cusparseSolvePolicy_t::CUSPARSE_SOLVE_POLICY_NO_LEVEL. No structural zero is reported if cusparseDiagType_t::CUSPARSE_DIAG_TYPE_UNIT is specified, even if block A(j,j) is missing for some j. The user needs to call cusparseXbsrsv2_zeroPivot to know where the structural zero is.

It is the user’s choice whether to call bsrsv2_solve() if bsrsv2_analysis() reports a structural zero. In this case, the user can still call bsrsv2_solve(), which will return a numerical zero at the same position as a structural zero. However the result x is meaningless.

  • This function requires temporary extra storage that is allocated internally
  • The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available
  • The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.