rocm.bindings.hipsparse

Contents

rocm.bindings.hipsparse#

2026-09-24

853 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

hipsparseBfloat16

(No short description)

hipsparseFloat16

(No short description)

bsrsv2Info

(No short description)

bsrsm2Info

(No short description)

bsrilu02Info

(No short description)

bsric02Info

(No short description)

csrsv2Info

(No short description)

csrsm2Info

(No short description)

csrilu02Info

(No short description)

csric02Info

(No short description)

csrgemm2Info

(No short description)

pruneInfo

(No short description)

csru2csrInfo

(No short description)

hipsparseStatus_t

(No short description)

hipsparsePointerMode_t

Indicates whether the pointer is a device pointer or host pointer.

hipsparseAction_t

Specify where the operation is performed.

hipsparseMatrixType_t

Specify the matrix type.

hipsparseFillMode_t

Specify the matrix fill mode.

hipsparseDiagType_t

Indicates if the diagonal entries are unity.

hipsparseIndexBase_t

Specify the matrix index base.

hipsparseOperation_t

Specify whether the matrix is to be transposed or not.

hipsparseHybPartition_t

HYB matrix partitioning type.

hipsparseSolvePolicy_t

Specify policy in triangular solvers and factorizations.

hipsparseSideMode_t

(No short description)

hipsparseDirection_t

Specify the matrix direction.

hipsparseCsr2CscAlg_t

(No short description)

hipsparseSpMatDescr_st

(No short description)

hipsparseSpGEMMDescr

(No short description)

hipsparseSpSVDescr

(No short description)

hipsparseSpSMDescr

(No short description)

hipsparseFormat_t

(No short description)

hipsparseOrder_t

(No short description)

hipsparseIndexType_t

(No short description)

hipsparseSpMVAlg_t

(No short description)

hipsparseSpMMAlg_t

(No short description)

hipsparseSparseToDenseAlg_t

(No short description)

hipsparseDenseToSparseAlg_t

(No short description)

hipsparseSDDMMAlg_t

(No short description)

hipsparseSpSVAlg_t

(No short description)

hipsparseSpSMAlg_t

(No short description)

hipsparseSpMatAttribute_t

(No short description)

hipsparseSpGEMMAlg_t

(No short description)

Functions#

has_symbol(→ bool)

hipsparseCreate()

Create a hipSPARSE handle.

hipsparseDestroy(handle)

Destroy a hipSPARSE handle.

hipsparseGetErrorName(status)

Return the string representation of a hipSPARSE status's matching backend status enum name

hipsparseGetErrorString(status)

Return the hipSPARSE status's matching backend status description as a string

hipsparseGetVersion(handle, version)

Get the hipSPARSE version.

hipsparseGetGitRevision(handle, rev)

Get the hipSPARSE git revision.

hipsparseSetStream(handle, streamId)

Specify the user-defined HIP stream.

hipsparseGetStream(handle)

Get the current stream from the library context.

hipsparseSetPointerMode(handle, mode)

Specify the pointer mode.

hipsparseGetPointerMode(handle, mode)

Get the current pointer mode from the library context.

hipsparseCreateMatDescr()

Create a matrix descriptor.

hipsparseDestroyMatDescr(descrA)

Destroy a matrix descriptor.

hipsparseCopyMatDescr(dest, src)

Copy a matrix descriptor.

hipsparseSetMatType(descrA, type)

Specify the matrix type of a matrix descriptor.

hipsparseGetMatType(descrA)

Get the matrix type of a matrix descriptor.

hipsparseSetMatFillMode(descrA, fillMode)

Specify the matrix fill mode of a matrix descriptor.

hipsparseGetMatFillMode(descrA)

Get the matrix fill mode of a matrix descriptor.

hipsparseSetMatDiagType(descrA, diagType)

Specify the matrix diagonal type of a matrix descriptor.

hipsparseGetMatDiagType(descrA)

Get the matrix diagonal type of a matrix descriptor.

hipsparseSetMatIndexBase(descrA, base)

Specify the index base of a matrix descriptor.

hipsparseGetMatIndexBase(descrA)

Get the index base of a matrix descriptor.

hipsparseCreateHybMat()

Create a HYB matrix structure.

hipsparseDestroyHybMat(hybA)

Destroy a HYB matrix structure.

hipsparseCreateBsrsv2Info()

Create a bsrsv2 info structure.

hipsparseDestroyBsrsv2Info(info)

Destroy a bsrsv2 info structure.

hipsparseCreateBsrsm2Info()

Create a bsrsm2 info structure.

hipsparseDestroyBsrsm2Info(info)

Destroy a bsrsm2 info structure.

hipsparseCreateBsrilu02Info()

Create a bsrilu02 info structure.

hipsparseDestroyBsrilu02Info(info)

Destroy a bsrilu02 info structure

hipsparseCreateBsric02Info()

Create a bsric02 info structure.

hipsparseDestroyBsric02Info(info)

Destroy a bsric02 info structure.

hipsparseCreateCsrsv2Info()

Create a csrsv2 info structure.

hipsparseDestroyCsrsv2Info(info)

Destroy a csrsv2 info structure.

hipsparseCreateCsrsm2Info()

Create a csrsm2 info structure.

hipsparseDestroyCsrsm2Info(info)

Destroy a csrsm2 info structure.

hipsparseCreateCsrilu02Info()

Create a csrilu02 info structure.

hipsparseDestroyCsrilu02Info(info)

Destroy a csrilu02 info structure.

hipsparseCreateCsric02Info()

Create a csric02 info structure.

hipsparseDestroyCsric02Info(info)

Destroy a csric02 info structure.

hipsparseCreateCsru2csrInfo()

Create a csru2csr info structure.

hipsparseDestroyCsru2csrInfo(info)

Destroy a csru2csr info structure.

hipsparseCreateColorInfo()

Create a color info structure.

hipsparseDestroyColorInfo(info)

Destroy a color info structure.

hipsparseCreateCsrgemm2Info()

Create a csrgemm2 info structure.

hipsparseDestroyCsrgemm2Info(info)

Destroy a csrgemm2 info structure.

hipsparseCreatePruneInfo()

Create a prune info structure.

hipsparseDestroyPruneInfo(info)

Destroy a prune info structure

hipsparseSaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)

Scale a sparse vector and add it to a dense vector.

hipsparseDaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)

Scale a sparse vector and add it to a dense vector.

hipsparseCaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)

Scale a sparse vector and add it to a dense vector.

hipsparseZaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)

Scale a sparse vector and add it to a dense vector.

hipsparseCdotci(handle, nnz, xVal, xInd, y, result, ...)

Compute the dot product of a complex conjugate sparse vector with a dense

hipsparseZdotci(handle, nnz, xVal, xInd, y, result, ...)

Compute the dot product of a complex conjugate sparse vector with a dense

hipsparseSdoti(handle, nnz, xVal, xInd, y, result, idxBase)

Compute the dot product of a sparse vector with a dense vector.

hipsparseDdoti(handle, nnz, xVal, xInd, y, result, idxBase)

Compute the dot product of a sparse vector with a dense vector.

hipsparseCdoti(handle, nnz, xVal, xInd, y, result, idxBase)

Compute the dot product of a sparse vector with a dense vector.

hipsparseZdoti(handle, nnz, xVal, xInd, y, result, idxBase)

Compute the dot product of a sparse vector with a dense vector.

hipsparseSgthr(handle, nnz, y, xVal, xInd, idxBase)

Gather elements from a dense vector and store them in a sparse vector.

hipsparseDgthr(handle, nnz, y, xVal, xInd, idxBase)

Gather elements from a dense vector and store them in a sparse vector.

hipsparseCgthr(handle, nnz, y, xVal, xInd, idxBase)

Gather elements from a dense vector and store them in a sparse vector.

hipsparseZgthr(handle, nnz, y, xVal, xInd, idxBase)

Gather elements from a dense vector and store them in a sparse vector.

hipsparseSgthrz(handle, nnz, y, xVal, xInd, idxBase)

Gather and zero out elements from a dense vector and store them in a sparse

hipsparseDgthrz(handle, nnz, y, xVal, xInd, idxBase)

Gather and zero out elements from a dense vector and store them in a sparse

hipsparseCgthrz(handle, nnz, y, xVal, xInd, idxBase)

Gather and zero out elements from a dense vector and store them in a sparse

hipsparseZgthrz(handle, nnz, y, xVal, xInd, idxBase)

Gather and zero out elements from a dense vector and store them in a sparse

hipsparseSroti(handle, nnz, xVal, xInd, y, c, s, idxBase)

Apply the Givens rotation to a dense and a sparse vector.

hipsparseDroti(handle, nnz, xVal, xInd, y, c, s, idxBase)

Apply the Givens rotation to a dense and a sparse vector.

hipsparseSsctr(handle, nnz, xVal, xInd, y, idxBase)

Scatter elements from a dense vector across a sparse vector.

hipsparseDsctr(handle, nnz, xVal, xInd, y, idxBase)

Scatter elements from a dense vector across a sparse vector.

hipsparseCsctr(handle, nnz, xVal, xInd, y, idxBase)

Scatter elements from a dense vector across a sparse vector.

hipsparseZsctr(handle, nnz, xVal, xInd, y, idxBase)

Scatter elements from a dense vector across a sparse vector.

hipsparseSbsrmv(handle, dirA, transA, mb, nb, nnzb, ...)

Sparse matrix vector multiplication using the BSR storage format.

hipsparseDbsrmv(handle, dirA, transA, mb, nb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseCbsrmv(handle, dirA, transA, mb, nb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseZbsrmv(handle, dirA, transA, mb, nb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseXbsrsv2_zeroPivot(handle, info, position)

hipsparseXbsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseSbsrsv2_bufferSize(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseDbsrsv2_bufferSize(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseCbsrsv2_bufferSize(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseZbsrsv2_bufferSize(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseSbsrsv2_bufferSizeExt(handle, dirA, transA, ...)

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseDbsrsv2_bufferSizeExt(handle, dirA, transA, ...)

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseCbsrsv2_bufferSizeExt(handle, dirA, transA, ...)

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseZbsrsv2_bufferSizeExt(handle, dirA, transA, ...)

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseSbsrsv2_analysis(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve

hipsparseDbsrsv2_analysis(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve

hipsparseCbsrsv2_analysis(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve

hipsparseZbsrsv2_analysis(handle, dirA, transA, mb, ...)

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve

hipsparseSbsrsv2_solve(handle, dirA, transA, mb, nnzb, ...)

Sparse triangular solve using the BSR storage format.

hipsparseDbsrsv2_solve(handle, dirA, transA, mb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseCbsrsv2_solve(handle, dirA, transA, mb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseZbsrsv2_solve(handle, dirA, transA, mb, nnzb, ...)

(No short description, might be part of a group.)

hipsparseSbsrxmv(handle, dir, trans, sizeOfMask, mb, ...)

Sparse matrix vector multiplication with mask operation using the BSR storage format.

hipsparseDbsrxmv(handle, dir, trans, sizeOfMask, mb, ...)

(No short description, might be part of a group.)

hipsparseCbsrxmv(handle, dir, trans, sizeOfMask, mb, ...)

(No short description, might be part of a group.)

hipsparseZbsrxmv(handle, dir, trans, sizeOfMask, mb, ...)

(No short description, might be part of a group.)

hipsparseScsrmv(handle, transA, m, n, nnz, alpha, ...)

Sparse matrix vector multiplication using the CSR storage format.

hipsparseDcsrmv(handle, transA, m, n, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseCcsrmv(handle, transA, m, n, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseZcsrmv(handle, transA, m, n, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseXcsrsv2_zeroPivot(handle, info, position)

hipsparseXcsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseScsrsv2_bufferSize(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseDcsrsv2_bufferSize(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseCcsrsv2_bufferSize(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseZcsrsv2_bufferSize(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseScsrsv2_bufferSizeExt(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseDcsrsv2_bufferSizeExt(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseCcsrsv2_bufferSizeExt(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseZcsrsv2_bufferSizeExt(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes

hipsparseScsrsv2_analysis(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_analysis performs the analysis step for

hipsparseDcsrsv2_analysis(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_analysis performs the analysis step for

hipsparseCcsrsv2_analysis(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_analysis performs the analysis step for

hipsparseZcsrsv2_analysis(handle, transA, m, nnz, ...)

hipsparseXcsrsv2_analysis performs the analysis step for

hipsparseScsrsv2_solve(handle, transA, m, nnz, alpha, ...)

Sparse triangular solve using the CSR storage format

hipsparseDcsrsv2_solve(handle, transA, m, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseCcsrsv2_solve(handle, transA, m, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseZcsrsv2_solve(handle, transA, m, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseSgemvi_bufferSize(handle, transA, m, n, nnz, ...)

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseDgemvi_bufferSize(handle, transA, m, n, nnz, ...)

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseCgemvi_bufferSize(handle, transA, m, n, nnz, ...)

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseZgemvi_bufferSize(handle, transA, m, n, nnz, ...)

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseSgemvi(handle, transA, m, n, alpha, A, lda, ...)

Dense matrix sparse vector multiplication

hipsparseDgemvi(handle, transA, m, n, alpha, A, lda, ...)

(No short description, might be part of a group.)

hipsparseCgemvi(handle, transA, m, n, alpha, A, lda, ...)

(No short description, might be part of a group.)

hipsparseZgemvi(handle, transA, m, n, alpha, A, lda, ...)

(No short description, might be part of a group.)

hipsparseShybmv(handle, transA, alpha, descrA, hybA, ...)

Sparse matrix vector multiplication using the HYB storage format.

hipsparseDhybmv(handle, transA, alpha, descrA, hybA, ...)

(No short description, might be part of a group.)

hipsparseChybmv(handle, transA, alpha, descrA, hybA, ...)

(No short description, might be part of a group.)

hipsparseZhybmv(handle, transA, alpha, descrA, hybA, ...)

(No short description, might be part of a group.)

hipsparseSbsrmm(handle, dirA, transA, transB, mb, n, ...)

Sparse matrix dense matrix multiplication using the BSR storage format.

hipsparseDbsrmm(handle, dirA, transA, transB, mb, n, ...)

(No short description, might be part of a group.)

hipsparseCbsrmm(handle, dirA, transA, transB, mb, n, ...)

(No short description, might be part of a group.)

hipsparseZbsrmm(handle, dirA, transA, transB, mb, n, ...)

(No short description, might be part of a group.)

hipsparseXbsrsm2_zeroPivot(handle, info, position)

hipsparseXbsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseSbsrsm2_bufferSize(handle, dirA, transA, ...)

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes

hipsparseDbsrsm2_bufferSize(handle, dirA, transA, ...)

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes

hipsparseCbsrsm2_bufferSize(handle, dirA, transA, ...)

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes

hipsparseZbsrsm2_bufferSize(handle, dirA, transA, ...)

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes

hipsparseSbsrsm2_analysis(handle, dirA, transA, ...)

Sparse triangular system solve using the BSR storage format.

hipsparseDbsrsm2_analysis(handle, dirA, transA, ...)

Sparse triangular system solve using the BSR storage format.

hipsparseCbsrsm2_analysis(handle, dirA, transA, ...)

Sparse triangular system solve using the BSR storage format.

hipsparseZbsrsm2_analysis(handle, dirA, transA, ...)

Sparse triangular system solve using the BSR storage format.

hipsparseSbsrsm2_solve(handle, dirA, transA, transX, ...)

Sparse triangular system solve using the BSR storage format.

hipsparseDbsrsm2_solve(handle, dirA, transA, transX, ...)

(No short description, might be part of a group.)

hipsparseCbsrsm2_solve(handle, dirA, transA, transX, ...)

(No short description, might be part of a group.)

hipsparseZbsrsm2_solve(handle, dirA, transA, transX, ...)

(No short description, might be part of a group.)

hipsparseScsrmm(handle, transA, m, n, k, nnz, alpha, ...)

Sparse matrix dense matrix multiplication using the CSR storage format.

hipsparseDcsrmm(handle, transA, m, n, k, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseCcsrmm(handle, transA, m, n, k, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseZcsrmm(handle, transA, m, n, k, nnz, alpha, ...)

(No short description, might be part of a group.)

hipsparseScsrmm2(handle, transA, transB, m, n, k, nnz, ...)

Sparse matrix dense matrix multiplication using the CSR storage format.

hipsparseDcsrmm2(handle, transA, transB, m, n, k, nnz, ...)

(No short description, might be part of a group.)

hipsparseCcsrmm2(handle, transA, transB, m, n, k, nnz, ...)

(No short description, might be part of a group.)

hipsparseZcsrmm2(handle, transA, transB, m, n, k, nnz, ...)

(No short description, might be part of a group.)

hipsparseXcsrsm2_zeroPivot(handle, info, position)

hipsparseXcsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseScsrsm2_bufferSizeExt(handle, algo, transA, ...)

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDcsrsm2_bufferSizeExt(handle, algo, transA, ...)

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCcsrsm2_bufferSizeExt(handle, algo, transA, ...)

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZcsrsm2_bufferSizeExt(handle, algo, transA, ...)

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseScsrsm2_analysis(handle, algo, transA, ...)

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve

hipsparseDcsrsm2_analysis(handle, algo, transA, ...)

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve

hipsparseCcsrsm2_analysis(handle, algo, transA, ...)

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve

hipsparseZcsrsm2_analysis(handle, algo, transA, ...)

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve

hipsparseScsrsm2_solve(handle, algo, transA, transB, ...)

Sparse triangular system solve using the CSR storage format

hipsparseDcsrsm2_solve(handle, algo, transA, transB, ...)

(No short description, might be part of a group.)

hipsparseCcsrsm2_solve(handle, algo, transA, transB, ...)

(No short description, might be part of a group.)

hipsparseZcsrsm2_solve(handle, algo, transA, transB, ...)

(No short description, might be part of a group.)

hipsparseSgemmi(handle, m, n, k, nnz, alpha, A, lda, ...)

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseDgemmi(handle, m, n, k, nnz, alpha, A, lda, ...)

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseCgemmi(handle, m, n, k, nnz, alpha, A, lda, ...)

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseZgemmi(handle, m, n, k, nnz, alpha, A, lda, ...)

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseXcsrgeamNnz(handle, m, n, descrA, nnzA, ...)

hipsparseXcsrgeamNnz computes the total CSR non-zero elements and the CSR row

hipsparseScsrgeam(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseDcsrgeam(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseCcsrgeam(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseZcsrgeam(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseScsrgeam2_bufferSizeExt(handle, m, n, alpha, ...)

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDcsrgeam2_bufferSizeExt(handle, m, n, alpha, ...)

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCcsrgeam2_bufferSizeExt(handle, m, n, alpha, ...)

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZcsrgeam2_bufferSizeExt(handle, m, n, alpha, ...)

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseXcsrgeam2Nnz(handle, m, n, descrA, nnzA, ...)

hipsparseXcsrgeam2Nnz computes the total CSR non-zero elements and the CSR row

hipsparseScsrgeam2(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseDcsrgeam2(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseCcsrgeam2(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseZcsrgeam2(handle, m, n, alpha, descrA, nnzA, ...)

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgemmNnz(handle, transA, transB, m, n, k, ...)

hipsparseXcsrgemmNnz computes the total CSR non-zero elements and the CSR row

hipsparseScsrgemm(handle, transA, transB, m, n, k, ...)

Sparse matrix and sparse matrix multiplication using the CSR storage format.

hipsparseDcsrgemm(handle, transA, transB, m, n, k, ...)

(No short description, might be part of a group.)

hipsparseCcsrgemm(handle, transA, transB, m, n, k, ...)

(No short description, might be part of a group.)

hipsparseZcsrgemm(handle, transA, transB, m, n, k, ...)

(No short description, might be part of a group.)

hipsparseScsrgemm2_bufferSizeExt(handle, m, n, k, ...)

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDcsrgemm2_bufferSizeExt(handle, m, n, k, ...)

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCcsrgemm2_bufferSizeExt(handle, m, n, k, ...)

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZcsrgemm2_bufferSizeExt(handle, m, n, k, ...)

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseXcsrgemm2Nnz(handle, m, n, k, descrA, nnzA, ...)

hipsparseXcsrgemm2Nnz computes the total CSR non-zero elements and the CSR row

hipsparseScsrgemm2(handle, m, n, k, alpha, descrA, ...)

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseDcsrgemm2(handle, m, n, k, alpha, descrA, ...)

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseCcsrgemm2(handle, m, n, k, alpha, descrA, ...)

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseZcsrgemm2(handle, m, n, k, alpha, descrA, ...)

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseXbsric02_zeroPivot(handle, info, position)

hipsparseXbsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseSbsric02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer

hipsparseDbsric02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer

hipsparseCbsric02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer

hipsparseZbsric02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer

hipsparseSbsric02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02

hipsparseDbsric02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02

hipsparseCbsric02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02

hipsparseZbsric02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02

hipsparseSbsric02(handle, dirA, mb, nnzb, descrA, ...)

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR

hipsparseDbsric02(handle, dirA, mb, nnzb, descrA, ...)

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR

hipsparseCbsric02(handle, dirA, mb, nnzb, descrA, ...)

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR

hipsparseZbsric02(handle, dirA, mb, nnzb, descrA, ...)

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR

hipsparseXbsrilu02_zeroPivot(handle, info, position)

hipsparseXbsrilu02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseSbsrilu02_numericBoost(handle, info, ...)

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseDbsrilu02_numericBoost(handle, info, ...)

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseCbsrilu02_numericBoost(handle, info, ...)

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseZbsrilu02_numericBoost(handle, info, ...)

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseSbsrilu02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseDbsrilu02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseCbsrilu02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseZbsrilu02_bufferSize(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseSbsrilu02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02

hipsparseDbsrilu02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02

hipsparseCbsrilu02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02

hipsparseZbsrilu02_analysis(handle, dirA, mb, nnzb, ...)

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02

hipsparseSbsrilu02(handle, dirA, mb, nnzb, descrA, ...)

Incomplete LU factorization with 0 fill-ins and no pivoting using the BSR storage

hipsparseDbsrilu02(handle, dirA, mb, nnzb, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseCbsrilu02(handle, dirA, mb, nnzb, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseZbsrilu02(handle, dirA, mb, nnzb, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseXcsric02_zeroPivot(handle, info, position)

hipsparseXcsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseScsric02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseDcsric02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseCcsric02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseZcsric02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes

hipsparseScsric02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDcsric02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCcsric02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZcsric02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseScsric02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02

hipsparseDcsric02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02

hipsparseCcsric02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02

hipsparseZcsric02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02

hipsparseScsric02(handle, m, nnz, descrA, ...)

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the CSR

hipsparseDcsric02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseCcsric02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseZcsric02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseXcsrilu02_zeroPivot(handle, info, position)

hipsparseXcsrilu02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a

hipsparseScsrilu02_numericBoost(handle, info, ...)

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseDcsrilu02_numericBoost(handle, info, ...)

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseCcsrilu02_numericBoost(handle, info, ...)

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseZcsrilu02_numericBoost(handle, info, ...)

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in

hipsparseScsrilu02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseDcsrilu02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseCcsrilu02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseZcsrilu02_bufferSize(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer

hipsparseScsrilu02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDcsrilu02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCcsrilu02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZcsrilu02_bufferSizeExt(handle, m, nnz, ...)

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer

hipsparseScsrilu02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02

hipsparseDcsrilu02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02

hipsparseCcsrilu02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02

hipsparseZcsrilu02_analysis(handle, m, nnz, descrA, ...)

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02

hipsparseScsrilu02(handle, m, nnz, descrA, ...)

Incomplete LU factorization with 0 fill-ins and no pivoting using the CSR

hipsparseDcsrilu02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseCcsrilu02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseZcsrilu02(handle, m, nnz, descrA, ...)

matrix A values are updated inplace to be the preconditioner M values

hipsparseSgpsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseDgpsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseCgpsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseZgpsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseSgpsvInterleavedBatch(handle, algo, m, ds, ...)

Interleaved batch pentadiagonal solver

hipsparseDgpsvInterleavedBatch(handle, algo, m, ds, ...)

Interleaved batch pentadiagonal solver

hipsparseCgpsvInterleavedBatch(handle, algo, m, ds, ...)

Interleaved batch pentadiagonal solver

hipsparseZgpsvInterleavedBatch(handle, algo, m, ds, ...)

Interleaved batch pentadiagonal solver

hipsparseSgtsv2_bufferSizeExt(handle, m, n, dl, d, du, ...)

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseDgtsv2_bufferSizeExt(handle, m, n, dl, d, du, ...)

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseCgtsv2_bufferSizeExt(handle, m, n, dl, d, du, ...)

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseZgtsv2_bufferSizeExt(handle, m, n, dl, d, du, ...)

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer

hipsparseSgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)

Tridiagonal solver with pivoting

hipsparseDgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)

Tridiagonal solver with pivoting

hipsparseCgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)

Tridiagonal solver with pivoting

hipsparseZgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)

Tridiagonal solver with pivoting

hipsparseSgtsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseDgtsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseCgtsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseZgtsvInterleavedBatch_bufferSizeExt(handle, ...)

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseSgtsvInterleavedBatch(handle, algo, m, dl, d, ...)

Interleaved batch tridiagonal solver.

hipsparseDgtsvInterleavedBatch(handle, algo, m, dl, d, ...)

Interleaved batch tridiagonal solver.

hipsparseCgtsvInterleavedBatch(handle, algo, m, dl, d, ...)

Interleaved batch tridiagonal solver.

hipsparseZgtsvInterleavedBatch(handle, algo, m, dl, d, ...)

Interleaved batch tridiagonal solver.

hipsparseSgtsv2_nopivot_bufferSizeExt(handle, m, n, ...)

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage

hipsparseDgtsv2_nopivot_bufferSizeExt(handle, m, n, ...)

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage

hipsparseCgtsv2_nopivot_bufferSizeExt(handle, m, n, ...)

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage

hipsparseZgtsv2_nopivot_bufferSizeExt(handle, m, n, ...)

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage

hipsparseSgtsv2_nopivot(handle, m, n, dl, d, du, B, ...)

Tridiagonal solver (no pivoting)

hipsparseDgtsv2_nopivot(handle, m, n, dl, d, du, B, ...)

Tridiagonal solver (no pivoting)

hipsparseCgtsv2_nopivot(handle, m, n, dl, d, du, B, ...)

Tridiagonal solver (no pivoting)

hipsparseZgtsv2_nopivot(handle, m, n, dl, d, du, B, ...)

Tridiagonal solver (no pivoting)

hipsparseSgtsv2StridedBatch_bufferSizeExt(handle, m, ...)

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseDgtsv2StridedBatch_bufferSizeExt(handle, m, ...)

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseCgtsv2StridedBatch_bufferSizeExt(handle, m, ...)

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseZgtsv2StridedBatch_bufferSizeExt(handle, m, ...)

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage

hipsparseSgtsv2StridedBatch(handle, m, dl, d, du, x, ...)

Strided batch tridiagonal solver (no pivoting).

hipsparseDgtsv2StridedBatch(handle, m, dl, d, du, x, ...)

Strided batch tridiagonal solver (no pivoting).

hipsparseCgtsv2StridedBatch(handle, m, dl, d, du, x, ...)

Strided batch tridiagonal solver (no pivoting).

hipsparseZgtsv2StridedBatch(handle, m, dl, d, du, x, ...)

Strided batch tridiagonal solver (no pivoting).

hipsparseSbsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseDbsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseCbsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseZbsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseXcoo2csr(handle, cooRowInd, nnz, m, ...)

Convert a sparse COO matrix into a sparse CSR matrix.

hipsparseXcoosort_bufferSizeExt(handle, m, n, nnz, ...)

Sort a sparse COO matrix.

hipsparseXcoosortByRow(handle, m, n, nnz, cooRows, ...)

Sort a sparse COO matrix by row.

hipsparseXcoosortByColumn(handle, m, n, nnz, cooRows, ...)

Sort a sparse COO matrix by column.

hipsparseCreateIdentityPermutation(handle, n, p)

Create the identity map.

hipsparseScsc2dense(handle, m, n, descr, cscVal, ...)

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

hipsparseDcsc2dense(handle, m, n, descr, cscVal, ...)

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

hipsparseCcsc2dense(handle, m, n, descr, cscVal, ...)

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

hipsparseZcsc2dense(handle, m, n, descr, cscVal, ...)

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

hipsparseXcscsort_bufferSizeExt(handle, m, n, nnz, ...)

Sort a sparse CSC matrix.

hipsparseXcscsort(handle, m, n, nnz, descrA, ...)

Sort a sparse CSC matrix

hipsparseXcsr2bsrNnz(handle, dirA, m, n, descrA, ...)

This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse

hipsparseScsr2bsr(handle, dirA, m, n, descrA, csrValA, ...)

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseDcsr2bsr(handle, dirA, m, n, descrA, csrValA, ...)

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseCcsr2bsr(handle, dirA, m, n, descrA, csrValA, ...)

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseZcsr2bsr(handle, dirA, m, n, descrA, csrValA, ...)

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseXcsr2coo(handle, csrRowPtr, nnz, m, ...)

Convert a sparse CSR matrix into a sparse COO matrix.

hipsparseScsr2csc(handle, m, n, nnz, csrSortedVal, ...)

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseDcsr2csc(handle, m, n, nnz, csrSortedVal, ...)

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseCcsr2csc(handle, m, n, nnz, csrSortedVal, ...)

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseZcsr2csc(handle, m, n, nnz, csrSortedVal, ...)

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseCsr2cscEx2_bufferSize(handle, m, n, nnz, ...)

This function computes the size of the user-allocated temporary storage buffer used

hipsparseCsr2cscEx2(handle, m, n, nnz, csrVal, ...)

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseScsr2csr_compress(handle, m, n, descrA, ...)

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseDcsr2csr_compress(handle, m, n, descrA, ...)

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseCcsr2csr_compress(handle, m, n, descrA, ...)

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseZcsr2csr_compress(handle, m, n, descrA, ...)

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseScsr2csru(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the sorted CSR format to the unsorted CSR format. The required

hipsparseDcsr2csru(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the sorted CSR format to the unsorted CSR format. The required

hipsparseCcsr2csru(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the sorted CSR format to the unsorted CSR format. The required

hipsparseZcsr2csru(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the sorted CSR format to the unsorted CSR format. The required

hipsparseScsr2dense(handle, m, n, descr, csrVal, ...)

hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.

hipsparseDcsr2dense(handle, m, n, descr, csrVal, ...)

hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.

hipsparseCcsr2dense(handle, m, n, descr, csrVal, ...)

hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.

hipsparseZcsr2dense(handle, m, n, descr, csrVal, ...)

hipsparseXcsr2dense functions convert the sparse matrix in CSR format into a dense matrix.

hipsparseScsr2gebsr_bufferSize(handle, dir, m, n, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseDcsr2gebsr_bufferSize(handle, dir, m, n, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseCcsr2gebsr_bufferSize(handle, dir, m, n, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseZcsr2gebsr_bufferSize(handle, dir, m, n, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsrNnz(handle, dir, m, n, csr_descr, ...)

This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse

hipsparseScsr2gebsr(handle, dir, m, n, csr_descr, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseDcsr2gebsr(handle, dir, m, n, csr_descr, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseCcsr2gebsr(handle, dir, m, n, csr_descr, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseZcsr2gebsr(handle, dir, m, n, csr_descr, ...)

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseScsr2hyb(handle, m, n, descrA, csrSortedValA, ...)

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseDcsr2hyb(handle, m, n, descrA, csrSortedValA, ...)

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseCcsr2hyb(handle, m, n, descrA, csrSortedValA, ...)

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseZcsr2hyb(handle, m, n, descrA, csrSortedValA, ...)

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseXcsrsort_bufferSizeExt(handle, m, n, nnz, ...)

Sort a sparse CSR matrix.

hipsparseXcsrsort(handle, m, n, nnz, descrA, ...)

Sort a sparse CSR matrix.

hipsparseScsru2csr_bufferSizeExt(handle, m, n, nnz, ...)

This function calculates the amount of temporary storage in bytes required for

hipsparseDcsru2csr_bufferSizeExt(handle, m, n, nnz, ...)

This function calculates the amount of temporary storage in bytes required for

hipsparseCcsru2csr_bufferSizeExt(handle, m, n, nnz, ...)

This function calculates the amount of temporary storage in bytes required for

hipsparseZcsru2csr_bufferSizeExt(handle, m, n, nnz, ...)

This function calculates the amount of temporary storage in bytes required for

hipsparseScsru2csr(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the unsorted CSR format to the sorted CSR format. The required

hipsparseDcsru2csr(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the unsorted CSR format to the sorted CSR format. The required

hipsparseCcsru2csr(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the unsorted CSR format to the sorted CSR format. The required

hipsparseZcsru2csr(handle, m, n, nnz, descrA, csrVal, ...)

This function converts the unsorted CSR format to the sorted CSR format. The required

hipsparseSdense2csc(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

hipsparseDdense2csc(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

hipsparseCdense2csc(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

hipsparseZdense2csc(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

hipsparseSdense2csr(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

hipsparseDdense2csr(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

hipsparseCdense2csr(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

hipsparseZdense2csr(handle, m, n, descr, A, ld, ...)

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

hipsparseSgebsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse GEBSR matrix into a sparse CSR matrix.

hipsparseDgebsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse GEBSR matrix into a sparse CSR matrix.

hipsparseCgebsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse GEBSR matrix into a sparse CSR matrix.

hipsparseZgebsr2csr(handle, dirA, mb, nb, descrA, ...)

Convert a sparse GEBSR matrix into a sparse CSR matrix.

hipsparseSgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseDgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseCgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseZgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseSgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseDgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseCgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseZgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, ...)

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseSgebsr2gebsr_bufferSize(handle, dirA, mb, nb, ...)

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse

hipsparseDgebsr2gebsr_bufferSize(handle, dirA, mb, nb, ...)

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse

hipsparseCgebsr2gebsr_bufferSize(handle, dirA, mb, nb, ...)

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse

hipsparseZgebsr2gebsr_bufferSize(handle, dirA, mb, nb, ...)

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse

hipsparseXgebsr2gebsrNnz(handle, dirA, mb, nb, nnzb, ...)

This function is used when converting a GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

hipsparseSgebsr2gebsr(handle, dirA, mb, nb, nnzb, ...)

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

hipsparseDgebsr2gebsr(handle, dirA, mb, nb, nnzb, ...)

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

hipsparseCgebsr2gebsr(handle, dirA, mb, nb, nnzb, ...)

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

hipsparseZgebsr2gebsr(handle, dirA, mb, nb, nnzb, ...)

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

hipsparseShyb2csr(handle, descrA, hybA, csrSortedValA, ...)

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseDhyb2csr(handle, descrA, hybA, csrSortedValA, ...)

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseChyb2csr(handle, descrA, hybA, csrSortedValA, ...)

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseZhyb2csr(handle, descrA, hybA, csrSortedValA, ...)

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseSnnz(handle, dirA, m, n, descrA, A, lda, ...)

hipsparseXnnz computes the number of non-zero elements per row or column and the total

hipsparseDnnz(handle, dirA, m, n, descrA, A, lda, ...)

hipsparseXnnz computes the number of non-zero elements per row or column and the total

hipsparseCnnz(handle, dirA, m, n, descrA, A, lda, ...)

hipsparseXnnz computes the number of non-zero elements per row or column and the total

hipsparseZnnz(handle, dirA, m, n, descrA, A, lda, ...)

hipsparseXnnz computes the number of non-zero elements per row or column and the total

hipsparseSnnz_compress(handle, m, descrA, csrValA, ...)

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

hipsparseDnnz_compress(handle, m, descrA, csrValA, ...)

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

hipsparseCnnz_compress(handle, m, descrA, csrValA, ...)

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

hipsparseZnnz_compress(handle, m, descrA, csrValA, ...)

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

hipsparseSpruneCsr2csr_bufferSize(handle, m, n, nnzA, ...)

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csr_bufferSize(handle, m, n, nnzA, ...)

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csr_bufferSizeExt(handle, m, n, ...)

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csr_bufferSizeExt(handle, m, n, ...)

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csrNnz(handle, m, n, nnzA, descrA, ...)

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csrNnz(handle, m, n, nnzA, descrA, ...)

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csr(handle, m, n, nnzA, descrA, ...)

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csr(handle, m, n, nnzA, descrA, ...)

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csrByPercentage_bufferSize(handle, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csrByPercentage_bufferSize(handle, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csrByPercentage_bufferSizeExt(...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csrByPercentage_bufferSizeExt(...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csrNnzByPercentage(handle, m, n, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csrNnzByPercentage(handle, m, n, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneCsr2csrByPercentage(handle, m, n, nnzA, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseDpruneCsr2csrByPercentage(handle, m, n, nnzA, ...)

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseSpruneDense2csr_bufferSize(handle, m, n, A, ...)

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer

hipsparseDpruneDense2csr_bufferSize(handle, m, n, A, ...)

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer

hipsparseSpruneDense2csr_bufferSizeExt(handle, m, n, ...)

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer

hipsparseDpruneDense2csr_bufferSizeExt(handle, m, n, ...)

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer

hipsparseSpruneDense2csrNnz(handle, m, n, A, lda, ...)

hipsparseXpruneDense2csrNnz computes the number of non-zero elements per row and the total

hipsparseDpruneDense2csrNnz(handle, m, n, A, lda, ...)

hipsparseXpruneDense2csrNnz computes the number of non-zero elements per row and the total

hipsparseSpruneDense2csr(handle, m, n, A, lda, ...)

hipsparseXpruneDense2csr converts the matrix A in dense format into a sparse matrix in CSR format,

hipsparseDpruneDense2csr(handle, m, n, A, lda, ...)

hipsparseXpruneDense2csr converts the matrix A in dense format into a sparse matrix in CSR format,

hipsparseSpruneDense2csrByPercentage_bufferSize(...)

hipsparseXpruneDense2csrByPercentage_bufferSize functions convert the size of the user-allocated temporary

hipsparseDpruneDense2csrByPercentage_bufferSize(...)

hipsparseXpruneDense2csrByPercentage_bufferSize functions convert the size of the user-allocated temporary

hipsparseSpruneDense2csrByPercentage_bufferSizeExt(...)

This function computes the size of the user-allocated temporary storage buffer used

hipsparseDpruneDense2csrByPercentage_bufferSizeExt(...)

This function computes the size of the user-allocated temporary storage buffer used

hipsparseSpruneDense2csrNnzByPercentage(handle, m, n, ...)

This function computes the number of non-zero elements per row and the total number of

hipsparseDpruneDense2csrNnzByPercentage(handle, m, n, ...)

This function computes the number of non-zero elements per row and the total number of

hipsparseSpruneDense2csrByPercentage(handle, m, n, A, ...)

This function computes the number of non-zero elements per row and the total number of

hipsparseDpruneDense2csrByPercentage(handle, m, n, A, ...)

This function computes the number of non-zero elements per row and the total number of

hipsparseScsrcolor(handle, m, nnz, descrA, csrValA, ...)

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseDcsrcolor(handle, m, nnz, descrA, csrValA, ...)

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseCcsrcolor(handle, m, nnz, descrA, csrValA, ...)

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseZcsrcolor(handle, m, nnz, descrA, csrValA, ...)

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseCreateSpVec(size, nnz, indices, values, ...)

Create a sparse vector.

hipsparseCreateConstSpVec(spVecDescr, size, nnz, ...)

Create a const sparse vector.

hipsparseDestroySpVec(spVecDescr)

Destroy a sparse vector.

hipsparseSpVecGet(spVecDescr, size, nnz, idxType, ...)

Get the fields of the sparse vector descriptor.

hipsparseConstSpVecGet(spVecDescr, size, nnz, indices, ...)

Get the fields of the const sparse vector descriptor.

hipsparseSpVecGetIndexBase(spVecDescr, idxBase)

Get the index base of a sparse vector.

hipsparseSpVecGetValues(spVecDescr)

Get the pointer to a sparse vector data array.

hipsparseConstSpVecGetValues(spVecDescr, values)

Get the pointer to a sparse vector data array.

hipsparseSpVecSetValues(spVecDescr, values)

Set the pointer of a sparse vector data array.

hipsparseCreateCoo(rows, cols, nnz, cooRowInd, ...)

Create a sparse COO matrix descriptor.

hipsparseCreateConstCoo(rows, cols, nnz, cooRowInd, ...)

Create a sparse COO matrix descriptor.

hipsparseCreateCooAoS(rows, cols, nnz, cooInd, ...)

Create a sparse COO (AoS) matrix descriptor.

hipsparseCreateCsr(rows, cols, nnz, csrRowOffsets, ...)

Create a sparse CSR matrix descriptor.

hipsparseCreateConstCsr(rows, cols, nnz, ...)

Create a sparse CSR matrix descriptor.

hipsparseCreateCsc(rows, cols, nnz, cscColOffsets, ...)

Create a sparse CSC matrix descriptor.

hipsparseCreateConstCsc(rows, cols, nnz, ...)

Create a sparse CSC matrix descriptor.

hipsparseCreateBlockedEll(rows, cols, ellBlockSize, ...)

Create a sparse Blocked ELL matrix descriptor.

hipsparseCreateConstBlockedEll(rows, cols, ...)

Create a sparse Blocked ELL matrix descriptor.

hipsparseCreateSlicedEll(rows, cols, nnz, ...)

Create a sparse Sliced ELL matrix descriptor.

hipsparseCreateConstSlicedEll(rows, cols, nnz, ...)

Create a sparse Sliced ELL matrix descriptor.

hipsparseCreateBsr(mb, nb, nnzb, rowBlockDim, ...)

Create a sparse BSR matrix descriptor.

hipsparseCreateConstBsr(mb, nb, nnzb, rowBlockDim, ...)

Create a sparse BSR matrix descriptor.

hipsparseDestroySpMat(spMatDescr)

Destroy a sparse matrix descriptor.

hipsparseCooGet(spMatDescr, rows, cols, nnz, idxType, ...)

Get the pointers of a sparse COO matrix.

hipsparseConstCooGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse COO matrix.

hipsparseCooAoSGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse COO (AoS) matrix.

hipsparseCsrGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse CSR matrix.

hipsparseConstCsrGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse CSR matrix.

hipsparseCscGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse CSC matrix.

hipsparseConstCscGet(spMatDescr, rows, cols, nnz, ...)

Get the pointers of a sparse CSC matrix.

hipsparseBlockedEllGet(spMatDescr, rows, cols, ...)

Get the pointers of a sparse blocked ELL matrix.

hipsparseConstBlockedEllGet(spMatDescr, rows, cols, ...)

Get the pointers of a sparse blocked ELL matrix.

hipsparseCsrSetPointers(spMatDescr, csrRowOffsets, ...)

Set the pointers of a sparse CSR matrix.

hipsparseCscSetPointers(spMatDescr, cscColOffsets, ...)

Set the pointers of a sparse CSC matrix.

hipsparseCooSetPointers(spMatDescr, cooRowInd, ...)

Set the pointers of a sparse COO matrix.

hipsparseBlockedEllSetPointers(spMatDescr, ellColInd, ...)

Set the pointers of a sparse blocked ELL matrix.

hipsparseSpMatGetSize(spMatDescr, rows, cols, nnz)

Get the sizes of a sparse matrix.

hipsparseSpMatGetFormat(spMatDescr, format)

Get the format of a sparse matrix.

hipsparseSpMatGetIndexBase(spMatDescr, idxBase)

Get the index base of a sparse matrix.

hipsparseSpMatGetValues(spMatDescr)

Get the pointer of the values array of a sparse matrix.

hipsparseConstSpMatGetValues(spMatDescr, values)

Get the pointer of the values array of a sparse matrix.

hipsparseSpMatSetValues(spMatDescr, values)

Set the pointer of the values array of a sparse matrix.

hipsparseSpMatGetStridedBatch(spMatDescr, batchCount)

Get the batch count of the sparse matrix.

hipsparseSpMatSetStridedBatch(spMatDescr, batchCount)

Set the batch count of the sparse matrix.

hipsparseCooSetStridedBatch(spMatDescr, batchCount, ...)

Set the batch count and stride of the sparse COO matrix.

hipsparseCsrSetStridedBatch(spMatDescr, batchCount, ...)

Set the batch count and stride of the sparse CSR matrix.

hipsparseSpMatGetAttribute(spMatDescr, attribute, ...)

Get an attribute from a sparse matrix descriptor.

hipsparseSpMatSetAttribute(spMatDescr, attribute, ...)

Set an attribute in a sparse matrix descriptor.

hipsparseCreateDnVec(size, values, valueType)

Create a dense vector.

hipsparseCreateConstDnVec(dnVecDescr, size, values, ...)

Create a dense vector.

hipsparseDestroyDnVec(dnVecDescr)

Destroy a dense vector.

hipsparseDnVecGet(dnVecDescr, size, valueType)

Get the fields from a dense vector.

hipsparseConstDnVecGet(dnVecDescr, size, values, valueType)

Get the fields from a dense vector.

hipsparseDnVecGetValues(dnVecDescr)

Get the value pointer from a dense vector.

hipsparseConstDnVecGetValues(dnVecDescr, values)

Get the value pointer from a dense vector.

hipsparseDnVecSetValues(dnVecDescr, values)

Set the value pointer of a dense vector.

hipsparseCreateDnMat(rows, cols, ld, values, ...)

Create a dense matrix.

hipsparseCreateConstDnMat(dnMatDescr, rows, cols, ld, ...)

Create a dense matrix.

hipsparseDestroyDnMat(dnMatDescr)

Destroy a dense matrix.

hipsparseDnMatGet(dnMatDescr, rows, cols, ld, ...)

Get fields from a dense matrix.

hipsparseConstDnMatGet(dnMatDescr, rows, cols, ld, ...)

Get fields from a dense matrix.

hipsparseDnMatGetValues(dnMatDescr)

Get the value pointer from a dense matrix.

hipsparseConstDnMatGetValues(dnMatDescr, values)

Get the value pointer from a dense matrix.

hipsparseDnMatSetValues(dnMatDescr, values)

Set the value pointer of a dense matrix.

hipsparseDnMatGetStridedBatch(dnMatDescr, batchCount, ...)

Get the batch count and batch stride of the dense matrix.

hipsparseDnMatSetStridedBatch(dnMatDescr, batchCount, ...)

Set the batch count and batch stride of the dense matrix.

hipsparseAxpby(handle, alpha, vecX, beta, vecY)

Scale a sparse vector and add it to a scaled dense vector.

hipsparseDenseToSparse_bufferSize(handle, matA, matB, ...)

hipsparseDenseToSparse_bufferSize computes the required user-allocated buffer size needed when converting

hipsparseDenseToSparse_analysis(handle, matA, matB, ...)

hipsparseDenseToSparse_analysis performs analysis that is later used in hipsparseDenseToSparse_convert when

hipsparseDenseToSparse_convert(handle, matA, matB, ...)

Dense matrix to sparse matrix conversion.

hipsparseGather(handle, vecY, vecX)

Gather elements from a dense vector and store them in a sparse vector.

hipsparseRot(handle, c_coeff, s_coeff, vecX, vecY)

Apply the Givens rotation to a dense and a sparse vector.

hipsparseScatter(handle, vecX, vecY)

Scatter elements from a sparse vector into a dense vector.

hipsparseSDDMM_bufferSize(handle, opA, opB, alpha, A, ...)

hipsparseSDDMM_bufferSize returns the size of the buffer required when computing the sampled dense-dense matrix multiplication:

hipsparseSDDMM_preprocess(handle, opA, opB, alpha, A, ...)

hipsparseSDDMM_preprocess performs the required preprocessing used when computing the sampled dense dense matrix multiplication:

hipsparseSDDMM(handle, opA, opB, alpha, A, B, beta, C, ...)

Sampled dense-dense matrix multiplication.

hipsparseSparseToDense_bufferSize(handle, matA, matB, ...)

hipsparseSparseToDense_bufferSize computes the required user-allocated buffer size needed when converting

hipsparseSparseToDense(handle, matA, matB, alg, ...)

Sparse matrix to dense matrix conversion

hipsparseSpGEMM_createDescr()

hipsparseSpGEMM_createDescr creates a sparse matrix sparse matrix product descriptor.

hipsparseSpGEMM_destroyDescr(descr)

hipsparseSpGEMM_destroyDescr destroys a sparse matrix sparse matrix product descriptor and releases all

hipsparseSpGEMM_workEstimation(handle, opA, opB, ...)

Work estimation step of the sparse matrix sparse matrix product:

hipsparseSpGEMM_compute(handle, opA, opB, alpha, matA, ...)

Compute step of the sparse matrix sparse matrix product:

hipsparseSpGEMM_copy(handle, opA, opB, alpha, matA, ...)

Copy step of the sparse matrix sparse matrix product:

hipsparseSpGEMMreuse_workEstimation(handle, opA, opB, ...)

Work estimation step of the sparse matrix sparse matrix product:

hipsparseSpGEMMreuse_nnz(handle, opA, opB, matA, matB, ...)

Nnz calculation step of the sparse matrix sparse matrix product:

hipsparseSpGEMMreuse_copy(handle, opA, opB, matA, ...)

Copy step of the sparse matrix sparse matrix product:

hipsparseSpGEMMreuse_compute(handle, opA, opB, alpha, ...)

Copy step of the sparse matrix sparse matrix product:

hipsparseSpMM_bufferSize(handle, opA, opB, alpha, ...)

hipsparseSpMM_bufferSize computes the required user-allocated buffer size needed when computing the sparse matrix multiplication with a dense matrix:

hipsparseSpMM_preprocess(handle, opA, opB, alpha, ...)

hipsparseSpMM_preprocess performs the required preprocessing used when computing the sparse matrix multiplication with a dense matrix:

hipsparseSpMM(handle, opA, opB, alpha, matA, matB, ...)

Compute the sparse matrix multiplication with a dense matrix.

hipsparseSpMV_bufferSize(handle, opA, alpha, matA, ...)

hipsparseSpMV_bufferSize computes the user-allocated buffer size required when computing the sparse matrix multiplication with a dense vector:

hipsparseSpMV_preprocess(handle, opA, alpha, matA, ...)

hipsparseSpMV_preprocess performs analysis on the sparse matrix \(op(A)\) when computing the sparse matrix multiplication with a dense vector:

hipsparseSpMV(handle, opA, alpha, matA, vecX, beta, ...)

Compute the sparse matrix multiplication with a dense vector.

hipsparseSpSM_createDescr()

hipsparseSpSM_createDescr creates a sparse matrix triangular solve (with multiple rhs) descriptor.

hipsparseSpSM_destroyDescr(descr)

hipsparseSpSM_destroyDescr destroys a sparse matrix triangular solve (with multiple rhs) descriptor and releases all

hipsparseSpSM_bufferSize(handle, opA, opB, alpha, ...)

hipsparseSpSM_bufferSize computes the size of the required user-allocated buffer needed when solving the triangular linear system:

hipsparseSpSM_analysis(handle, opA, opB, alpha, matA, ...)

hipsparseSpSM_analysis performs the required analysis needed when solving the triangular linear system:

hipsparseSpSM_solve(handle, opA, opB, alpha, matA, ...)

Sparse triangular system solve

hipsparseSpSM_solve_ex(handle, opA, opB, alpha, matA, ...)

Sparse triangular system solve

hipsparseSpSV_createDescr()

hipsparseSpSV_createDescr creates a sparse matrix triangular solve descriptor.

hipsparseSpSV_destroyDescr(descr)

hipsparseSpSV_destroyDescr destroys a sparse matrix triangular solve descriptor and releases all

hipsparseSpSV_bufferSize(handle, opA, alpha, matA, x, ...)

hipsparseSpSV_bufferSize computes the size of the user-allocated buffer required when solving the triangular linear system:

hipsparseSpSV_analysis(handle, opA, alpha, matA, x, y, ...)

hipsparseSpSV_analysis performs the required analysis needed when solving the triangular linear system:

hipsparseSpSV_solve(handle, opA, alpha, matA, x, y, ...)

Sparse triangular solve.

hipsparseSpVV_bufferSize(handle, opX, vecX, vecY, ...)

hipsparseSpVV_bufferSize computes the required user-allocated buffer size needed when computing the inner dot product of a sparse vector with a dense vector:

hipsparseSpVV(handle, opX, vecX, vecY, result, ...)

Compute the inner dot product of a sparse vector with a dense vector.

Module Contents#

rocm.bindings.hipsparse.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.hipsparse.hipsparseBfloat16(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

data: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipsparse.hipsparseFloat16(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

data: Any#
static PROPERTIES() → list[str]#
static fromObj(pyobj) → Any#
static allocate(count: int = 1) → Any#
c_sizeof() → int#
as_c_void_p() → Any#
class rocm.bindings.hipsparse.bsrsv2Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.bsrsm2Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.bsrilu02Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.bsric02Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csrsv2Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csrsm2Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csrilu02Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csric02Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csrgemm2Info(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.pruneInfo(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.csru2csrInfo(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.hipsparse.bsrsv2Info_t#
rocm.bindings.hipsparse.bsrsm2Info_t#
rocm.bindings.hipsparse.bsrilu02Info_t#
rocm.bindings.hipsparse.bsric02Info_t#
rocm.bindings.hipsparse.csrsv2Info_t#
rocm.bindings.hipsparse.csrsm2Info_t#
rocm.bindings.hipsparse.csrilu02Info_t#
rocm.bindings.hipsparse.csric02Info_t#
rocm.bindings.hipsparse.csrgemm2Info_t#
rocm.bindings.hipsparse.pruneInfo_t#
rocm.bindings.hipsparse.csru2csrInfo_t#
class rocm.bindings.hipsparse.hipsparseStatus_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_STATUS_SUCCESS: int#
HIPSPARSE_STATUS_NOT_INITIALIZED: int#
HIPSPARSE_STATUS_ALLOC_FAILED: int#
HIPSPARSE_STATUS_INVALID_VALUE: int#
HIPSPARSE_STATUS_ARCH_MISMATCH: int#
HIPSPARSE_STATUS_MAPPING_ERROR: int#
HIPSPARSE_STATUS_EXECUTION_FAILED: int#
HIPSPARSE_STATUS_INTERNAL_ERROR: int#
HIPSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED: int#
HIPSPARSE_STATUS_ZERO_PIVOT: int#
HIPSPARSE_STATUS_NOT_SUPPORTED: int#
HIPSPARSE_STATUS_INSUFFICIENT_RESOURCES: int#
class rocm.bindings.hipsparse.hipsparsePointerMode_t#

Bases: enum.IntEnum

Indicates whether the pointer is a device pointer or host pointer.

The hipsparsePointerMode_t indicates whether scalar values are passed by reference on the host or device. The hipsparsePointerMode_t can be changed by hipsparseSetPointerMode(). The current pointer mode can be obtained by hipsparseGetPointerMode().

HIPSPARSE_POINTER_MODE_HOST: int#
HIPSPARSE_POINTER_MODE_DEVICE: int#
class rocm.bindings.hipsparse.hipsparseAction_t#

Bases: enum.IntEnum

Specify where the operation is performed.

The hipsparseAction_t indicates whether the operation is performed on the full matrix or only on the sparsity pattern of the matrix.

HIPSPARSE_ACTION_SYMBOLIC: int#
HIPSPARSE_ACTION_NUMERIC: int#
class rocm.bindings.hipsparse.hipsparseMatrixType_t#

Bases: enum.IntEnum

Specify the matrix type.

The hipsparseMatrixType_t indices the type of a matrix. For a given hipsparseMatDescr_t , the hipsparseMatrixType_t can be set using hipsparseSetMatType(). The current hipsparseMatrixType_t of a matrix can be obtained by hipsparseGetMatType().

HIPSPARSE_MATRIX_TYPE_GENERAL: int#
HIPSPARSE_MATRIX_TYPE_SYMMETRIC: int#
HIPSPARSE_MATRIX_TYPE_HERMITIAN: int#
HIPSPARSE_MATRIX_TYPE_TRIANGULAR: int#
class rocm.bindings.hipsparse.hipsparseFillMode_t#

Bases: enum.IntEnum

Specify the matrix fill mode.

The hipsparseFillMode_t indicates whether the lower or the upper part is stored in a sparse triangular matrix. For a given hipsparseMatDescr_t , the hipsparseFillMode_t can be set using hipsparseSetMatFillMode(). The current hipsparseFillMode_t of a matrix can be obtained by hipsparseGetMatFillMode().

HIPSPARSE_FILL_MODE_LOWER: int#
HIPSPARSE_FILL_MODE_UPPER: int#
class rocm.bindings.hipsparse.hipsparseDiagType_t#

Bases: enum.IntEnum

Indicates if the diagonal entries are unity.

The hipsparseDiagType_t indicates whether the diagonal entries of a matrix are unity or not. If HIPSPARSE_DIAG_TYPE_UNIT is specified, all present diagonal values will be ignored. For a given hipsparseMatDescr_t , the hipsparseDiagType_t can be set using hipsparseSetMatDiagType(). The current hipsparseDiagType_t of a matrix can be obtained by hipsparseGetMatDiagType().

HIPSPARSE_DIAG_TYPE_NON_UNIT: int#
HIPSPARSE_DIAG_TYPE_UNIT: int#
class rocm.bindings.hipsparse.hipsparseIndexBase_t#

Bases: enum.IntEnum

Specify the matrix index base.

The hipsparseIndexBase_t indicates the index base of the indices. For a given hipsparseMatDescr_t , the hipsparseIndexBase_t can be set using hipsparseSetMatIndexBase(). The current hipsparseIndexBase_t of a matrix can be obtained by hipsparseGetMatIndexBase().

HIPSPARSE_INDEX_BASE_ZERO: int#
HIPSPARSE_INDEX_BASE_ONE: int#
class rocm.bindings.hipsparse.hipsparseOperation_t#

Bases: enum.IntEnum

Specify whether the matrix is to be transposed or not.

The hipsparseOperation_t indicates the operation performed with the given matrix.

HIPSPARSE_OPERATION_NON_TRANSPOSE: int#
HIPSPARSE_OPERATION_TRANSPOSE: int#
HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE: int#
class rocm.bindings.hipsparse.hipsparseHybPartition_t#

Bases: enum.IntEnum

HYB matrix partitioning type.

The hipsparseHybPartition_t type indicates how the hybrid format partitioning between COO and ELL storage formats is performed.

HIPSPARSE_HYB_PARTITION_AUTO: int#
HIPSPARSE_HYB_PARTITION_USER: int#
HIPSPARSE_HYB_PARTITION_MAX: int#
class rocm.bindings.hipsparse.hipsparseSolvePolicy_t#

Bases: enum.IntEnum

Specify policy in triangular solvers and factorizations.

The hipsparseSolvePolicy_t type indicates the solve policy for the triangular solve.

HIPSPARSE_SOLVE_POLICY_NO_LEVEL: int#
HIPSPARSE_SOLVE_POLICY_USE_LEVEL: int#
class rocm.bindings.hipsparse.hipsparseSideMode_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SIDE_LEFT: int#
HIPSPARSE_SIDE_RIGHT: int#
class rocm.bindings.hipsparse.hipsparseDirection_t#

Bases: enum.IntEnum

Specify the matrix direction.

The hipsparseDirection_t indicates whether a dense matrix should be parsed by rows or by columns, assuming column-major storage.

HIPSPARSE_DIRECTION_ROW: int#
HIPSPARSE_DIRECTION_COLUMN: int#
class rocm.bindings.hipsparse.hipsparseCsr2CscAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_CSR2CSC_ALG_DEFAULT: int#
HIPSPARSE_CSR2CSC_ALG1: int#
HIPSPARSE_CSR2CSC_ALG2: int#
rocm.bindings.hipsparse.hipsparseCreate()#

Create a hipSPARSE handle.

hipsparseCreate creates the hipSPARSE library context. It must be initialized before any other hipSPARSE API function is invoked and must be passed to all subsequent library function calls. The handle should be destroyed at the end using hipsparseDestroy().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreate(hipsparseHandle_t * handle)
rocm.bindings.hipsparse.hipsparseDestroy(handle)#

Destroy a hipSPARSE handle.

hipsparseDestroy destroys the hipSPARSE library context and releases all resources used by the hipSPARSE library.

Args:
handle (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroy(hipsparseHandle_t handle)
rocm.bindings.hipsparse.hipsparseGetErrorName(status)#

Return the string representation of a hipSPARSE status’s matching backend status enum name

hipsparseGetErrorName takes a hipSPARSE status as input and first converts it to the matching backend status (either rocsparse_status or cusparseStatus_t). It then returns the string representation of this status enum name. If the status is not recognized, the function returns “Unrecognized status code”.

For example, hipsparseGetErrorName( HIPSPARSE_STATUS_SUCCESS ) on a system with a rocSPARSE backend will return rocsparse_status_success. On a system with a cuSPARSE backend this function would return CUSPARSE_STATUS_SUCCESS.

Args:
status (hipsparseStatus_t):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

const char * hipsparseGetErrorName(hipsparseStatus_t status)
rocm.bindings.hipsparse.hipsparseGetErrorString(status)#

Return the hipSPARSE status’s matching backend status description as a string

hipsparseGetErrorString takes a hipSPARSE status as input and first converts it to the matching backend status (either rocsparse_status or cusparseStatus_t). It then returns the string description of this status. If the status is not recognized, the function returns “Unrecognized status code”.

Args:
status (hipsparseStatus_t):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

const char * hipsparseGetErrorString(hipsparseStatus_t status)
rocm.bindings.hipsparse.hipsparseGetVersion(handle, version)#

Get the hipSPARSE version.

hipsparseGetVersion gets the hipSPARSE library version number. - patch = version % 100 - minor = version / 100 % 1000 - major = version / 100000

Args:
handle (Pointer/object):

(undocumented)

version (PointerToInt/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseGetVersion(hipsparseHandle_t handle, int * version)
rocm.bindings.hipsparse.hipsparseGetGitRevision(handle, rev)#

Get the hipSPARSE git revision.

hipsparseGetGitRevision gets the hipSPARSE library git commit revision (SHA-1).

Args:
handle (Pointer/object):

(undocumented)

rev (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseGetGitRevision(hipsparseHandle_t handle, char * rev)
rocm.bindings.hipsparse.hipsparseSetStream(handle, streamId)#

Specify the user-defined HIP stream.

hipsparseSetStream specifies the stream to be used by the hipSPARSE library context and all subsequent function calls.

Args:
handle (Pointer/object):

(undocumented)

streamId (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetStream(hipsparseHandle_t handle, hipStream_t streamId)
rocm.bindings.hipsparse.hipsparseGetStream(handle)#

Get the current stream from the library context.

hipsparseGetStream gets the hipSPARSE library context stream which is currently used for all subsequent function calls.

Args:
handle (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseGetStream(hipsparseHandle_t handle, hipStream_t * streamId)
rocm.bindings.hipsparse.hipsparseSetPointerMode(handle, mode)#

Specify the pointer mode.

hipsparseSetPointerMode specifies the pointer mode to be used by the hipSPARSE library context and all subsequent function calls. By default, all values are passed by reference on the host. Valid pointer modes are HIPSPARSE_POINTER_MODE_HOST or HIPSPARSE_POINTER_MODE_DEVICE .

Args:
handle (Pointer/object):

(undocumented)

mode (hipsparsePointerMode_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetPointerMode(hipsparseHandle_t handle, hipsparsePointerMode_t mode)
rocm.bindings.hipsparse.hipsparseGetPointerMode(handle, mode)#

Get the current pointer mode from the library context.

hipsparseGetPointerMode gets the hipSPARSE library context pointer mode which is currently used for all subsequent function calls.

Args:
handle (Pointer/object):

(undocumented)

mode (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseGetPointerMode(hipsparseHandle_t handle, hipsparsePointerMode_t * mode)
rocm.bindings.hipsparse.hipsparseCreateMatDescr()#

Create a matrix descriptor.

hipsparseCreateMatDescr creates a matrix descriptor. It initializes hipsparseMatrixType_t to HIPSPARSE_MATRIX_TYPE_GENERAL and hipsparseIndexBase_t to HIPSPARSE_INDEX_BASE_ZERO . It should be destroyed at the end using hipsparseDestroyMatDescr().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateMatDescr(hipsparseMatDescr_t * descrA)
rocm.bindings.hipsparse.hipsparseDestroyMatDescr(descrA)#

Destroy a matrix descriptor.

hipsparseDestroyMatDescr destroys a matrix descriptor and releases all resources used by the descriptor.

Args:
descrA (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyMatDescr(hipsparseMatDescr_t descrA)
rocm.bindings.hipsparse.hipsparseCopyMatDescr(dest, src)#

Copy a matrix descriptor.

hipsparseCopyMatDescr copies a matrix descriptor. Both source and destination matrix descriptors must be initialized prior to calling hipsparseCopyMatDescr.

Args:
dest (Pointer/object):

(undocumented)

src (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCopyMatDescr(hipsparseMatDescr_t dest, const hipsparseMatDescr_t src)
rocm.bindings.hipsparse.hipsparseSetMatType(descrA, type)#

Specify the matrix type of a matrix descriptor.

hipsparseSetMatType sets the matrix type of a matrix descriptor. Valid matrix types are HIPSPARSE_MATRIX_TYPE_GENERAL , HIPSPARSE_MATRIX_TYPE_SYMMETRIC , HIPSPARSE_MATRIX_TYPE_HERMITIAN , or HIPSPARSE_MATRIX_TYPE_TRIANGULAR .

Args:
descrA (Pointer/object):

(undocumented)

type (hipsparseMatrixType_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetMatType(hipsparseMatDescr_t descrA, hipsparseMatrixType_t type)
rocm.bindings.hipsparse.hipsparseGetMatType(descrA)#

Get the matrix type of a matrix descriptor.

hipsparseGetMatType returns the matrix type of a matrix descriptor.

Args:
descrA (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseMatrixType_t hipsparseGetMatType(const hipsparseMatDescr_t descrA)
rocm.bindings.hipsparse.hipsparseSetMatFillMode(descrA, fillMode)#

Specify the matrix fill mode of a matrix descriptor.

hipsparseSetMatFillMode sets the matrix fill mode of a matrix descriptor. Valid fill modes are HIPSPARSE_FILL_MODE_LOWER or HIPSPARSE_FILL_MODE_UPPER .

Args:
descrA (Pointer/object):

(undocumented)

fillMode (hipsparseFillMode_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetMatFillMode(hipsparseMatDescr_t descrA, hipsparseFillMode_t fillMode)
rocm.bindings.hipsparse.hipsparseGetMatFillMode(descrA)#

Get the matrix fill mode of a matrix descriptor.

hipsparseGetMatFillMode returns the matrix fill mode of a matrix descriptor.

Args:
descrA (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseFillMode_t hipsparseGetMatFillMode(const hipsparseMatDescr_t descrA)
rocm.bindings.hipsparse.hipsparseSetMatDiagType(descrA, diagType)#

Specify the matrix diagonal type of a matrix descriptor.

hipsparseSetMatDiagType sets the matrix diagonal type of a matrix descriptor. Valid diagonal types are HIPSPARSE_DIAG_TYPE_UNIT or HIPSPARSE_DIAG_TYPE_NON_UNIT .

Args:
descrA (Pointer/object):

(undocumented)

diagType (hipsparseDiagType_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetMatDiagType(hipsparseMatDescr_t descrA, hipsparseDiagType_t diagType)
rocm.bindings.hipsparse.hipsparseGetMatDiagType(descrA)#

Get the matrix diagonal type of a matrix descriptor.

hipsparseGetMatDiagType returns the matrix diagonal type of a matrix descriptor.

Args:
descrA (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseDiagType_t hipsparseGetMatDiagType(const hipsparseMatDescr_t descrA)
rocm.bindings.hipsparse.hipsparseSetMatIndexBase(descrA, base)#

Specify the index base of a matrix descriptor.

hipsparseSetMatIndexBase sets the index base of a matrix descriptor. Valid options are HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

Args:
descrA (Pointer/object):

(undocumented)

base (hipsparseIndexBase_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSetMatIndexBase(hipsparseMatDescr_t descrA, hipsparseIndexBase_t base)
rocm.bindings.hipsparse.hipsparseGetMatIndexBase(descrA)#

Get the index base of a matrix descriptor.

hipsparseGetMatIndexBase returns the index base of a matrix descriptor.

Args:
descrA (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseIndexBase_t hipsparseGetMatIndexBase(const hipsparseMatDescr_t descrA)
rocm.bindings.hipsparse.hipsparseCreateHybMat()#

Create a HYB matrix structure.

hipsparseCreateHybMat creates a structure that holds the matrix in HYB storage format. It should be destroyed at the end using hipsparseDestroyHybMat().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateHybMat(hipsparseHybMat_t * hybA)
rocm.bindings.hipsparse.hipsparseDestroyHybMat(hybA)#

Destroy a HYB matrix structure.

hipsparseDestroyHybMat destroys a HYB structure.

Args:
hybA (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyHybMat(hipsparseHybMat_t hybA)
rocm.bindings.hipsparse.hipsparseCreateBsrsv2Info()#

Create a bsrsv2 info structure.

hipsparseCreateBsrsv2Info creates a structure that holds the bsrsv2 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyBsrsv2Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBsrsv2Info(bsrsv2Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyBsrsv2Info(info)#

Destroy a bsrsv2 info structure.

hipsparseDestroyBsrsv2Info destroys a bsrsv2 info structure.

Args:
info (bsrsv2Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyBsrsv2Info(bsrsv2Info_t info)
rocm.bindings.hipsparse.hipsparseCreateBsrsm2Info()#

Create a bsrsm2 info structure.

hipsparseCreateBsrsm2Info creates a structure that holds the bsrsm2 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyBsrsm2Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBsrsm2Info(bsrsm2Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyBsrsm2Info(info)#

Destroy a bsrsm2 info structure.

hipsparseDestroyBsrsm2Info destroys a bsrsm2 info structure.

Args:
info (bsrsm2Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyBsrsm2Info(bsrsm2Info_t info)
rocm.bindings.hipsparse.hipsparseCreateBsrilu02Info()#

Create a bsrilu02 info structure.

hipsparseCreateBsrilu02Info creates a structure that holds the bsrilu02 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyBsrilu02Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBsrilu02Info(bsrilu02Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyBsrilu02Info(info)#

Destroy a bsrilu02 info structure

hipsparseDestroyBsrilu02Info destroys a bsrilu02 info structure.

Args:
info (bsrilu02Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyBsrilu02Info(bsrilu02Info_t info)
rocm.bindings.hipsparse.hipsparseCreateBsric02Info()#

Create a bsric02 info structure.

hipsparseCreateBsric02Info creates a structure that holds the bsric02 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyBsric02Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBsric02Info(bsric02Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyBsric02Info(info)#

Destroy a bsric02 info structure.

hipsparseDestroyBsric02Info destroys a bsric02 info structure.

Args:
info (bsric02Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyBsric02Info(bsric02Info_t info)
rocm.bindings.hipsparse.hipsparseCreateCsrsv2Info()#

Create a csrsv2 info structure.

hipsparseCreateCsrsv2Info creates a structure that holds the csrsv2 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsrsv2Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsrsv2Info(csrsv2Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsrsv2Info(info)#

Destroy a csrsv2 info structure.

hipsparseDestroyCsrsv2Info destroys a csrsv2 info structure.

Args:
info (csrsv2Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsrsv2Info(csrsv2Info_t info)
rocm.bindings.hipsparse.hipsparseCreateCsrsm2Info()#

Create a csrsm2 info structure.

hipsparseCreateCsrsm2Info creates a structure that holds the csrsm2 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsrsm2Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsrsm2Info(csrsm2Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsrsm2Info(info)#

Destroy a csrsm2 info structure.

hipsparseDestroyCsrsm2Info destroys a csrsm2 info structure.

Args:
info (csrsm2Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsrsm2Info(csrsm2Info_t info)
rocm.bindings.hipsparse.hipsparseCreateCsrilu02Info()#

Create a csrilu02 info structure.

hipsparseCreateCsrilu02Info creates a structure that holds the csrilu02 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsrilu02Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsrilu02Info(csrilu02Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsrilu02Info(info)#

Destroy a csrilu02 info structure.

hipsparseDestroyCsrilu02Info destroys a csrilu02 info structure.

Args:
info (csrilu02Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsrilu02Info(csrilu02Info_t info)
rocm.bindings.hipsparse.hipsparseCreateCsric02Info()#

Create a csric02 info structure.

hipsparseCreateCsric02Info creates a structure that holds the csric02 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsric02Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsric02Info(csric02Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsric02Info(info)#

Destroy a csric02 info structure.

hipsparseDestroyCsric02Info destroys a csric02 info structure.

Args:
info (csric02Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsric02Info(csric02Info_t info)
rocm.bindings.hipsparse.hipsparseCreateCsru2csrInfo()#

Create a csru2csr info structure.

hipsparseCreateCsru2csrInfo creates a structure that holds the csru2csr info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsru2csrInfo().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsru2csrInfo(csru2csrInfo_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsru2csrInfo(info)#

Destroy a csru2csr info structure.

hipsparseDestroyCsru2csrInfo destroys a csru2csr info structure.

Args:
info (csru2csrInfo/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsru2csrInfo(csru2csrInfo_t info)
rocm.bindings.hipsparse.hipsparseCreateColorInfo()#

Create a color info structure.

hipsparseCreateColorInfo creates a structure that holds the color info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyColorInfo().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateColorInfo(hipsparseColorInfo_t * info)
rocm.bindings.hipsparse.hipsparseDestroyColorInfo(info)#

Destroy a color info structure.

hipsparseDestroyColorInfo destroys a color info structure.

Args:
info (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyColorInfo(hipsparseColorInfo_t info)
rocm.bindings.hipsparse.hipsparseCreateCsrgemm2Info()#

Create a csrgemm2 info structure.

hipsparseCreateCsrgemm2Info creates a structure that holds the csrgemm2 info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyCsrgemm2Info().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsrgemm2Info(csrgemm2Info_t * info)
rocm.bindings.hipsparse.hipsparseDestroyCsrgemm2Info(info)#

Destroy a csrgemm2 info structure.

hipsparseDestroyCsrgemm2Info destroys a csrgemm2 info structure.

Args:
info (csrgemm2Info/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyCsrgemm2Info(csrgemm2Info_t info)
rocm.bindings.hipsparse.hipsparseCreatePruneInfo()#

Create a prune info structure.

hipsparseCreatePruneInfo creates a structure that holds the prune info data that is gathered during the analysis routines. It should be destroyed at the end using hipsparseDestroyPruneInfo().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreatePruneInfo(pruneInfo_t * info)
rocm.bindings.hipsparse.hipsparseDestroyPruneInfo(info)#

Destroy a prune info structure

hipsparseDestroyPruneInfo destroys a prune info structure.

Args:
info (pruneInfo/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyPruneInfo(pruneInfo_t info)
rocm.bindings.hipsparse.hipsparseSaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)#

Scale a sparse vector and add it to a dense vector.

hipsparseXaxpyi multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\), such that

\[y := y + \alpha \cdot x\]
for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = y[xInd[i]] + alpha * xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the corresponding values being added multiple times to the same location in y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

xVal (Pointer/object) – IN:

array of nnz elements containing the values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSaxpyi(hipsparseHandle_t handle, int nnz, const float * alpha, const float * xVal, const int * xInd, float * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)#

Scale a sparse vector and add it to a dense vector.

hipsparseXaxpyi multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\), such that

\[y := y + \alpha \cdot x\]
for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = y[xInd[i]] + alpha * xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the corresponding values being added multiple times to the same location in y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

xVal (Pointer/object) – IN:

array of nnz elements containing the values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDaxpyi(hipsparseHandle_t handle, int nnz, const double * alpha, const double * xVal, const int * xInd, double * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)#

Scale a sparse vector and add it to a dense vector.

hipsparseXaxpyi multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\), such that

\[y := y + \alpha \cdot x\]
for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = y[xInd[i]] + alpha * xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the corresponding values being added multiple times to the same location in y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

xVal (Pointer/object) – IN:

array of nnz elements containing the values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCaxpyi(hipsparseHandle_t handle, int nnz, const hipComplex * alpha, const hipComplex * xVal, const int * xInd, hipComplex * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZaxpyi(handle, nnz, alpha, xVal, xInd, y, idxBase)#

Scale a sparse vector and add it to a dense vector.

hipsparseXaxpyi multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\), such that

\[y := y + \alpha \cdot x\]
for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = y[xInd[i]] + alpha * xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the corresponding values being added multiple times to the same location in y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

xVal (Pointer/object) – IN:

array of nnz elements containing the values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZaxpyi(hipsparseHandle_t handle, int nnz, const hipDoubleComplex * alpha, const hipDoubleComplex * xVal, const int * xInd, hipDoubleComplex * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCdotci(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a complex conjugate sparse vector with a dense vector.

hipsparseXdotci computes the dot product of the complex conjugate sparse vector \(x\) with the dense vector \(y\), such that

\[result := \bar{x}^H y\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += conj(xVal[i]) * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCdotci(hipsparseHandle_t handle, int nnz, const hipComplex * xVal, const int * xInd, const hipComplex * y, hipComplex * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZdotci(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a complex conjugate sparse vector with a dense vector.

hipsparseXdotci computes the dot product of the complex conjugate sparse vector \(x\) with the dense vector \(y\), such that

\[result := \bar{x}^H y\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += conj(xVal[i]) * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZdotci(hipsparseHandle_t handle, int nnz, const hipDoubleComplex * xVal, const int * xInd, const hipDoubleComplex * y, hipDoubleComplex * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSdoti(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a sparse vector with a dense vector.

hipsparseXdoti computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[result := y^T x\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += xVal[i] * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSdoti(hipsparseHandle_t handle, int nnz, const float * xVal, const int * xInd, const float * y, float * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDdoti(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a sparse vector with a dense vector.

hipsparseXdoti computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[result := y^T x\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += xVal[i] * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDdoti(hipsparseHandle_t handle, int nnz, const double * xVal, const int * xInd, const double * y, double * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCdoti(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a sparse vector with a dense vector.

hipsparseXdoti computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[result := y^T x\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += xVal[i] * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCdoti(hipsparseHandle_t handle, int nnz, const hipComplex * xVal, const int * xInd, const hipComplex * y, hipComplex * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZdoti(handle, nnz, xVal, xInd, y, result, idxBase)#

Compute the dot product of a sparse vector with a dense vector.

hipsparseXdoti computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[result := y^T x\]
result = 0
for(i = 0; i < nnz; ++i)
{
    result += xVal[i] * y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully with result set to zero.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of vector \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz values containing the elements of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZdoti(hipsparseHandle_t handle, int nnz, const hipDoubleComplex * xVal, const int * xInd, const hipDoubleComplex * y, hipDoubleComplex * result, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSgthr(handle, nnz, y, xVal, xInd, idxBase)#

Gather elements from a dense vector and store them in a sparse vector.

hipsparseXgthr gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\).

for(i = 0; i < nnz; ++i)
{
    xVal[i] = y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgthr(hipsparseHandle_t handle, int nnz, const float * y, float * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDgthr(handle, nnz, y, xVal, xInd, idxBase)#

Gather elements from a dense vector and store them in a sparse vector.

hipsparseXgthr gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\).

for(i = 0; i < nnz; ++i)
{
    xVal[i] = y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgthr(hipsparseHandle_t handle, int nnz, const double * y, double * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCgthr(handle, nnz, y, xVal, xInd, idxBase)#

Gather elements from a dense vector and store them in a sparse vector.

hipsparseXgthr gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\).

for(i = 0; i < nnz; ++i)
{
    xVal[i] = y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgthr(hipsparseHandle_t handle, int nnz, const hipComplex * y, hipComplex * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZgthr(handle, nnz, y, xVal, xInd, idxBase)#

Gather elements from a dense vector and store them in a sparse vector.

hipsparseXgthr gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\).

for(i = 0; i < nnz; ++i)
{
    xVal[i] = y[xInd[i]];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – IN:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgthr(hipsparseHandle_t handle, int nnz, const hipDoubleComplex * y, hipDoubleComplex * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSgthrz(handle, nnz, y, xVal, xInd, idxBase)#

Gather and zero out elements from a dense vector and store them in a sparse vector.

hipsparseXgthrz gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.

for(i = 0; i < nnz; ++i)
{
    xVal[i]    = y[xInd[i]];
    y[xInd[i]] = 0;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd. Gathered elements are set to zero.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgthrz(hipsparseHandle_t handle, int nnz, float * y, float * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDgthrz(handle, nnz, y, xVal, xInd, idxBase)#

Gather and zero out elements from a dense vector and store them in a sparse vector.

hipsparseXgthrz gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.

for(i = 0; i < nnz; ++i)
{
    xVal[i]    = y[xInd[i]];
    y[xInd[i]] = 0;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd. Gathered elements are set to zero.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgthrz(hipsparseHandle_t handle, int nnz, double * y, double * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCgthrz(handle, nnz, y, xVal, xInd, idxBase)#

Gather and zero out elements from a dense vector and store them in a sparse vector.

hipsparseXgthrz gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.

for(i = 0; i < nnz; ++i)
{
    xVal[i]    = y[xInd[i]];
    y[xInd[i]] = 0;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd. Gathered elements are set to zero.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgthrz(hipsparseHandle_t handle, int nnz, hipComplex * y, hipComplex * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZgthrz(handle, nnz, y, xVal, xInd, idxBase)#

Gather and zero out elements from a dense vector and store them in a sparse vector.

hipsparseXgthrz gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.

for(i = 0; i < nnz; ++i)
{
    xVal[i]    = y[xInd[i]];
    y[xInd[i]] = 0;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd. Gathered elements are set to zero.

xVal (Pointer/object) – OUT:

array of nnz elements that will contain the gathered values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgthrz(hipsparseHandle_t handle, int nnz, hipDoubleComplex * y, hipDoubleComplex * xVal, const int * xInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSroti(handle, nnz, xVal, xInd, y, c, s, idxBase)#

Apply the Givens rotation to a dense and a sparse vector.

hipsparseXroti applies the Givens rotation matrix \(G\) to the sparse vector \(x\) and the dense vector \(y\), where

\[\begin{split}G = \begin{pmatrix} c & s \\ -s & c \end{pmatrix}\end{split}\]
for(i = 0; i < nnz; ++i)
{
    x_tmp = xVal[i];
    y_tmp = y[xInd[i]];

    xVal[i]    = c * x_tmp + s * y_tmp;
    y[xInd[i]] = c * y_tmp - s * x_tmp;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – INOUT:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

c (Pointer/object) – IN:

pointer to the cosine element of \(G\), which can be on host or device.

s (Pointer/object) – IN:

pointer to the sine element of \(G\), which can be on host or device.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSroti(hipsparseHandle_t handle, int nnz, float * xVal, const int * xInd, float * y, const float * c, const float * s, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDroti(handle, nnz, xVal, xInd, y, c, s, idxBase)#

Apply the Givens rotation to a dense and a sparse vector.

hipsparseXroti applies the Givens rotation matrix \(G\) to the sparse vector \(x\) and the dense vector \(y\), where

\[\begin{split}G = \begin{pmatrix} c & s \\ -s & c \end{pmatrix}\end{split}\]
for(i = 0; i < nnz; ++i)
{
    x_tmp = xVal[i];
    y_tmp = y[xInd[i]];

    xVal[i]    = c * x_tmp + s * y_tmp;
    y[xInd[i]] = c * y_tmp - s * x_tmp;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying xVal or y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – INOUT:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

c (Pointer/object) – IN:

pointer to the cosine element of \(G\), which can be on host or device.

s (Pointer/object) – IN:

pointer to the sine element of \(G\), which can be on host or device.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDroti(hipsparseHandle_t handle, int nnz, double * xVal, const int * xInd, double * y, const double * c, const double * s, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSsctr(handle, nnz, xVal, xInd, y, idxBase)#

Scatter elements from a dense vector across a sparse vector.

hipsparseXsctr scatters the elements that are listed in xInd from the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed in xInd remain unchanged.

for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the last value being written to y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSsctr(hipsparseHandle_t handle, int nnz, const float * xVal, const int * xInd, float * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDsctr(handle, nnz, xVal, xInd, y, idxBase)#

Scatter elements from a dense vector across a sparse vector.

hipsparseXsctr scatters the elements that are listed in xInd from the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed in xInd remain unchanged.

for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the last value being written to y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDsctr(hipsparseHandle_t handle, int nnz, const double * xVal, const int * xInd, double * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCsctr(handle, nnz, xVal, xInd, y, idxBase)#

Scatter elements from a dense vector across a sparse vector.

hipsparseXsctr scatters the elements that are listed in xInd from the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed in xInd remain unchanged.

for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the last value being written to y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsctr(hipsparseHandle_t handle, int nnz, const hipComplex * xVal, const int * xInd, hipComplex * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZsctr(handle, nnz, xVal, xInd, y, idxBase)#

Scatter elements from a dense vector across a sparse vector.

hipsparseXsctr scatters the elements that are listed in xInd from the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed in xInd remain unchanged.

for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] = xVal[i];
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

If nnz is zero, the function returns successfully without modifying y. Duplicate indices in xInd will result in the last value being written to y.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

nnz (int) – IN:

number of non-zero entries of \(x\). Must be non-negative.

xVal (Pointer/object) – IN:

array of nnz elements containing the non-zero values of \(x\).

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the non-zero values of \(x\).

y (Pointer/object) – INOUT:

array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZsctr(hipsparseHandle_t handle, int nnz, const hipDoubleComplex * xVal, const int * xInd, hipDoubleComplex * y, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseSbsrmv(handle, dirA, transA, mb, nb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, x, beta, y)#

Sparse matrix vector multiplication using the BSR storage format.

hipsparseXbsrmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]

with

\[op(A) = \left* \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \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.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix. Must be non-negative.

nb (int) – IN:

number of block columns of the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix. Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix. Must be positive.

x (Pointer/object) – IN:

array of nb*blockDim elements (\(op(A) = A\)) or mb*blockDim elements (\(op(A) = A^T\) or \(op(A) = A^H\)).

beta (Pointer/object) – IN:

scalar \(\beta\).

y (Pointer/object) – INOUT:

array of mb*blockDim elements (\(op(A) = A\)) or nb*blockDim elements (\(op(A) = A^T\) or \(op(A) = A^H\)).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const float * alpha, const hipsparseMatDescr_t descrA, const float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, const float * x, const float * beta, float * y)
rocm.bindings.hipsparse.hipsparseDbsrmv(handle, dirA, transA, mb, nb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const double * alpha, const hipsparseMatDescr_t descrA, const double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, const double * x, const double * beta, double * y)
rocm.bindings.hipsparse.hipsparseCbsrmv(handle, dirA, transA, mb, nb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, const hipComplex * x, const hipComplex * beta, hipComplex * y)
rocm.bindings.hipsparse.hipsparseZbsrmv(handle, dirA, transA, mb, nb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrmv(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nb, int nnzb, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, const hipDoubleComplex * x, const hipDoubleComplex * beta, hipDoubleComplex * y)
rocm.bindings.hipsparse.hipsparseXbsrsv2_zeroPivot(handle, info, position)#

hipsparseXbsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrsv2_analysis “hipsparseXbsrsv2_analysis()” or `` […]

hipsparseXbsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrsv2_analysis “hipsparseXbsrsv2_analysis()” or hipsparseSbsrsv2_solve computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the BSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXbsrsv2_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrsv2Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXbsrsv2_zeroPivot(hipsparseHandle_t handle, bsrsv2Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseSbsrsv2_bufferSize(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDbsrsv2_bufferSize(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCbsrsv2_bufferSize(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZbsrsv2_bufferSize(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSbsrsv2_bufferSizeExt(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDbsrsv2_bufferSizeExt(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCbsrsv2_bufferSizeExt(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZbsrsv2_bufferSizeExt(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsv2_analysis and hipsparseSbsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSbsrsv2_analysis(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve “hipsparseXbsrsv2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrsv2_analysis(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve “hipsparseXbsrsv2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrsv2_analysis(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve “hipsparseXbsrsv2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrsv2_analysis(handle, dirA, transA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrsv2_analysis performs the analysis step for hipsparseSbsrsv2_solve “hipsparseXbsrsv2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsv2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsrsv2_solve(handle, dirA, transA, mb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, f, x, policy, pBuffer)#

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

\[\begin{split}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.\end{split}\]
Note:

The sparse BSR matrix has to be sorted.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE and transA == HIPSPARSE_OPERATION_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnz containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsv2Info/object) – IN:

structure that holds the information collected during the analysis step.

f (Pointer/object) – IN:

array of m elements, holding the right-hand side.

x (Pointer/object) – OUT:

array of m elements, holding the solution.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const float * alpha, const hipsparseMatDescr_t descrA, const float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float * f, float * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrsv2_solve(handle, dirA, transA, mb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const double * alpha, const hipsparseMatDescr_t descrA, const double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double * f, double * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrsv2_solve(handle, dirA, transA, mb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipComplex * f, hipComplex * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrsv2_solve(handle, dirA, transA, mb, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsv2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, int mb, int nnzb, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const hipDoubleComplex * f, hipDoubleComplex * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsrxmv(handle, dir, trans, sizeOfMask, mb, nb, nnzb, alpha, descr, bsrVal, bsrMaskPtr, bsrRowPtr, bsrEndPtr, bsrColInd, blockDim, x, beta, y)#

Sparse matrix vector multiplication with mask operation using the BSR storage format.

hipsparseXbsrxmv multiplies the scalar \(\alpha\) with a sparse

math:(mb times text{blockDim}) times (nb times text{blockDim}) modified matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \left( \alpha \cdot op(A) \cdot x + \beta \cdot y \right)\left( \text{mask} \right),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only trans == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported, and blockDim == 1 is not supported.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

trans (hipsparseOperation_t) – IN:

matrix operation type.

sizeOfMask (int) – IN:

number of updated block rows of the array y. Must be non-negative and not greater than mb.

mb (int) – IN:

number of block rows of the sparse BSR matrix. Must be non-negative.

nb (int) – IN:

number of block columns of the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix. Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descr (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrVal (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrMaskPtr (PointerToInt/object) – IN:

array of sizeOfMask elements that give the indices of the updated block rows.

bsrRowPtr (PointerToInt/object) – IN:

array of mb elements that point to the start of every block row of the sparse BSR matrix.

bsrEndPtr (PointerToInt/object) – IN:

array of mb elements that point to the end of every block row of the sparse BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix. Must be greater than 1.

x (Pointer/object) – IN:

array of nb*blockDim elements (\(op(A) = A\)) or mb*blockDim elements (\(op(A) = A^T\) or \(op(A) = A^H\)).

beta (Pointer/object) – IN:

scalar \(\beta\).

y (Pointer/object) – INOUT:

array of mb*blockDim elements (\(op(A) = A\)) or nb*blockDim elements (\(op(A) = A^T\) or \(op(A) = A^H\)).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const float * alpha, const hipsparseMatDescr_t descr, const float * bsrVal, const int * bsrMaskPtr, const int * bsrRowPtr, const int * bsrEndPtr, const int * bsrColInd, int blockDim, const float * x, const float * beta, float * y)
rocm.bindings.hipsparse.hipsparseDbsrxmv(handle, dir, trans, sizeOfMask, mb, nb, nnzb, alpha, descr, bsrVal, bsrMaskPtr, bsrRowPtr, bsrEndPtr, bsrColInd, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dir (hipsparseDirection_t):

(undocumented)

trans (hipsparseOperation_t):

(undocumented)

sizeOfMask (int):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descr (Pointer/object):

(undocumented)

bsrVal (Pointer/object):

(undocumented)

bsrMaskPtr (PointerToInt/object):

(undocumented)

bsrRowPtr (PointerToInt/object):

(undocumented)

bsrEndPtr (PointerToInt/object):

(undocumented)

bsrColInd (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const double * alpha, const hipsparseMatDescr_t descr, const double * bsrVal, const int * bsrMaskPtr, const int * bsrRowPtr, const int * bsrEndPtr, const int * bsrColInd, int blockDim, const double * x, const double * beta, double * y)
rocm.bindings.hipsparse.hipsparseCbsrxmv(handle, dir, trans, sizeOfMask, mb, nb, nnzb, alpha, descr, bsrVal, bsrMaskPtr, bsrRowPtr, bsrEndPtr, bsrColInd, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dir (hipsparseDirection_t):

(undocumented)

trans (hipsparseOperation_t):

(undocumented)

sizeOfMask (int):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descr (Pointer/object):

(undocumented)

bsrVal (Pointer/object):

(undocumented)

bsrMaskPtr (PointerToInt/object):

(undocumented)

bsrRowPtr (PointerToInt/object):

(undocumented)

bsrEndPtr (PointerToInt/object):

(undocumented)

bsrColInd (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const hipComplex * alpha, const hipsparseMatDescr_t descr, const hipComplex * bsrVal, const int * bsrMaskPtr, const int * bsrRowPtr, const int * bsrEndPtr, const int * bsrColInd, int blockDim, const hipComplex * x, const hipComplex * beta, hipComplex * y)
rocm.bindings.hipsparse.hipsparseZbsrxmv(handle, dir, trans, sizeOfMask, mb, nb, nnzb, alpha, descr, bsrVal, bsrMaskPtr, bsrRowPtr, bsrEndPtr, bsrColInd, blockDim, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dir (hipsparseDirection_t):

(undocumented)

trans (hipsparseOperation_t):

(undocumented)

sizeOfMask (int):

(undocumented)

mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descr (Pointer/object):

(undocumented)

bsrVal (Pointer/object):

(undocumented)

bsrMaskPtr (PointerToInt/object):

(undocumented)

bsrRowPtr (PointerToInt/object):

(undocumented)

bsrEndPtr (PointerToInt/object):

(undocumented)

bsrColInd (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrxmv(hipsparseHandle_t handle, hipsparseDirection_t dir, hipsparseOperation_t trans, int sizeOfMask, int mb, int nb, int nnzb, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descr, const hipDoubleComplex * bsrVal, const int * bsrMaskPtr, const int * bsrRowPtr, const int * bsrEndPtr, const int * bsrColInd, int blockDim, const hipDoubleComplex * x, const hipDoubleComplex * beta, hipDoubleComplex * y)
rocm.bindings.hipsparse.hipsparseScsrmv(handle, transA, m, n, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, x, beta, y)#

Sparse matrix vector multiplication using the CSR storage format.

hipsparseXcsrmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in CSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
for(i = 0; i < m; ++i)
{
    y[i] = beta * y[i];

    for(j = csrRowPtr[i]; j < csrRowPtr[i + 1]; ++j)
    {
        y[i] = y[i] + alpha * csrVal[j] * x[csrColInd[j]];
    }
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix. Must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix. Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix. Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

x (Pointer/object) – IN:

array of n elements (\(op(A) == A\)) or m elements (\(op(A) == A^T\) or \(op(A) == A^H\)).

beta (Pointer/object) – IN:

scalar \(\beta\).

y (Pointer/object) – INOUT:

array of m elements (\(op(A) == A\)) or n elements (\(op(A) == A^T\) or \(op(A) == A^H\)).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * x, const float * beta, float * y)
rocm.bindings.hipsparse.hipsparseDcsrmv(handle, transA, m, n, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * x, const double * beta, double * y)
rocm.bindings.hipsparse.hipsparseCcsrmv(handle, transA, m, n, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * x, const hipComplex * beta, hipComplex * y)
rocm.bindings.hipsparse.hipsparseZcsrmv(handle, transA, m, n, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrmv(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * x, const hipDoubleComplex * beta, hipDoubleComplex * y)
rocm.bindings.hipsparse.hipsparseXcsrsv2_zeroPivot(handle, info, position)#

hipsparseXcsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrs […]

hipsparseXcsrsv2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrsv2_solve(), or hipsparseZcsrsv2_solve() computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using same index base as the CSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXcsrsv2_zeroPivot is a blocking function. It might negatively influence performance.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrsv2Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrsv2_zeroPivot(hipsparseHandle_t handle, csrsv2Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseScsrsv2_bufferSize(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrsv2_bufferSize(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrsv2_bufferSize(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrsv2_bufferSize(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsv2_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsrsv2_bufferSizeExt(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrsv2_bufferSizeExt(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrsv2_bufferSizeExt(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrsv2_bufferSizeExt(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrsv2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsv2_analysis and hipsparseScsrsv2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsv2_bufferSizeExt(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsrsv2_analysis(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrsv2_analysis performs the analysis step for hipsparseScsrsv2_solve .

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

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrsv2_analysis(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrsv2_analysis performs the analysis step for hipsparseScsrsv2_solve .

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

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrsv2_analysis(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrsv2_analysis performs the analysis step for hipsparseScsrsv2_solve .

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

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrsv2_analysis(handle, transA, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrsv2_analysis performs the analysis step for hipsparseScsrsv2_solve .

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

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsv2_analysis(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsrsv2_solve(handle, transA, m, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, f, x, policy, pBuffer)#

Sparse triangular solve using the CSR storage format

hipsparseXcsrsv2_solve solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in CSR 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

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
Note:

The sparse CSR matrix has to be sorted. This can be achieved by calling hipsparseXcsrsort().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE and transA == HIPSPARSE_OPERATION_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrsv2Info/object) – IN:

structure that holds the information collected during the analysis step.

f (Pointer/object) – IN:

array of m elements, holding the right-hand side.

x (Pointer/object) – OUT:

array of m elements, holding the solution.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, const float * f, float * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrsv2_solve(handle, transA, m, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, const double * f, double * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrsv2_solve(handle, transA, m, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, const hipComplex * f, hipComplex * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrsv2_solve(handle, transA, m, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, f, x, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrsv2Info/object):

(undocumented)

f (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsv2_solve(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrsv2Info_t info, const hipDoubleComplex * f, hipDoubleComplex * x, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgemvi_bufferSize(handle, transA, m, n, nnz, pBufferSizeInBytes)#

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes required by hipsparseSgemvi .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the dense matrix.

n (int) – IN:

number of columns of the dense matrix.

nnz (int) – IN:

number of non-zero entries in the sparse vector.

pBufferSizeInBytes (PointerToInt/object) – OUT:

temporary storage buffer size.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgemvi_bufferSize(handle, transA, m, n, nnz, pBufferSizeInBytes)#

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes required by hipsparseSgemvi .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the dense matrix.

n (int) – IN:

number of columns of the dense matrix.

nnz (int) – IN:

number of non-zero entries in the sparse vector.

pBufferSizeInBytes (PointerToInt/object) – OUT:

temporary storage buffer size.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgemvi_bufferSize(handle, transA, m, n, nnz, pBufferSizeInBytes)#

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes required by hipsparseSgemvi .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the dense matrix.

n (int) – IN:

number of columns of the dense matrix.

nnz (int) – IN:

number of non-zero entries in the sparse vector.

pBufferSizeInBytes (PointerToInt/object) – OUT:

temporary storage buffer size.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgemvi_bufferSize(handle, transA, m, n, nnz, pBufferSizeInBytes)#

hipsparseXgemvi_bufferSize returns the size of the temporary storage buffer in bytes required by hipsparseSgemvi .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the dense matrix.

n (int) – IN:

number of columns of the dense matrix.

nnz (int) – IN:

number of non-zero entries in the sparse vector.

pBufferSizeInBytes (PointerToInt/object) – OUT:

temporary storage buffer size.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgemvi_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int nnz, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgemvi(handle, transA, m, n, alpha, A, lda, nnz, x, xInd, beta, y, idxBase, pBuffer)#

Dense matrix sparse vector multiplication

hipsparseXgemvi multiplies the scalar \(\alpha\) with a dense \(m \times n\) matrix \(A\) and the sparse vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]

with

\[op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \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.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

m (int) – IN:

number of rows of the dense matrix.

n (int) – IN:

number of columns of the dense matrix.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

pointer to the dense matrix.

lda (int) – IN:

leading dimension of the dense matrix.

nnz (int) – IN:

number of non-zero entries in the sparse vector.

x (Pointer/object) – IN:

array of nnz elements containing the values of the sparse vector.

xInd (PointerToInt/object) – IN:

array of nnz elements containing the indices of the sparse vector.

beta (Pointer/object) – IN:

scalar \(\beta\).

y (Pointer/object) – INOUT:

array of m elements (\(op(A) == A\)) or n elements (\(op(A) == A^T\) or \(op(A) == A^H\)).

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

pBuffer (Pointer/object) – IN:

temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const float * alpha, const float * A, int lda, int nnz, const float * x, const int * xInd, const float * beta, float * y, hipsparseIndexBase_t idxBase, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgemvi(handle, transA, m, n, alpha, A, lda, nnz, x, xInd, beta, y, idxBase, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

A (Pointer/object):

(undocumented)

lda (int):

(undocumented)

nnz (int):

(undocumented)

x (Pointer/object):

(undocumented)

xInd (PointerToInt/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const double * alpha, const double * A, int lda, int nnz, const double * x, const int * xInd, const double * beta, double * y, hipsparseIndexBase_t idxBase, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgemvi(handle, transA, m, n, alpha, A, lda, nnz, x, xInd, beta, y, idxBase, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

A (Pointer/object):

(undocumented)

lda (int):

(undocumented)

nnz (int):

(undocumented)

x (Pointer/object):

(undocumented)

xInd (PointerToInt/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const hipComplex * alpha, const hipComplex * A, int lda, int nnz, const hipComplex * x, const int * xInd, const hipComplex * beta, hipComplex * y, hipsparseIndexBase_t idxBase, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgemvi(handle, transA, m, n, alpha, A, lda, nnz, x, xInd, beta, y, idxBase, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

A (Pointer/object):

(undocumented)

lda (int):

(undocumented)

nnz (int):

(undocumented)

x (Pointer/object):

(undocumented)

xInd (PointerToInt/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgemvi(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, const hipDoubleComplex * alpha, const hipDoubleComplex * A, int lda, int nnz, const hipDoubleComplex * x, const int * xInd, const hipDoubleComplex * beta, hipDoubleComplex * y, hipsparseIndexBase_t idxBase, void * pBuffer)
rocm.bindings.hipsparse.hipsparseShybmv(handle, transA, alpha, descrA, hybA, x, beta, y)#

Sparse matrix vector multiplication using the HYB storage format.

hipsparseXhybmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in HYB storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]

with

\[op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \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.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse HYB matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

hybA (Pointer/object) – IN:

matrix in HYB storage format.

x (Pointer/object) – IN:

array of n elements (\(op(A) == A\)) or m elements (\(op(A) == A^T\) or \(op(A) == A^H\)).

beta (Pointer/object) – IN:

scalar \(\beta\).

y (Pointer/object) – INOUT:

array of m elements (\(op(A) == A\)) or n elements (\(op(A) == A^T\) or \(op(A) == A^H\)).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseShybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const float * alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const float * x, const float * beta, float * y)
rocm.bindings.hipsparse.hipsparseDhybmv(handle, transA, alpha, descrA, hybA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

hybA (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDhybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const double * alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const double * x, const double * beta, double * y)
rocm.bindings.hipsparse.hipsparseChybmv(handle, transA, alpha, descrA, hybA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

hybA (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseChybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const hipComplex * x, const hipComplex * beta, hipComplex * y)
rocm.bindings.hipsparse.hipsparseZhybmv(handle, transA, alpha, descrA, hybA, x, beta, y)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

hybA (Pointer/object):

(undocumented)

x (Pointer/object):

(undocumented)

beta (Pointer/object):

(undocumented)

y (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZhybmv(hipsparseHandle_t handle, hipsparseOperation_t transA, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, const hipDoubleComplex * x, const hipDoubleComplex * beta, hipDoubleComplex * y)
rocm.bindings.hipsparse.hipsparseSbsrmm(handle, dirA, transA, transB, mb, n, kb, nnzb, alpha, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, B, ldb, beta, C, ldc)#

Sparse matrix dense matrix multiplication using the BSR storage format.

hipsparseXbsrmm multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(A\), defined in BSR storage format, and the column-oriented dense \(k \times n\) matrix \(B\) and adds the result to the column-oriented dense \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ \end{array} \right.\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks. Can be HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type. Currently, only HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type. Currently, only HIPSPARSE_OPERATION_NON_TRANSPOSE and HIPSPARSE_OPERATION_TRANSPOSE are supported.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the dense matrix \(op(B)\) and \(C\). Must be non-negative.

kb (int) – IN:

number of block columns of the sparse BSR matrix \(A\). Must be non-negative.

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*blockDim*blockDim elements of the sparse BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix \(A\).

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix. Must be positive.

B (Pointer/object) – IN:

array of dimension ldb*n (\(op(B) == B\)), ldb*k otherwise.

ldb (int) – IN:

leading dimension of \(B\), must be at least \(\max{(1, k)}\) (\(op(B) == B\)) where k=blockDim*kb, \(\max{(1, n)}\) otherwise.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension ldc*n.

ldc (int) – IN:

leading dimension of \(C\), must be at least \(\max{(1, m)}\) (\(op(A) == A\)) where m=blockDim*mb, \(\max{(1, k)}\) where k=blockDim*kb otherwise.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrmm(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transB, int mb, int n, int kb, int nnzb, const float * alpha, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const float * B, int ldb, const float * beta, float * C, int ldc)
rocm.bindings.hipsparse.hipsparseDbsrmm(handle, dirA, transA, transB, mb, n, kb, nnzb, alpha, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

n (int):

(undocumented)

kb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrValA (Pointer/object):

(undocumented)

bsrRowPtrA (PointerToInt/object):

(undocumented)

bsrColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrmm(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transB, int mb, int n, int kb, int nnzb, const double * alpha, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const double * B, int ldb, const double * beta, double * C, int ldc)
rocm.bindings.hipsparse.hipsparseCbsrmm(handle, dirA, transA, transB, mb, n, kb, nnzb, alpha, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

n (int):

(undocumented)

kb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrValA (Pointer/object):

(undocumented)

bsrRowPtrA (PointerToInt/object):

(undocumented)

bsrColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrmm(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transB, int mb, int n, int kb, int nnzb, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipComplex * B, int ldb, const hipComplex * beta, hipComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseZbsrmm(handle, dirA, transA, transB, mb, n, kb, nnzb, alpha, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

n (int):

(undocumented)

kb (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrValA (Pointer/object):

(undocumented)

bsrRowPtrA (PointerToInt/object):

(undocumented)

bsrColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrmm(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transB, int mb, int n, int kb, int nnzb, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipDoubleComplex * B, int ldb, const hipDoubleComplex * beta, hipDoubleComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseXbsrsm2_zeroPivot(handle, info, position)#

hipsparseXbsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrsm2_analysis or hipsparseSbsrsm2_solve comp […]

hipsparseXbsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrsm2_analysis or hipsparseSbsrsm2_solve computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the BSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXbsrsm2_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXbsrsm2_zeroPivot(hipsparseHandle_t handle, bsrsm2Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseSbsrsm2_bufferSize(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsm2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDbsrsm2_bufferSize(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsm2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCbsrsm2_bufferSize(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsm2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZbsrsm2_bufferSize(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrsm2_buffer_size returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrsm2_analysis and hipsparseSbsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsm2_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSbsrsm2_analysis(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

Sparse triangular system solve using the BSR storage format.

hipsparseXbsrsm2_analysis performs the analysis step for hipsparseSbsrsm2_solve “hipsparseXbsrsm2_solve()”. It is expected that this function will be executed only once for a given matrix and particular operation type.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix \(A\).

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix \(A\).

blockDim (int) – IN:

block dimension of the sparse BSR matrix \(A\).

info (bsrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsm2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, const float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrsm2_analysis(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

Sparse triangular system solve using the BSR storage format.

hipsparseXbsrsm2_analysis performs the analysis step for hipsparseSbsrsm2_solve “hipsparseXbsrsm2_solve()”. It is expected that this function will be executed only once for a given matrix and particular operation type.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix \(A\).

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix \(A\).

blockDim (int) – IN:

block dimension of the sparse BSR matrix \(A\).

info (bsrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsm2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, const double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrsm2_analysis(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

Sparse triangular system solve using the BSR storage format.

hipsparseXbsrsm2_analysis performs the analysis step for hipsparseSbsrsm2_solve “hipsparseXbsrsm2_solve()”. It is expected that this function will be executed only once for a given matrix and particular operation type.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix \(A\).

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix \(A\).

blockDim (int) – IN:

block dimension of the sparse BSR matrix \(A\).

info (bsrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsm2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrsm2_analysis(handle, dirA, transA, transX, mb, nrhs, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

Sparse triangular system solve using the BSR storage format.

hipsparseXbsrsm2_analysis performs the analysis step for hipsparseSbsrsm2_solve “hipsparseXbsrsm2_solve()”. It is expected that this function will be executed only once for a given matrix and particular operation type.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix \(A\).

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix \(A\).

blockDim (int) – IN:

block dimension of the sparse BSR matrix \(A\).

info (bsrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsm2_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsrsm2_solve(handle, dirA, transA, transX, mb, nrhs, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, B, ldb, X, ldx, policy, pBuffer)#

Sparse triangular system solve using the BSR storage format.

hipsparseXbsrsm2_solve solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in BSR storage format, a column-oriented dense solution matrix \(X\) and the column-oriented dense right-hand side matrix \(B\) that is multiplied by \(\alpha\), such that

\[op(A) \cdot op(X) = \alpha \cdot op(B),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

,

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if transX == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if transX == HIPSPARSE_OPERATION_TRANSPOSE} \\ B^H, & \text{if transX == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(X) = \left* \begin{array}{ll} X, & \text{if transX == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ X^T, & \text{if transX == HIPSPARSE_OPERATION_TRANSPOSE} \\ X^H, & \text{if transX == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and where \(m = blockDim \times mb\).

Note that, as indicated above, the operation type of both \(op(B)\) and \(op(X)\) is specified by the transX parameter and that the operation type of \(B\) and \(X\) must match. For example, if \(op(B)=B\), then \(op(X)=X\). Likewise, if \(op(B)=B^T\), then \(op(X)=X^T\).

Given that the sparse matrix \(A\) is a square matrix, its size is \(m \times m\) regardless of whether \(A\) is transposed or not. The size of the column-oriented dense matrices \(B\) and \(X\) depends on the value of transX:

\[\begin{split}op(B) = \left* \begin{array}{ll} ldb \times nrhs, \text{ } ldb \ge m, & \text{if transX == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transX == HIPSPARSE_OPERATION_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transX == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(X) = \left* \begin{array}{ll} ldb \times nrhs, \text{ } ldb \ge m, & \text{if transX == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transX == HIPSPARSE_OPERATION_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transX == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

hipsparseXbsrsm2_solve requires a user-allocated temporary buffer. Its size is returned by hipsparseSbsrsm2_bufferSize . The size of the required buffer is larger when transA equals HIPSPARSE_OPERATION_TRANSPOSE or HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE and when transX is HIPSPARSE_OPERATION_NON_TRANSPOSE . The subsequent solve will also be faster when \(A\) is non-transposed and \(B\) is transposed (or conjugate transposed). For example, instead of solving:

\[\begin{split}\left[ \begin{array}{c | c} \begin{array}{c c} a_{00} & a_{01} \\ a_{10} & a_{11} \end{array} & \begin{array}{c c} 0 & 0 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} a_{20} & a_{21} \\ a_{30} & a_{31} \end{array} & \begin{array}{c c} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \\ \end{array} \right] \cdot \begin{bmatrix} x_{00} & x_{01} \\ x_{10} & x_{11} \\ x_{20} & x_{21} \\ x_{30} & x_{31} \\ \end{bmatrix} = \begin{bmatrix} b_{00} & b_{01} \\ b_{10} & b_{11} \\ b_{20} & b_{21} \\ b_{30} & b_{31} \\ \end{bmatrix}\end{split}\]

Consider solving:

\[\begin{split}\left[ \begin{array}{c | c} \begin{array}{c c} a_{00} & a_{01} \\ a_{10} & a_{11} \end{array} & \begin{array}{c c} 0 & 0 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} a_{20} & a_{21} \\ a_{30} & a_{31} \end{array} & \begin{array}{c c} a_{22} & a_{23} \\ a_{32} & a_{33} \end{array} \\ \end{array} \right] \cdot \begin{bmatrix} x_{00} & x_{10} & x_{20} & x_{30} \\ x_{01} & x_{11} & x_{21} & x_{31} \end{bmatrix}^{T} = \begin{bmatrix} b_{00} & b_{10} & b_{20} & b_{30} \\ b_{01} & b_{11} & b_{21} & b_{31} \end{bmatrix}^{T}\end{split}\]
Note:

The sparse BSR matrix has to be sorted.

Note:

Operation type of B and X must match if \(op(B)=B, op(X)=X\).

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA != HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE and transX != HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

matrix storage of BSR blocks.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transX (hipsparseOperation_t) – IN:

matrix \(X\) operation type.

mb (int) – IN:

number of block rows of the sparse BSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(X)\).

nnzb (int) – IN:

number of non-zero blocks of the sparse BSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix \(A\).

bsrSortedValA (Pointer/object) – IN:

array of nnzb blocks of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

block dimension of the sparse BSR matrix.

info (bsrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

B (Pointer/object) – IN:

rhs matrix B with leading dimension ldb.

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

X (Pointer/object) – OUT:

solution matrix X with leading dimension ldx.

ldx (int) – IN:

leading dimension of solution matrix \(X\).

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrsm2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const float * alpha, const hipsparseMatDescr_t descrA, const float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, const float * B, int ldb, float * X, int ldx, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrsm2_solve(handle, dirA, transA, transX, mb, nrhs, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, B, ldb, X, ldx, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transX (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nrhs (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsm2Info/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

X (Pointer/object):

(undocumented)

ldx (int):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrsm2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const double * alpha, const hipsparseMatDescr_t descrA, const double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, const double * B, int ldb, double * X, int ldx, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrsm2_solve(handle, dirA, transA, transX, mb, nrhs, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, B, ldb, X, ldx, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transX (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nrhs (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsm2Info/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

X (Pointer/object):

(undocumented)

ldx (int):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrsm2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, const hipComplex * B, int ldb, hipComplex * X, int ldx, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrsm2_solve(handle, dirA, transA, transX, mb, nrhs, nnzb, alpha, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, B, ldb, X, ldx, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transX (hipsparseOperation_t):

(undocumented)

mb (int):

(undocumented)

nrhs (int):

(undocumented)

nnzb (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrsm2Info/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

X (Pointer/object):

(undocumented)

ldx (int):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrsm2_solve(hipsparseHandle_t handle, hipsparseDirection_t dirA, hipsparseOperation_t transA, hipsparseOperation_t transX, int mb, int nrhs, int nnzb, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrsm2Info_t info, const hipDoubleComplex * B, int ldb, hipDoubleComplex * X, int ldx, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsrmm(handle, transA, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

Sparse matrix dense matrix multiplication using the CSR storage format.

hipsparseXcsrmm multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the column-oriented dense \(k \times n\) matrix \(B\) and adds the result to the column-oriented dense \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot op(A) \cdot B + \beta \cdot C,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
for(i = 0; i < ldc; ++i)
{
    for(j = 0; j < n; ++j)
    {
        C[i][j] = beta * C[i][j];

        for(k = csrRowPtr[i]; k < csrRowPtr[i + 1]; ++k)
        {
            C[i][j] += alpha * csrVal[k] * B[csrColInd[k]][j];
        }
    }
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the dense matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the sparse CSR matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of dimension ldb*n (\(op(B) == B\)), ldb*k otherwise.

ldb (int) – IN:

leading dimension of \(B\), must be at least \(\max{(1, k)}\) (\(op(B) == B\)), \(\max{(1, n)}\) otherwise.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension ldc*n.

ldc (int) – IN:

leading dimension of \(C\), must be at least \(\max{(1, m)}\) (\(op(A) == A\)), \(\max{(1, k)}\) otherwise.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrmm(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int k, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * B, int ldb, const float * beta, float * C, int ldc)
rocm.bindings.hipsparse.hipsparseDcsrmm(handle, transA, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrmm(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int k, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * B, int ldb, const double * beta, double * C, int ldc)
rocm.bindings.hipsparse.hipsparseCcsrmm(handle, transA, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrmm(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int k, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * B, int ldb, const hipComplex * beta, hipComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseZcsrmm(handle, transA, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrmm(hipsparseHandle_t handle, hipsparseOperation_t transA, int m, int n, int k, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * B, int ldb, const hipDoubleComplex * beta, hipDoubleComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseScsrmm2(handle, transA, transB, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

Sparse matrix dense matrix multiplication using the CSR storage format.

hipsparseXcsrmm2 multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the column-oriented dense \(k \times n\) matrix \(B\) and adds the result to the column-oriented dense \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ B^H, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
for(i = 0; i < ldc; ++i)
{
    for(j = 0; j < n; ++j)
    {
        C[i][j] = beta * C[i][j];

        for(k = csrRowPtr[i]; k < csrRowPtr[i + 1]; ++k)
        {
            C[i][j] += alpha * csrVal[k] * B[csrColInd[k]][j];
        }
    }
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

n (int) – IN:

number of columns of the dense matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(A\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of dimension ldb*n (\(op(B) == B\)), ldb*k otherwise.

ldb (int) – IN:

leading dimension of \(B\). Must be at least \(\max{(1, k)}\) (\(op(B) == B\)), \(\max{(1, n)}\) otherwise.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension ldc*n.

ldc (int) – IN:

leading dimension of \(C\). Must be at least \(\max{(1, m)}\) (\(op(A) == A\)), \(\max{(1, k)}\) otherwise.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrmm2(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * B, int ldb, const float * beta, float * C, int ldc)
rocm.bindings.hipsparse.hipsparseDcsrmm2(handle, transA, transB, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrmm2(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * B, int ldb, const double * beta, double * C, int ldc)
rocm.bindings.hipsparse.hipsparseCcsrmm2(handle, transA, transB, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrmm2(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * B, int ldb, const hipComplex * beta, hipComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseZcsrmm2(handle, transA, transB, m, n, k, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, beta, C, ldc)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

beta (Pointer/object):

(undocumented)

C (Pointer/object):

(undocumented)

ldc (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrmm2(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * B, int ldb, const hipDoubleComplex * beta, hipDoubleComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseXcsrsm2_zeroPivot(handle, info, position)#

hipsparseXcsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsrsm2_analysis “hipsparseXcsrsm2_analysis()” or `` […]

hipsparseXcsrsm2_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsrsm2_analysis “hipsparseXcsrsm2_analysis()” or hipsparseScsrsm2_solve computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the CSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXcsrsm2_zeroPivot is a blocking function. It might negatively influence performance.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrsm2_zeroPivot(hipsparseHandle_t handle, csrsm2Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseScsrsm2_bufferSizeExt(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBufferSizeInBytes)#

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsm2_bufferSizeExt(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrsm2_bufferSizeExt(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBufferSizeInBytes)#

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsm2_bufferSizeExt(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrsm2_bufferSizeExt(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBufferSizeInBytes)#

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsm2_bufferSizeExt(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrsm2_bufferSizeExt(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBufferSizeInBytes)#

hipsparseXcsrsm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrsm2_analysis and hipsparseScsrsm2_solve .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsm2_bufferSizeExt(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsrsm2_analysis(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve “hipsparseXcsrsm2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsm2_analysis(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrsm2_analysis(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve “hipsparseXcsrsm2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsm2_analysis(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrsm2_analysis(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve “hipsparseXcsrsm2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsm2_analysis(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrsm2_analysis(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

hipsparseXcsrsm2_analysis performs the analysis step for hipsparseScsrsm2_solve “hipsparseXcsrsm2_solve()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – IN:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsm2_analysis(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsrsm2_solve(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

Sparse triangular system solve using the CSR storage format

hipsparseXcsrsm2_solve solves a sparse triangular linear system of a sparse \(m \times m\) matrix, defined in CSR storage format, a column-oriented dense solution matrix \(X\), and the column-oriented dense right-hand side matrix \(B\) that is multiplied by \(\alpha\), such that

\[op(A) \cdot op(X) = \alpha \cdot op(B),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

,

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ B^H, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(X) = \left* \begin{array}{ll} X, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ X^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ X^H, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

The solution is performed in-place, meaning that the matrix \(B\) is overwritten with the solution \(X\) after calling hipsparseXcsrsm2_solve. Given that the sparse matrix \(A\) is a square matrix, its size is \(m \times m\) regardless of whether \(A\) is transposed or not. The size of the column-oriented dense matrices \(B\) and \(X\) depend on the value of transB

\[\begin{split}op(B)/op(X) = \left* \begin{array}{ll} ldb \times nrhs, \text{ } ldb \ge m, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ ldb \times m, \text{ } ldb \ge nrhs, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

hipsparseXcsrsm2_solve requires a user-allocated temporary buffer. Its size is returned by hipsparseScsrsm2_bufferSizeExt . The size of the required buffer is larger when transA equals HIPSPARSE_OPERATION_TRANSPOSE or HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE and when transB is HIPSPARSE_OPERATION_NON_TRANSPOSE . The subsequent solve will also be faster when \(A\) is non-transposed and \(B\) is transposed (or conjugate transposed). For example, instead of solving:

\[\begin{split}\begin{bmatrix} a_{00} & 0 & 0 \\ a_{10} & a_{11} & 0 \\ a_{20} & a_{21} & a_{22} \\ \end{bmatrix} \cdot \begin{bmatrix} x_{00} & x_{01} \\ x_{10} & x_{11} \\ x_{20} & x_{21} \\ \end{bmatrix} = \begin{bmatrix} b_{00} & b_{01} \\ b_{10} & b_{11} \\ b_{20} & b_{21} \\ \end{bmatrix}\end{split}\]

Consider solving:

\[\begin{split}\begin{bmatrix} a_{00} & 0 & 0 \\ a_{10} & a_{11} & 0 \\ a_{20} & a_{21} & a_{22} \end{bmatrix} \cdot \begin{bmatrix} x_{00} & x_{10} & x_{20} \\ x_{01} & x_{11} & x_{21} \end{bmatrix}^{T} = \begin{bmatrix} b_{00} & b_{10} & b_{20} \\ b_{01} & b_{11} & b_{21} \end{bmatrix}^{T}\end{split}\]
Note:

The sparse CSR matrix has to be sorted. This can be achieved by calling hipsparseXcsrsort().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only transA != HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE and transB != HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to use.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(A\).

nrhs (int) – IN:

number of columns of the dense matrix \(op(B)\).

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix \(A\).

B (Pointer/object) – INOUT:

array of m \(\times\) nrhs elements of the rhs matrix \(B\).

ldb (int) – IN:

leading dimension of rhs matrix \(B\).

info (csrsm2Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrsm2_solve(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const float * alpha, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, float * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrsm2_solve(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

algo (int):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nrhs (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

info (csrsm2Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrsm2_solve(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const double * alpha, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, double * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrsm2_solve(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

algo (int):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nrhs (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

info (csrsm2Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrsm2_solve(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipComplex * alpha, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrsm2_solve(handle, algo, transA, transB, m, nrhs, nnz, alpha, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, ldb, info, policy, pBuffer)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

algo (int):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

nrhs (int):

(undocumented)

nnz (int):

(undocumented)

alpha (Pointer/object):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

B (Pointer/object):

(undocumented)

ldb (int):

(undocumented)

info (csrsm2Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrsm2_solve(hipsparseHandle_t handle, int algo, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int nrhs, int nnz, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipDoubleComplex * B, int ldb, csrsm2Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc)#

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseXgemmi multiplies the scalar \(\alpha\) with a dense column-oriented \(m \times k\) matrix \(A\) and the sparse \(k \times n\) matrix \(B\), defined in CSC storage format, and adds the result to the dense column-oriented \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot A \cdot B + \beta \cdot C\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSC matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the dense matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix \(B\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

array of dimension \(lda \times k\) (\(op(A) == A\)) or \(lda \times m\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

lda (int) – IN:

leading dimension of \(A\), must be at least \(m\) (\(op(A) == A\)) or \(k\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

cscValB (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix \(B\).

cscColPtrB (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix \(B\).

cscRowIndB (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSC matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension \(ldc \times n\) that holds the values of \(C\).

ldc (int) – IN:

leading dimension of \(C\), must be at least \(m\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgemmi(hipsparseHandle_t handle, int m, int n, int k, int nnz, const float * alpha, const float * A, int lda, const float * cscValB, const int * cscColPtrB, const int * cscRowIndB, const float * beta, float * C, int ldc)
rocm.bindings.hipsparse.hipsparseDgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc)#

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseXgemmi multiplies the scalar \(\alpha\) with a dense column-oriented \(m \times k\) matrix \(A\) and the sparse \(k \times n\) matrix \(B\), defined in CSC storage format, and adds the result to the dense column-oriented \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot A \cdot B + \beta \cdot C\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSC matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the dense matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix \(B\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

array of dimension \(lda \times k\) (\(op(A) == A\)) or \(lda \times m\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

lda (int) – IN:

leading dimension of \(A\), must be at least \(m\) (\(op(A) == A\)) or \(k\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

cscValB (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix \(B\).

cscColPtrB (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix \(B\).

cscRowIndB (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSC matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension \(ldc \times n\) that holds the values of \(C\).

ldc (int) – IN:

leading dimension of \(C\), must be at least \(m\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgemmi(hipsparseHandle_t handle, int m, int n, int k, int nnz, const double * alpha, const double * A, int lda, const double * cscValB, const int * cscColPtrB, const int * cscRowIndB, const double * beta, double * C, int ldc)
rocm.bindings.hipsparse.hipsparseCgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc)#

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseXgemmi multiplies the scalar \(\alpha\) with a dense column-oriented \(m \times k\) matrix \(A\) and the sparse \(k \times n\) matrix \(B\), defined in CSC storage format, and adds the result to the dense column-oriented \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot A \cdot B + \beta \cdot C\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSC matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the dense matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix \(B\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

array of dimension \(lda \times k\) (\(op(A) == A\)) or \(lda \times m\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

lda (int) – IN:

leading dimension of \(A\), must be at least \(m\) (\(op(A) == A\)) or \(k\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

cscValB (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix \(B\).

cscColPtrB (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix \(B\).

cscRowIndB (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSC matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension \(ldc \times n\) that holds the values of \(C\).

ldc (int) – IN:

leading dimension of \(C\), must be at least \(m\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgemmi(hipsparseHandle_t handle, int m, int n, int k, int nnz, const hipComplex * alpha, const hipComplex * A, int lda, const hipComplex * cscValB, const int * cscColPtrB, const int * cscRowIndB, const hipComplex * beta, hipComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseZgemmi(handle, m, n, k, nnz, alpha, A, lda, cscValB, cscColPtrB, cscRowIndB, beta, C, ldc)#

Dense matrix sparse matrix multiplication using the CSC storage format.

hipsparseXgemmi multiplies the scalar \(\alpha\) with a dense column-oriented \(m \times k\) matrix \(A\) and the sparse \(k \times n\) matrix \(B\), defined in CSC storage format, and adds the result to the dense column-oriented \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot A \cdot B + \beta \cdot C\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix \(A\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSC matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the dense matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix \(B\). Must be non-negative.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

array of dimension \(lda \times k\) (\(op(A) == A\)) or \(lda \times m\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

lda (int) – IN:

leading dimension of \(A\), must be at least \(m\) (\(op(A) == A\)) or \(k\) (\(op(A) == A^T\) or \(op(A) == A^H\)).

cscValB (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix \(B\).

cscColPtrB (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix \(B\).

cscRowIndB (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSC matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

C (Pointer/object) – INOUT:

array of dimension \(ldc \times n\) that holds the values of \(C\).

ldc (int) – IN:

leading dimension of \(C\), must be at least \(m\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgemmi(hipsparseHandle_t handle, int m, int n, int k, int nnz, const hipDoubleComplex * alpha, const hipDoubleComplex * A, int lda, const hipDoubleComplex * cscValB, const int * cscColPtrB, const int * cscRowIndB, const hipDoubleComplex * beta, hipDoubleComplex * C, int ldc)
rocm.bindings.hipsparse.hipsparseXcsrgeamNnz(handle, m, n, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, descrC, csrRowPtrC, nnzTotalDevHostPtr)#

hipsparseXcsrgeamNnz computes the total CSR non-zero elements and the CSR row offsets that point to the start of every row of the sparse CSR matrix of the resulting matrix \(C\).

It is assumed that csrRowPtrC has been allocated with size m+1. The desired index base in the output CSR matrix is set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

For a full code example, see hipsparseScsrgeam ().

Note:

As indicated, nnzTotalDevHostPtr can point to either host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Deprecated:

This function is deprecated and will be removed in a future release.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\). Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\). Must be non-negative.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\). Must be non-negative.

csrRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

pointer to the number of non-zero entries of the sparse CSR matrix \(C\). nnzTotalDevHostPtr can be a host or device pointer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrgeamNnz(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseScsrgeam(handle, m, n, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated and will be removed in a future release.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgeam(hipsparseHandle_t handle, int m, int n, const float * alpha, const hipsparseMatDescr_t descrA, int nnzA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * beta, const hipsparseMatDescr_t descrB, int nnzB, const float * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, float * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseDcsrgeam(handle, m, n, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated and will be removed in a future release.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgeam(hipsparseHandle_t handle, int m, int n, const double * alpha, const hipsparseMatDescr_t descrA, int nnzA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * beta, const hipsparseMatDescr_t descrB, int nnzB, const double * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, double * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseCcsrgeam(handle, m, n, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated and will be removed in a future release.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgeam(hipsparseHandle_t handle, int m, int n, const hipComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, hipComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseZcsrgeam(handle, m, n, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, beta, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated and will be removed in a future release.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgeam(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipDoubleComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseScsrgeam2_bufferSizeExt(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBufferSizeInBytes)#

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgeam2Nnz () and hipsparseScsrgeam2 “hipsparseXcsrgeam2()”.

The temporary storage buffer must be allocated by the user.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgeam2Nnz() and hipsparseScsrgeam2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgeam2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float * alpha, const hipsparseMatDescr_t descrA, int nnzA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * beta, const hipsparseMatDescr_t descrB, int nnzB, const float * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, const float * csrSortedValC, const int * csrSortedRowPtrC, const int * csrSortedColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrgeam2_bufferSizeExt(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBufferSizeInBytes)#

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgeam2Nnz () and hipsparseScsrgeam2 “hipsparseXcsrgeam2()”.

The temporary storage buffer must be allocated by the user.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgeam2Nnz() and hipsparseScsrgeam2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgeam2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double * alpha, const hipsparseMatDescr_t descrA, int nnzA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * beta, const hipsparseMatDescr_t descrB, int nnzB, const double * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, const double * csrSortedValC, const int * csrSortedRowPtrC, const int * csrSortedColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrgeam2_bufferSizeExt(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBufferSizeInBytes)#

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgeam2Nnz () and hipsparseScsrgeam2 “hipsparseXcsrgeam2()”.

The temporary storage buffer must be allocated by the user.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgeam2Nnz() and hipsparseScsrgeam2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgeam2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, const hipComplex * csrSortedValC, const int * csrSortedRowPtrC, const int * csrSortedColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrgeam2_bufferSizeExt(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBufferSizeInBytes)#

hipsparseXcsrgeam2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgeam2Nnz () and hipsparseScsrgeam2 “hipsparseXcsrgeam2()”.

The temporary storage buffer must be allocated by the user.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgeam2Nnz() and hipsparseScsrgeam2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgeam2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, const hipDoubleComplex * csrSortedValC, const int * csrSortedRowPtrC, const int * csrSortedColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcsrgeam2Nnz(handle, m, n, descrA, nnzA, csrSortedRowPtrA, csrSortedColIndA, descrB, nnzB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedRowPtrC, nnzTotalDevHostPtr, workspace)#

hipsparseXcsrgeam2Nnz computes the total CSR non-zero elements and the CSR row offsets that point to the start of every row of the sparse CSR matrix of the resulting matrix \(C\).

It is assumed that csrRowPtrC has been allocated with size m+1. The required buffer size can be obtained by hipsparseScsrgeam2_bufferSizeExt . The desired index base in the output CSR matrix \(C\) is set in the hipsparseMatDescr_t descrC. See hipsparseSetMatIndexBase ().

Note:

As indicated, nnzTotalDevHostPtr can point to either host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

pointer to the number of non-zero entries of the sparse CSR matrix \(C\). nnzTotalDevHostPtr can be a host or device pointer.

workspace (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrgeam2Nnz(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, int nnzA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, int * csrSortedRowPtrC, int * nnzTotalDevHostPtr, void * workspace)
rocm.bindings.hipsparse.hipsparseScsrgeam2(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBuffer)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam2 multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgeam2(hipsparseHandle_t handle, int m, int n, const float * alpha, const hipsparseMatDescr_t descrA, int nnzA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const float * beta, const hipsparseMatDescr_t descrB, int nnzB, const float * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, float * csrSortedValC, int * csrSortedRowPtrC, int * csrSortedColIndC, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrgeam2(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBuffer)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam2 multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgeam2(hipsparseHandle_t handle, int m, int n, const double * alpha, const hipsparseMatDescr_t descrA, int nnzA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const double * beta, const hipsparseMatDescr_t descrB, int nnzB, const double * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, double * csrSortedValC, int * csrSortedRowPtrC, int * csrSortedColIndC, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrgeam2(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBuffer)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam2 multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgeam2(hipsparseHandle_t handle, int m, int n, const hipComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, hipComplex * csrSortedValC, int * csrSortedRowPtrC, int * csrSortedColIndC, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrgeam2(handle, m, n, alpha, descrA, nnzA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, beta, descrB, nnzB, csrSortedValB, csrSortedRowPtrB, csrSortedColIndB, descrC, csrSortedValC, csrSortedRowPtrC, csrSortedColIndC, pBuffer)#

Sparse matrix sparse matrix addition using the CSR storage format.

hipsparseXcsrgeam2 multiplies the scalar \(\alpha\) with the sparse \(m \times n\) matrix \(A\), defined in CSR storage format, multiplies the scalar \(\beta\) with the sparse \(m \times n\) matrix \(B\), defined in CSR storage format, and adds both resulting matrices to obtain the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A + \beta \cdot B.\]
Note:

Both scalars \(\alpha\) and \(beta\) have to be valid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrices \(A\), \(B\), and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrices \(A\), \(B\), and \(C\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrSortedValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).

csrSortedColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrSortedValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrSortedRowPtrB (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).

csrSortedColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValC (Pointer/object) – OUT:

array of elements of the sparse CSR matrix \(C\).

csrSortedRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrSortedColIndC (PointerToInt/object) – OUT:

array of elements containing the column indices of the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgeam2(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, const hipDoubleComplex * beta, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex * csrSortedValB, const int * csrSortedRowPtrB, const int * csrSortedColIndB, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrSortedValC, int * csrSortedRowPtrC, int * csrSortedColIndC, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXcsrgemmNnz(handle, transA, transB, m, n, k, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, descrC, csrRowPtrC, nnzTotalDevHostPtr)#

hipsparseXcsrgemmNnz computes the total CSR non-zero elements and the CSR row offsets that point to the start of every row of the sparse CSR matrix of the resulting multiplied matrix \(C\).

It is assumed that csrRowPtrC has been allocated with size m+1. The desired index base in the output CSR matrix \(C\) is set in the hipsparseMatDescr_t descrC. See hipsparseSetMatIndexBase ().

Note:

As indicated, nnzTotalDevHostPtr can point to either host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only transA == transB == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\). Must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\). Must be non-negative.

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\). Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\). Must be non-negative.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\). Must be non-negative.

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

nnzTotalDevHostPtr (PointerToInt/object) – INOUT:

pointer to the number of non-zero entries of the sparse CSR matrix \(C\). nnzTotalDevHostPtr can be a host or device pointer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrgemmNnz(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseScsrgemm(handle, transA, transB, m, n, k, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

Sparse matrix and sparse matrix multiplication using the CSR storage format.

hipsparseXcsrgemm multiplies the sparse \(m \times k\) matrix \(op(A)\), defined in CSR storage format, with the sparse \(k \times n\) matrix \(op(B)\), defined in CSR storage format, and stores the result in the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := op(A) \cdot op(B),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\ B^H, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
Note:

Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Note:

Currently, only transB == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

transA (hipsparseOperation_t) – IN:

matrix \(A\) operation type.

transB (hipsparseOperation_t) – IN:

matrix \(B\) operation type.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix \(C\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgemm(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const float * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, float * csrValC, const int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseDcsrgemm(handle, transA, transB, m, n, k, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

nnzA (int):

(undocumented)

csrValA (Pointer/object):

(undocumented)

csrRowPtrA (PointerToInt/object):

(undocumented)

csrColIndA (PointerToInt/object):

(undocumented)

descrB (Pointer/object):

(undocumented)

nnzB (int):

(undocumented)

csrValB (Pointer/object):

(undocumented)

csrRowPtrB (PointerToInt/object):

(undocumented)

csrColIndB (PointerToInt/object):

(undocumented)

descrC (Pointer/object):

(undocumented)

csrValC (Pointer/object):

(undocumented)

csrRowPtrC (PointerToInt/object):

(undocumented)

csrColIndC (PointerToInt/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgemm(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const double * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, double * csrValC, const int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseCcsrgemm(handle, transA, transB, m, n, k, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

nnzA (int):

(undocumented)

csrValA (Pointer/object):

(undocumented)

csrRowPtrA (PointerToInt/object):

(undocumented)

csrColIndA (PointerToInt/object):

(undocumented)

descrB (Pointer/object):

(undocumented)

nnzB (int):

(undocumented)

csrValB (Pointer/object):

(undocumented)

csrRowPtrB (PointerToInt/object):

(undocumented)

csrColIndB (PointerToInt/object):

(undocumented)

descrC (Pointer/object):

(undocumented)

csrValC (Pointer/object):

(undocumented)

csrRowPtrC (PointerToInt/object):

(undocumented)

csrColIndC (PointerToInt/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgemm(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, hipComplex * csrValC, const int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseZcsrgemm(handle, transA, transB, m, n, k, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, descrC, csrValC, csrRowPtrC, csrColIndC)#

(No short description, might be part of a group.)

Args:
handle (Pointer/object):

(undocumented)

transA (hipsparseOperation_t):

(undocumented)

transB (hipsparseOperation_t):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

k (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

nnzA (int):

(undocumented)

csrValA (Pointer/object):

(undocumented)

csrRowPtrA (PointerToInt/object):

(undocumented)

csrColIndA (PointerToInt/object):

(undocumented)

descrB (Pointer/object):

(undocumented)

nnzB (int):

(undocumented)

csrValB (Pointer/object):

(undocumented)

csrRowPtrB (PointerToInt/object):

(undocumented)

csrColIndB (PointerToInt/object):

(undocumented)

descrC (Pointer/object):

(undocumented)

csrValC (Pointer/object):

(undocumented)

csrRowPtrC (PointerToInt/object):

(undocumented)

csrColIndC (PointerToInt/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgemm(hipsparseHandle_t handle, hipsparseOperation_t transA, hipsparseOperation_t transB, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrValC, const int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseScsrgemm2_bufferSizeExt(handle, m, n, k, alpha, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrRowPtrD, csrColIndD, info, pBufferSizeInBytes)#

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgemm2Nnz () and hipsparseScsrgemm2 “hipsparseXcsrgemm2()”.

The temporary storage buffer must be allocated by the user.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

info (csrgemm2Info/object) – INOUT:

structure that holds meta data for the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgemm2Nnz(), hipsparseScsrgemm2(), hipsparseDcsrgemm2(), hipsparseCcsrgemm2(), and hipsparseZcsrgemm2().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgemm2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int k, const float * alpha, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const float * beta, const hipsparseMatDescr_t descrD, int nnzD, const int * csrRowPtrD, const int * csrColIndD, csrgemm2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrgemm2_bufferSizeExt(handle, m, n, k, alpha, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrRowPtrD, csrColIndD, info, pBufferSizeInBytes)#

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgemm2Nnz () and hipsparseScsrgemm2 “hipsparseXcsrgemm2()”.

The temporary storage buffer must be allocated by the user.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

info (csrgemm2Info/object) – INOUT:

structure that holds meta data for the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgemm2Nnz(), hipsparseScsrgemm2(), hipsparseDcsrgemm2(), hipsparseCcsrgemm2(), and hipsparseZcsrgemm2().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgemm2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int k, const double * alpha, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const double * beta, const hipsparseMatDescr_t descrD, int nnzD, const int * csrRowPtrD, const int * csrColIndD, csrgemm2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrgemm2_bufferSizeExt(handle, m, n, k, alpha, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrRowPtrD, csrColIndD, info, pBufferSizeInBytes)#

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgemm2Nnz () and hipsparseScsrgemm2 “hipsparseXcsrgemm2()”.

The temporary storage buffer must be allocated by the user.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

info (csrgemm2Info/object) – INOUT:

structure that holds meta data for the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgemm2Nnz(), hipsparseScsrgemm2(), hipsparseDcsrgemm2(), hipsparseCcsrgemm2(), and hipsparseZcsrgemm2().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgemm2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int k, const hipComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const hipComplex * beta, const hipsparseMatDescr_t descrD, int nnzD, const int * csrRowPtrD, const int * csrColIndD, csrgemm2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrgemm2_bufferSizeExt(handle, m, n, k, alpha, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrRowPtrD, csrColIndD, info, pBufferSizeInBytes)#

hipsparseXcsrgemm2_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseXcsrgemm2Nnz () and hipsparseScsrgemm2 “hipsparseXcsrgemm2()”.

The temporary storage buffer must be allocated by the user.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

info (csrgemm2Info/object) – INOUT:

structure that holds meta data for the sparse CSR matrix \(C\).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrgemm2Nnz(), hipsparseScsrgemm2(), hipsparseDcsrgemm2(), hipsparseCcsrgemm2(), and hipsparseZcsrgemm2().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgemm2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int k, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const hipDoubleComplex * beta, const hipsparseMatDescr_t descrD, int nnzD, const int * csrRowPtrD, const int * csrColIndD, csrgemm2Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcsrgemm2Nnz(handle, m, n, k, descrA, nnzA, csrRowPtrA, csrColIndA, descrB, nnzB, csrRowPtrB, csrColIndB, descrD, nnzD, csrRowPtrD, csrColIndD, descrC, csrRowPtrC, nnzTotalDevHostPtr, info, pBuffer)#

hipsparseXcsrgemm2Nnz computes the total CSR non-zero elements and the CSR row offsets that point to the start of every row of the sparse CSR matrix of the resulting multiplied matrix \(C\).

It is assumed that csrRowPtrC has been allocated with size m+1. The required buffer size can be obtained by hipsparseScsrgemm2_bufferSizeExt . The desired index base in the output CSR matrix \(C\) is set in the hipsparseMatDescr_t descrC. See hipsparseSetMatIndexBase ().

Note:

As indicated, nnzTotalDevHostPtr can point to either host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

pointer to the number of non-zero entries of the sparse CSR matrix \(C\).

info (csrgemm2Info/object) – IN:

structure that holds meta data for the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseZcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrgemm2Nnz(hipsparseHandle_t handle, int m, int n, int k, const hipsparseMatDescr_t descrA, int nnzA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const int * csrRowPtrB, const int * csrColIndB, const hipsparseMatDescr_t descrD, int nnzD, const int * csrRowPtrD, const int * csrColIndD, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr, const csrgemm2Info_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer)#

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseXcsrgemm2 multiplies the scalar \(\alpha\) with the sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the sparse \(k \times n\) matrix \(B\), defined in CSR storage format, and adds the result to the sparse \(m \times n\) matrix \(D\) that is multiplied by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A \cdot B + \beta \cdot D\]
Note:

If \(\alpha == 0\), then \(C = \beta \cdot D\) will be computed.

Note:

If \(\beta == 0\), then \(C = \alpha \cdot A \cdot B\) will be computed.

Note:

math:alpha == beta == 0 is invalid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrValD (Pointer/object) – IN:

array of nnzD elements of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix \(C\).

info (csrgemm2Info/object) – IN:

structure that holds meta data for the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseCcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const float * alpha, const hipsparseMatDescr_t descrA, int nnzA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const float * csrValB, const int * csrRowPtrB, const int * csrColIndB, const float * beta, const hipsparseMatDescr_t descrD, int nnzD, const float * csrValD, const int * csrRowPtrD, const int * csrColIndD, const hipsparseMatDescr_t descrC, float * csrValC, const int * csrRowPtrC, int * csrColIndC, const csrgemm2Info_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer)#

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseXcsrgemm2 multiplies the scalar \(\alpha\) with the sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the sparse \(k \times n\) matrix \(B\), defined in CSR storage format, and adds the result to the sparse \(m \times n\) matrix \(D\) that is multiplied by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A \cdot B + \beta \cdot D\]
Note:

If \(\alpha == 0\), then \(C = \beta \cdot D\) will be computed.

Note:

If \(\beta == 0\), then \(C = \alpha \cdot A \cdot B\) will be computed.

Note:

math:alpha == beta == 0 is invalid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrValD (Pointer/object) – IN:

array of nnzD elements of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix \(C\).

info (csrgemm2Info/object) – IN:

structure that holds meta data for the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseCcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const double * alpha, const hipsparseMatDescr_t descrA, int nnzA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const double * csrValB, const int * csrRowPtrB, const int * csrColIndB, const double * beta, const hipsparseMatDescr_t descrD, int nnzD, const double * csrValD, const int * csrRowPtrD, const int * csrColIndD, const hipsparseMatDescr_t descrC, double * csrValC, const int * csrRowPtrC, int * csrColIndC, const csrgemm2Info_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer)#

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseXcsrgemm2 multiplies the scalar \(\alpha\) with the sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the sparse \(k \times n\) matrix \(B\), defined in CSR storage format, and adds the result to the sparse \(m \times n\) matrix \(D\) that is multiplied by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A \cdot B + \beta \cdot D\]
Note:

If \(\alpha == 0\), then \(C = \beta \cdot D\) will be computed.

Note:

If \(\beta == 0\), then \(C = \alpha \cdot A \cdot B\) will be computed.

Note:

math:alpha == beta == 0 is invalid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrValD (Pointer/object) – IN:

array of nnzD elements of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix \(C\).

info (csrgemm2Info/object) – IN:

structure that holds meta data for the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseCcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const hipComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipComplex * beta, const hipsparseMatDescr_t descrD, int nnzD, const hipComplex * csrValD, const int * csrRowPtrD, const int * csrColIndD, const hipsparseMatDescr_t descrC, hipComplex * csrValC, const int * csrRowPtrC, int * csrColIndC, const csrgemm2Info_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrgemm2(handle, m, n, k, alpha, descrA, nnzA, csrValA, csrRowPtrA, csrColIndA, descrB, nnzB, csrValB, csrRowPtrB, csrColIndB, beta, descrD, nnzD, csrValD, csrRowPtrD, csrColIndD, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBuffer)#

Sparse matrix and sparse matrix multiplication using CSR storage format

hipsparseXcsrgemm2 multiplies the scalar \(\alpha\) with the sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the sparse \(k \times n\) matrix \(B\), defined in CSR storage format, and adds the result to the sparse \(m \times n\) matrix \(D\) that is multiplied by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), defined in CSR storage format, such that

\[C := \alpha \cdot A \cdot B + \beta \cdot D\]
Note:

If \(\alpha == 0\), then \(C = \beta \cdot D\) will be computed.

Note:

If \(\beta == 0\), then \(C = \alpha \cdot A \cdot B\) will be computed.

Note:

math:alpha == beta == 0 is invalid.

Note:

Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

For matrix products with more than 4096 non-zero entries per row, an additional temporary storage buffer is allocated by the algorithm.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix \(op(A)\) and \(C\).

n (int) – IN:

number of columns of the sparse CSR matrix \(op(B)\) and \(C\).

k (int) – IN:

number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzA (int) – IN:

number of non-zero entries of the sparse CSR matrix \(A\).

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix \(A\).

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements (\(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix \(A\).

descrB (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzB (int) – IN:

number of non-zero entries of the sparse CSR matrix \(B\).

csrValB (Pointer/object) – IN:

array of nnzB elements of the sparse CSR matrix \(B\).

csrRowPtrB (PointerToInt/object) – IN:

array of k+1 elements (\(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).

csrColIndB (PointerToInt/object) – IN:

array of nnzB elements containing the column indices of the sparse CSR matrix \(B\).

beta (Pointer/object) – IN:

scalar \(\beta\).

descrD (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

nnzD (int) – IN:

number of non-zero entries of the sparse CSR matrix \(D\).

csrValD (Pointer/object) – IN:

array of nnzD elements of the sparse CSR matrix \(D\).

csrRowPtrD (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\).

csrColIndD (PointerToInt/object) – IN:

array of nnzD elements containing the column indices of the sparse CSR matrix \(D\).

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the sparse CSR matrix \(C\).

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\).

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix \(C\).

info (csrgemm2Info/object) – IN:

structure that holds meta data for the sparse CSR matrix \(C\).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseCcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrgemm2(hipsparseHandle_t handle, int m, int n, int k, const hipDoubleComplex * alpha, const hipsparseMatDescr_t descrA, int nnzA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const hipsparseMatDescr_t descrB, int nnzB, const hipDoubleComplex * csrValB, const int * csrRowPtrB, const int * csrColIndB, const hipDoubleComplex * beta, const hipsparseMatDescr_t descrD, int nnzD, const hipDoubleComplex * csrValD, const int * csrRowPtrD, const int * csrColIndD, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrValC, const int * csrRowPtrC, int * csrColIndC, const csrgemm2Info_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXbsric02_zeroPivot(handle, info, position)#

hipsparseXbsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsric02_analysis “hipsparseXbsric02_analysis()” or […]

hipsparseXbsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsric02_analysis “hipsparseXbsric02_analysis()” or hipsparseSbsric02 computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the BSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

If a zero pivot is found, position=j means that either the diagonal block A(j,j) is missing (structural zero) or the diagonal block A(j,j) is not positive definite (numerical zero).

Note:

hipsparseXbsric02_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsric02Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXbsric02_zeroPivot(hipsparseHandle_t handle, bsric02Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseSbsric02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsric02_analysis and hipsparseSbsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix. Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix. Must be positive, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsric02_analysis(), hipsparseDbsric02_analysis(), hipsparseCbsric02_analysis(), hipsparseZbsric02_analysis(), hipsparseSbsric02(), hipsparseDbsric02(), hipsparseCbsric02(), and hipsparseZbsric02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsric02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDbsric02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsric02_analysis and hipsparseSbsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix. Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix. Must be positive, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsric02_analysis(), hipsparseDbsric02_analysis(), hipsparseCbsric02_analysis(), hipsparseZbsric02_analysis(), hipsparseSbsric02(), hipsparseDbsric02(), hipsparseCbsric02(), and hipsparseZbsric02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsric02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCbsric02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsric02_analysis and hipsparseSbsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix. Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix. Must be positive, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsric02_analysis(), hipsparseDbsric02_analysis(), hipsparseCbsric02_analysis(), hipsparseZbsric02_analysis(), hipsparseSbsric02(), hipsparseDbsric02(), hipsparseCbsric02(), and hipsparseZbsric02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsric02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZbsric02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsric02_analysis and hipsparseSbsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix. Must be non-negative.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix. Must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix. Must be positive, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsric02_analysis(), hipsparseDbsric02_analysis(), hipsparseCbsric02_analysis(), hipsparseZbsric02_analysis(), hipsparseSbsric02(), hipsparseDbsric02(), hipsparseCbsric02(), and hipsparseZbsric02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsric02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSbsric02_analysis(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02 “hipsparseXbsric02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsric02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsric02_analysis(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02 “hipsparseXbsric02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsric02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsric02_analysis(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02 “hipsparseXbsric02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsric02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsric02_analysis(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsric02_analysis performs the analysis step for hipsparseSbsric02 “hipsparseXbsric02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsric02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsric02(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR storage format.

hipsparseXbsric02 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse \(mb \times mb\) BSR matrix \(A\), such that

\[A \approx LL^T\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – INOUT:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsric02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsric02(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR storage format.

hipsparseXbsric02 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse \(mb \times mb\) BSR matrix \(A\), such that

\[A \approx LL^T\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – INOUT:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsric02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsric02(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR storage format.

hipsparseXbsric02 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse \(mb \times mb\) BSR matrix \(A\), such that

\[A \approx LL^T\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – INOUT:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsric02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsric02(handle, dirA, mb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, info, policy, pBuffer)#

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR storage format.

hipsparseXbsric02 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse \(mb \times mb\) BSR matrix \(A\), such that

\[A \approx LL^T\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrValA (Pointer/object) – INOUT:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsric02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsric02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, bsric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXbsrilu02_zeroPivot(handle, info, position)#

hipsparseXbsrilu02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrilu02_analysis “hipsparseXbsrilu02_analysis()” […]

hipsparseXbsrilu02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseSbsrilu02_analysis “hipsparseXbsrilu02_analysis()” or hipsparseSbsrilu02 computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the BSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

If a zero pivot is found, position \(=j\) means that either the diagonal block \(A_{j,j}\) is missing (structural zero) or the diagonal block \(A_{j,j}\) is not invertible (numerical zero).

Note:

hipsparseXbsrilu02_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXbsrilu02_zeroPivot(hipsparseHandle_t handle, bsrilu02Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseSbsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrilu02_numericBoost(hipsparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double * tol, float * boost_val)
rocm.bindings.hipsparse.hipsparseDbsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrilu02_numericBoost(hipsparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double * tol, double * boost_val)
rocm.bindings.hipsparse.hipsparseCbsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrilu02_numericBoost(hipsparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double * tol, hipComplex * boost_val)
rocm.bindings.hipsparse.hipsparseZbsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXbsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrilu02_numericBoost(hipsparseHandle_t handle, bsrilu02Info_t info, int enable_boost, double * tol, hipDoubleComplex * boost_val)
rocm.bindings.hipsparse.hipsparseSbsrilu02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrilu02_analysis and hipsparseSbsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrilu02_analysis(), hipsparseDbsrilu02_analysis(), hipsparseCbsrilu02_analysis(), hipsparseZbsrilu02_analysis(), hipsparseSbsrilu02(), hipsparseDbsrilu02(), hipsparseCbsrilu02(), and hipsparseZbsrilu02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrilu02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDbsrilu02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrilu02_analysis and hipsparseSbsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrilu02_analysis(), hipsparseDbsrilu02_analysis(), hipsparseCbsrilu02_analysis(), hipsparseZbsrilu02_analysis(), hipsparseSbsrilu02(), hipsparseDbsrilu02(), hipsparseCbsrilu02(), and hipsparseZbsrilu02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrilu02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCbsrilu02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrilu02_analysis and hipsparseSbsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrilu02_analysis(), hipsparseDbsrilu02_analysis(), hipsparseCbsrilu02_analysis(), hipsparseZbsrilu02_analysis(), hipsparseSbsrilu02(), hipsparseDbsrilu02(), hipsparseCbsrilu02(), and hipsparseZbsrilu02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrilu02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZbsrilu02_bufferSize(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, pBufferSizeInBytes)#

hipsparseXbsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseSbsrilu02_analysis and hipsparseSbsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSbsrilu02_analysis(), hipsparseDbsrilu02_analysis(), hipsparseCbsrilu02_analysis(), hipsparseZbsrilu02_analysis(), hipsparseSbsrilu02(), hipsparseDbsrilu02(), hipsparseCbsrilu02(), and hipsparseZbsrilu02().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrilu02_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSbsrilu02_analysis(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02 “hipsparseXbsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specified whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrilu02_analysis(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02 “hipsparseXbsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specified whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrilu02_analysis(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02 “hipsparseXbsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specified whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrilu02_analysis(handle, dirA, mb, nnzb, descrA, bsrSortedValA, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

hipsparseXbsrilu02_analysis performs the analysis step for hipsparseSbsrilu02 “hipsparseXbsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specified whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA (Pointer/object) – IN:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrilu02_analysis(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsrilu02(handle, dirA, mb, nnzb, descrA, bsrSortedValA_valM, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

Incomplete LU factorization with 0 fill-ins and no pivoting using the BSR storage format.

hipsparseXbsrilu02 computes the incomplete LU factorization with 0 fill-ins and no pivoting of a sparse \(mb \times mb\) BSR matrix \(A\), such that

\[A \approx LU\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specified whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix.

nnzb (int) – IN:

number of non-zero block entries of the sparse BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix.

bsrSortedValA_valM (Pointer/object) – INOUT:

array of length nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrSortedRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrSortedColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between 1 and m where m=mb*blockDim.

info (bsrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float * bsrSortedValA_valM, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDbsrilu02(handle, dirA, mb, nnzb, descrA, bsrSortedValA_valM, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA_valM (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double * bsrSortedValA_valM, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCbsrilu02(handle, dirA, mb, nnzb, descrA, bsrSortedValA_valM, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA_valM (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex * bsrSortedValA_valM, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZbsrilu02(handle, dirA, mb, nnzb, descrA, bsrSortedValA_valM, bsrSortedRowPtrA, bsrSortedColIndA, blockDim, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

dirA (hipsparseDirection_t):

(undocumented)

mb (int):

(undocumented)

nnzb (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

bsrSortedValA_valM (Pointer/object):

(undocumented)

bsrSortedRowPtrA (PointerToInt/object):

(undocumented)

bsrSortedColIndA (PointerToInt/object):

(undocumented)

blockDim (int):

(undocumented)

info (bsrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex * bsrSortedValA_valM, const int * bsrSortedRowPtrA, const int * bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXcsric02_zeroPivot(handle, info, position)#

hipsparseXcsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsric02_analysis “hipsparseXcsric02_analysis()” or […]

hipsparseXcsric02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsric02_analysis “hipsparseXcsric02_analysis()” or hipsparseScsric02 computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the CSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXcsric02_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csric02Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsric02_zeroPivot(hipsparseHandle_t handle, csric02Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseScsric02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsric02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsric02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsric02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsric02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsric02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsric02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsric02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsric02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsric02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsric02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsric02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsric02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsric02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsric02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsric02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsric02_analysis and hipsparseScsric02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsric02_analysis and hipsparseScsric02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsric02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsric02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02 “hipsparseXcsric02()”.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsric02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsric02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02 “hipsparseXcsric02()”.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsric02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsric02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02 “hipsparseXcsric02()”.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsric02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsric02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsric02_analysis performs the analysis step for hipsparseScsric02 “hipsparseXcsric02()”.

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsric02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsric02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the CSR storage format.

hipsparseXcsric02 computes the incomplete Cholesky factorization with 0 fill-ins and no pivoting of a sparse \(m \times m\) CSR matrix \(A\), such that

\[A \approx LL^T\]

where the lower triangular matrix \(L\) is computed using:

\[\begin{split}L_{ij} = \left* \begin{array}{ll} \sqrt{A_{jj} - \sum_{k=0}^{j-1}(L_{jk})^{2}}, & \text{if i == j} \\ \frac{1}{L_{jj}}(A_{jj} - \sum_{k=0}^{j-1}L_{ik} \times L_{jk}), & \text{if i > j} \end{array} \right.\end{split}\]

for each entry found in the CSR matrix \(A\).

Computing the above incomplete Cholesky factorization requires three steps to complete. First, the user determines the size of the required temporary storage buffer by calling hipsparseScsric02_bufferSize . After this buffer size has been determined, the user allocates the buffer and passes it to hipsparseScsric02_analysis . This will perform analysis on the sparsity pattern of the matrix. Finally, the user calls hipsparseScsric02, hipsparseDcsric02, hipsparseCcsric02, or hipsparseZcsric02 to perform the actual factorization. The calculation of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern, while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls to hipsparseScsric02 are complete, the temporary buffer can be deallocated.

When computing the Cholesky factorization, it is possible that \(L_{jj} == 0\), which would result in a division by zero. This could occur from either \(A_{jj}\) not existing in the sparse CSR matrix (referred to as a structural zero) or because \(A_{jj} - \sum_{k=0}^{j-1}(L_{jk})^{2} == 0\) (referred to as a numerical zero). For example, running the Cholesky factorization on the following matrix:

\[\begin{split}\begin{bmatrix} 2 & 1 & 0 \\ 1 & 2 & 1 \\ 0 & 1 & 2 \end{bmatrix}\end{split}\]

results in a successful Cholesky factorization, however running with the matrix:

\[\begin{split}\begin{bmatrix} 2 & 1 & 0 \\ 1 & 1/2 & 1 \\ 0 & 1 & 2 \end{bmatrix}\end{split}\]

results in a numerical zero because:

\[\begin{split}\begin{array}{ll} L_{00} &= \sqrt{2} \\ L_{10} &= \frac{1}{\sqrt{2}} \\ L_{11} &= \sqrt{\frac{1}{2} - (\frac{1}{\sqrt{2}})^2} &= 0 \end{array}\end{split}\]

The user can detect the presence of a structural zero by calling hipsparseXcsric02_zeroPivot () after hipsparseScsric02_analysis and/or the presence of a structural or numerical zero by calling hipsparseXcsric02_zeroPivot () after hipsparseScsric02 :

hipsparseDcsric02(handle,
                  m,
                  nnz,
                  descrM,
                  csrVal,
                  csrRowPtr,
                  csrColInd,
                  info,
                  HIPSPARSE_SOLVE_POLICY_USE_LEVEL,
                  buffer);

// Check for zero pivot
if(CUSPARSE_STATUS_ZERO_PIVOT == hipsparseXcsric02_zeroPivot(handle, info, &position))
{
    printf("L has structural and/or numerical zero at L(%d,%d)\n", position, position);
}

In both cases, hipsparseXcsric02_zeroPivot () will report the first zero pivot (either numerical or structural) found. See the full example below. The user can also set the diagonal type to be \(1\) using hipsparseSetMatDiagType (), which will interpret the matrix \(A\) as having ones on its diagonal (even if no non-zero exists in the sparsity pattern).

hipsparseXcsric02 computes the Cholesky factorization inplace meaning that the values array csrSortedValA_valM of the \(A\) matrix is overwritten with the \(L\) matrix stored in the lower triangular part of \(A\):

\[\begin{split}\begin{align} \begin{bmatrix} a_{00} & a_{01} & a_{02} \\ a_{10} & a_{11} & a_{12} \\ a_{20} & a_{21} & a_{22} \end{bmatrix} \rightarrow \begin{bmatrix} l_{00} & a_{01} & a_{02} \\ l_{10} & l_{11} & a_{12} \\ l_{20} & l_{21} & l_{22} \end{bmatrix} \end{align}\end{split}\]
Note:

The sparse CSR matrix has to be sorted. This can be achieved by calling hipsparseXcsrsort ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA_valM (Pointer/object) – INOUT:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csric02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsric02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsric02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csric02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsric02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsric02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csric02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsric02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsric02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csric02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsric02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csric02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXcsrilu02_zeroPivot(handle, info, position)#

hipsparseXcsrilu02_zeroPivot returns HIPSPARSE_STATUS_ZERO_PIVOT if either a structural or numerical zero has been found during hipsparseScsrilu02 computation.

The first zero pivot \(j\) at \(A_{j,j}\) is stored in position, using the same index base as the CSR matrix.

position can be in host or device memory. If no zero pivot has been found, position is set to -1 and HIPSPARSE_STATUS_SUCCESS is returned instead.

Note:

hipsparseXcsrilu02_zeroPivot is a blocking function. It might negatively influence performance.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

position (PointerToInt/object) – INOUT:

pointer to zero pivot \(j\), which can be in host or device memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrilu02_zeroPivot(hipsparseHandle_t handle, csrilu02Info_t info, int * position)
rocm.bindings.hipsparse.hipsparseScsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrilu02_numericBoost(hipsparseHandle_t handle, csrilu02Info_t info, int enable_boost, double * tol, float * boost_val)
rocm.bindings.hipsparse.hipsparseDcsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrilu02_numericBoost(hipsparseHandle_t handle, csrilu02Info_t info, int enable_boost, double * tol, double * boost_val)
rocm.bindings.hipsparse.hipsparseCcsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrilu02_numericBoost(hipsparseHandle_t handle, csrilu02Info_t info, int enable_boost, double * tol, hipComplex * boost_val)
rocm.bindings.hipsparse.hipsparseZcsrilu02_numericBoost(handle, info, enable_boost, tol, boost_val)#

hipsparseXcsrilu02_numericBoost enables the user to replace a numerical value in an incomplete LU factorization.

tol is used to determine whether a numerical value is replaced by boost_val, such that \(A_{j,j} = \text{boost_val}\) if \(\text{tol} \ge \left|A_{j,j}\right|\).

Note:

The boost value is enabled by setting enable_boost to 1 or disabled by setting enable_boost to 0.

Note:

tol and boost_val can be in host or device memory.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

enable_boost (int) – IN:

enable/disable numeric boost.

tol (Pointer/object) – IN:

tolerance to determine whether a numerical value is replaced or not.

boost_val (Pointer/object) – IN:

boost value to replace a numerical value.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrilu02_numericBoost(hipsparseHandle_t handle, csrilu02Info_t info, int enable_boost, double * tol, hipDoubleComplex * boost_val)
rocm.bindings.hipsparse.hipsparseScsrilu02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrilu02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrilu02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrilu02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrilu02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrilu02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrilu02_bufferSize(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSize returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrilu02_bufferSize(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsrilu02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrilu02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsrilu02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrilu02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsrilu02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrilu02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsrilu02_bufferSizeExt(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, pBufferSizeInBytes)#

hipsparseXcsrilu02_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseScsrilu02_analysis and hipsparseScsrilu02 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrilu02_bufferSizeExt(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsrilu02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02 “hipsparseXcsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrilu02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02 “hipsparseXcsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrilu02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02 “hipsparseXcsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrilu02_analysis(handle, m, nnz, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

hipsparseXcsrilu02_analysis performs the analysis step for hipsparseScsrilu02 “hipsparseXcsrilu02()”.

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

Note:

If the matrix sparsity pattern changes, the gathered information will become invalid.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – OUT:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrilu02_analysis(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsrilu02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

Incomplete LU factorization with 0 fill-ins and no pivoting using the CSR storage format.

hipsparseXcsrilu02 computes the incomplete LU factorization with 0 fill-ins and no pivoting of a sparse \(m \times m\) CSR matrix \(A\), such that

\[A \approx LU\]

where the lower triangular matrix \(L\) and the upper triangular matrix \(U\) are computed using:

\[\begin{split}\begin{array}{ll} L_{ij} = \frac{1}{U_{jj}}(A_{ij} - \sum_{k=0}^{j-1}L_{ik} \times U_{kj}), & \text{if i > j} \\ U_{ij} = (A_{ij} - \sum_{k=0}^{j-1}L_{ik} \times U_{kj}), & \text{if i <= j} \end{array}\end{split}\]

for each entry found in the CSR matrix \(A\).

Computing the above incomplete \(LU\) factorization requires three steps to complete. First, the user determines the size of the required temporary storage buffer by calling hipsparseScsrilu02_bufferSize . After this buffer size has been determined, the user allocates the buffer and passes it to hipsparseScsrilu02_analysis . This will perform analysis on the sparsity pattern of the matrix. Finally, the user calls hipsparseScsrilu02, hipsparseDcsrilu02, hipsparseCcsrilu02, or hipsparseZcsrilu02 to perform the actual factorization. The calculation of the buffer size and the analysis of the sparse matrix only need to be performed once for a given sparsity pattern, while the factorization can be repeatedly applied to multiple matrices having the same sparsity pattern. After all calls to hipsparseScsrilu02 are complete, the temporary buffer can be deallocated.

When computing the \(LU\) factorization, it is possible that \(U_{jj} == 0\) which would result in a division by zero. This could occur from either \(A_{jj}\) not existing in the sparse CSR matrix (referred to as a structural zero) or because \(A_{ij} - \sum_{k=0}^{j-1}L_{ik} \times U_{kj} == 0\) (referred to as a numerical zero). For example, running the \(LU\) factorization on the following matrix:

\[\begin{split}\begin{bmatrix} 2 & 1 & 0 \\ 1 & 2 & 1 \\ 0 & 1 & 2 \end{bmatrix}\end{split}\]

results in a successful \(LU\) factorization. However, running with the matrix:

\[\begin{split}\begin{bmatrix} 2 & 1 & 0 \\ 1 & 1/2 & 1 \\ 0 & 1 & 2 \end{bmatrix}\end{split}\]

results in a numerical zero because:

\[\begin{split}\begin{array}{ll} U_{00} &= 2 \\ U_{01} &= 1 \\ L_{10} &= \frac{1}{2} \\ U_{11} &= \frac{1}{2} - \frac{1}{2} &= 0 \end{array}\end{split}\]

The user can detect the presence of a structural zero by calling hipsparseXcsrilu02_zeroPivot () after hipsparseScsrilu02_analysis and/or the presence of a structural or numerical zero by calling hipsparseXcsrilu02_zeroPivot () after hipsparseScsrilu02 . In both cases, hipsparseXcsrilu02_zeroPivot () will report the first zero pivot (either numerical or structural) found. See the example below. The user can also set the diagonal type to be \(1\) using hipsparseSetMatDiagType (), which will interpret the matrix \(A\) as having ones on its diagonal (even if no nonzero exists in the sparsity pattern).

hipsparseXcsrilu02 computes the \(LU\) factorization inplace, meaning that the values array csrSortedValA_valM of the \(A\) matrix is overwritten with the \(L\) matrix stored in the strictly lower triangular part of \(A\) and the \(U\) matrix stored in the upper part of \(A\):

\[\begin{split}\begin{align} \begin{bmatrix} a_{00} & a_{01} & a_{02} \\ a_{10} & a_{11} & a_{12} \\ a_{20} & a_{21} & a_{22} \end{bmatrix} \rightarrow \begin{bmatrix} u_{00} & u_{01} & u_{02} \\ l_{10} & u_{11} & u_{12} \\ l_{20} & l_{21} & u_{22} \end{bmatrix} \end{align}\end{split}\]
Note:

The sparse CSR matrix has to be sorted. This can be achieved by calling hipsparseXcsrsort ().

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix.

csrSortedValA_valM (Pointer/object) – INOUT:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

info (csrilu02Info/object) – IN:

structure that holds the information collected during the analysis step.

policy (hipsparseSolvePolicy_t) – IN:

HIPSPARSE_SOLVE_POLICY_NO_LEVEL or HIPSPARSE_SOLVE_POLICY_USE_LEVEL .

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrilu02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, float * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsrilu02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrilu02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, double * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsrilu02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrilu02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsrilu02(handle, m, nnz, descrA, csrSortedValA_valM, csrSortedRowPtrA, csrSortedColIndA, info, policy, pBuffer)#

matrix A values are updated inplace to be the preconditioner M values

matrix A values are updated inplace to be the preconditioner M values

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrSortedValA_valM (Pointer/object):

(undocumented)

csrSortedRowPtrA (PointerToInt/object):

(undocumented)

csrSortedColIndA (PointerToInt/object):

(undocumented)

info (csrilu02Info/object):

(undocumented)

policy (hipsparseSolvePolicy_t):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrilu02(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrSortedValA_valM, const int * csrSortedRowPtrA, const int * csrSortedColIndA, csrilu02Info_t info, hipsparseSolvePolicy_t policy, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgpsvInterleavedBatch_bufferSizeExt(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBufferSizeInBytes)#

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgpsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – IN:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – IN:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the pentadiagonal system.

du (Pointer/object) – IN:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – IN:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – IN:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

Number of bytes of the temporary storage buffer required.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgpsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const float * ds, const float * dl, const float * d, const float * du, const float * dw, const float * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgpsvInterleavedBatch_bufferSizeExt(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBufferSizeInBytes)#

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgpsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – IN:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – IN:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the pentadiagonal system.

du (Pointer/object) – IN:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – IN:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – IN:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

Number of bytes of the temporary storage buffer required.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgpsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const double * ds, const double * dl, const double * d, const double * du, const double * dw, const double * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgpsvInterleavedBatch_bufferSizeExt(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBufferSizeInBytes)#

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgpsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – IN:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – IN:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the pentadiagonal system.

du (Pointer/object) – IN:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – IN:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – IN:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

Number of bytes of the temporary storage buffer required.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgpsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const hipComplex * ds, const hipComplex * dl, const hipComplex * d, const hipComplex * du, const hipComplex * dw, const hipComplex * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgpsvInterleavedBatch_bufferSizeExt(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBufferSizeInBytes)#

hipsparseXgpsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgpsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – IN:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – IN:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the pentadiagonal system.

du (Pointer/object) – IN:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – IN:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – IN:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

Number of bytes of the temporary storage buffer required.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgpsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const hipDoubleComplex * ds, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, const hipDoubleComplex * dw, const hipDoubleComplex * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgpsvInterleavedBatch(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBuffer)#

Interleaved batch pentadiagonal solver

hipsparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems

\[P^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(P^{i}\) is a sparse pentadiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the pentadiagonal matrices, \(P^{i}\), are packed in an interleaved fashion into five vectors: ds for the lowest diagonals, dl for the lower diagonals, d for the main diagonals, du for the upper diagonals, and dw for the highest digaonals. See below for a description of the interleaved memory pattern.

Solving the batched pentadiagonal system involves two steps. First, the user calls hipsparseSgpsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgpsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgpsvInterleavedBatch .

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ t^{0}_{20} & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ t^{1}_{20} & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ t^{2}_{20} & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lowest} &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \end{bmatrix} \\ \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{higher} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \text{highest} &= \begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – INOUT:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – INOUT:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – INOUT:

main diagonal of the pentadiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – INOUT:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand-sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

Temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgpsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, float * ds, float * dl, float * d, float * du, float * dw, float * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgpsvInterleavedBatch(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBuffer)#

Interleaved batch pentadiagonal solver

hipsparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems

\[P^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(P^{i}\) is a sparse pentadiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the pentadiagonal matrices, \(P^{i}\), are packed in an interleaved fashion into five vectors: ds for the lowest diagonals, dl for the lower diagonals, d for the main diagonals, du for the upper diagonals, and dw for the highest digaonals. See below for a description of the interleaved memory pattern.

Solving the batched pentadiagonal system involves two steps. First, the user calls hipsparseSgpsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgpsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgpsvInterleavedBatch .

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ t^{0}_{20} & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ t^{1}_{20} & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ t^{2}_{20} & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lowest} &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \end{bmatrix} \\ \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{higher} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \text{highest} &= \begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – INOUT:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – INOUT:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – INOUT:

main diagonal of the pentadiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – INOUT:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand-sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

Temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgpsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, double * ds, double * dl, double * d, double * du, double * dw, double * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgpsvInterleavedBatch(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBuffer)#

Interleaved batch pentadiagonal solver

hipsparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems

\[P^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(P^{i}\) is a sparse pentadiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the pentadiagonal matrices, \(P^{i}\), are packed in an interleaved fashion into five vectors: ds for the lowest diagonals, dl for the lower diagonals, d for the main diagonals, du for the upper diagonals, and dw for the highest digaonals. See below for a description of the interleaved memory pattern.

Solving the batched pentadiagonal system involves two steps. First, the user calls hipsparseSgpsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgpsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgpsvInterleavedBatch .

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ t^{0}_{20} & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ t^{1}_{20} & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ t^{2}_{20} & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lowest} &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \end{bmatrix} \\ \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{higher} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \text{highest} &= \begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – INOUT:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – INOUT:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – INOUT:

main diagonal of the pentadiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – INOUT:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand-sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

Temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgpsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, hipComplex * ds, hipComplex * dl, hipComplex * d, hipComplex * du, hipComplex * dw, hipComplex * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgpsvInterleavedBatch(handle, algo, m, ds, dl, d, du, dw, x, batchCount, pBuffer)#

Interleaved batch pentadiagonal solver

hipsparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems

\[P^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(P^{i}\) is a sparse pentadiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the pentadiagonal matrices, \(P^{i}\), are packed in an interleaved fashion into five vectors: ds for the lowest diagonals, dl for the lower diagonals, d for the main diagonals, du for the upper diagonals, and dw for the highest digaonals. See below for a description of the interleaved memory pattern.

Solving the batched pentadiagonal system involves two steps. First, the user calls hipsparseSgpsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgpsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgpsvInterleavedBatch .

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ t^{0}_{20} & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ t^{1}_{20} & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ t^{2}_{20} & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lowest} &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \end{bmatrix} \\ \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{higher} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \text{highest} &= \begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

algorithm to solve the linear system.

m (int) – IN:

size of the pentadiagonal linear system.

ds (Pointer/object) – INOUT:

lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.

dl (Pointer/object) – INOUT:

lower diagonal of the pentadiagonal system. The first entry must be zero.

d (Pointer/object) – INOUT:

main diagonal of the pentadiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the pentadiagonal system. The last entry must be zero.

dw (Pointer/object) – INOUT:

upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand-sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

Temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgpsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, hipDoubleComplex * ds, hipDoubleComplex * dl, hipDoubleComplex * d, hipDoubleComplex * du, hipDoubleComplex * dw, hipDoubleComplex * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgtsv2_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer that is required by hipsparseSgtsv2 .

The temporary storage buffer must be allocated by the user.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be at least 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

dense matrix of size ( ldb, n ).

ldb (int) – IN:

leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float * dl, const float * d, const float * du, const float * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgtsv2_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer that is required by hipsparseSgtsv2 .

The temporary storage buffer must be allocated by the user.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be at least 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

dense matrix of size ( ldb, n ).

ldb (int) – IN:

leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double * dl, const double * d, const double * du, const double * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgtsv2_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer that is required by hipsparseSgtsv2 .

The temporary storage buffer must be allocated by the user.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be at least 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

dense matrix of size ( ldb, n ).

ldb (int) – IN:

leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipComplex * dl, const hipComplex * d, const hipComplex * du, const hipComplex * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgtsv2_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseSgtsv2_bufferSizeExt returns the size of the temporary storage buffer that is required by hipsparseSgtsv2 .

The temporary storage buffer must be allocated by the user.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be at least 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

dense matrix of size ( ldb, n ).

ldb (int) – IN:

leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2 .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, const hipDoubleComplex * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver with pivoting

hipsparseXgtsv2 solves a tridiagonal system for multiple right-hand sides using pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2(hipsparseHandle_t handle, int m, int n, const float * dl, const float * d, const float * du, float * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver with pivoting

hipsparseXgtsv2 solves a tridiagonal system for multiple right-hand sides using pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2(hipsparseHandle_t handle, int m, int n, const double * dl, const double * d, const double * du, double * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver with pivoting

hipsparseXgtsv2 solves a tridiagonal system for multiple right-hand sides using pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2(hipsparseHandle_t handle, int m, int n, const hipComplex * dl, const hipComplex * d, const hipComplex * du, hipComplex * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgtsv2(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver with pivoting

hipsparseXgtsv2 solves a tridiagonal system for multiple right-hand sides using pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Note:

This routine supports execution in a hipGraph context.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, hipDoubleComplex * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgtsvInterleavedBatch_bufferSizeExt(handle, algo, m, dl, d, du, x, batchCount, pBufferSizeInBytes)#

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsvInterleavedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const float * dl, const float * d, const float * du, const float * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgtsvInterleavedBatch_bufferSizeExt(handle, algo, m, dl, d, du, x, batchCount, pBufferSizeInBytes)#

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsvInterleavedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const double * dl, const double * d, const double * du, const double * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgtsvInterleavedBatch_bufferSizeExt(handle, algo, m, dl, d, du, x, batchCount, pBufferSizeInBytes)#

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsvInterleavedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const hipComplex * dl, const hipComplex * d, const hipComplex * du, const hipComplex * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgtsvInterleavedBatch_bufferSizeExt(handle, algo, m, dl, d, du, x, batchCount, pBufferSizeInBytes)#

hipsparseXgtsvInterleavedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsvInterleavedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsvInterleavedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsvInterleavedBatch_bufferSizeExt(hipsparseHandle_t handle, int algo, int m, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, const hipDoubleComplex * x, int batchCount, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgtsvInterleavedBatch(handle, algo, m, dl, d, du, x, batchCount, pBuffer)#

Interleaved batch tridiagonal solver.

hipsparseXgtsvInterleavedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed in an interleaved fashion into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the interleaved memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgtsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsvInterleavedBatch .

The user can specify different algorithms for hipsparseXgtsvInterleavedBatch to use. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ).

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – INOUT:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – INOUT:

main diagonal of the tridiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, float * dl, float * d, float * du, float * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgtsvInterleavedBatch(handle, algo, m, dl, d, du, x, batchCount, pBuffer)#

Interleaved batch tridiagonal solver.

hipsparseXgtsvInterleavedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed in an interleaved fashion into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the interleaved memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgtsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsvInterleavedBatch .

The user can specify different algorithms for hipsparseXgtsvInterleavedBatch to use. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ).

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – INOUT:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – INOUT:

main diagonal of the tridiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, double * dl, double * d, double * du, double * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgtsvInterleavedBatch(handle, algo, m, dl, d, du, x, batchCount, pBuffer)#

Interleaved batch tridiagonal solver.

hipsparseXgtsvInterleavedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed in an interleaved fashion into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the interleaved memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgtsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsvInterleavedBatch .

The user can specify different algorithms for hipsparseXgtsvInterleavedBatch to use. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ).

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – INOUT:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – INOUT:

main diagonal of the tridiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, hipComplex * dl, hipComplex * d, hipComplex * du, hipComplex * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgtsvInterleavedBatch(handle, algo, m, dl, d, du, x, batchCount, pBuffer)#

Interleaved batch tridiagonal solver.

hipsparseXgtsvInterleavedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed in an interleaved fashion into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the interleaved memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsvInterleavedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgtsvInterleavedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsvInterleavedBatch .

The user can specify different algorithms for hipsparseXgtsvInterleavedBatch to use. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ).

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In interleaved format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

algo (int) – IN:

Algorithm to use when solving tridiagonal systems. Options are Thomas ( algo=0 ), LU ( algo=1 ), or QR ( algo=2 ). The Thomas algorithm is the fastest but is not stable, while LU and QR are slower but are stable.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – INOUT:

lower diagonal of the tridiagonal system. The first element of the lower diagonal must be zero.

d (Pointer/object) – INOUT:

main diagonal of the tridiagonal system.

du (Pointer/object) – INOUT:

upper diagonal of the tridiagonal system. The last element of the upper diagonal must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides with dimension batchCount by m.

batchCount (int) – IN:

The number of systems to solve.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsvInterleavedBatch(hipsparseHandle_t handle, int algo, int m, hipDoubleComplex * dl, hipDoubleComplex * d, hipDoubleComplex * du, hipDoubleComplex * x, int batchCount, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgtsv2_nopivot_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2_nopivot .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be >= 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2_nopivot .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2_nopivot_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float * dl, const float * d, const float * du, const float * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgtsv2_nopivot_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2_nopivot .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be >= 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2_nopivot .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2_nopivot_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double * dl, const double * d, const double * du, const double * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgtsv2_nopivot_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2_nopivot .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be >= 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2_nopivot .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2_nopivot_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipComplex * dl, const hipComplex * d, const hipComplex * du, const hipComplex * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgtsv2_nopivot_bufferSizeExt(handle, m, n, dl, d, du, B, ldb, pBufferSizeInBytes)#

hipsparseXgtsv2_nopivot_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2_nopivot .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system. Must be >= 2.

n (int) – IN:

number of columns in the dense matrix B. Must be non-negative.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – IN:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2_nopivot .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2_nopivot_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, const hipDoubleComplex * B, int ldb, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgtsv2_nopivot(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver (no pivoting)

hipsparseXgtsv2_nopivot solves a tridiagonal linear system for multiple right-hand sides without pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2_nopivot(hipsparseHandle_t handle, int m, int n, const float * dl, const float * d, const float * du, float * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgtsv2_nopivot(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver (no pivoting)

hipsparseXgtsv2_nopivot solves a tridiagonal linear system for multiple right-hand sides without pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2_nopivot(hipsparseHandle_t handle, int m, int n, const double * dl, const double * d, const double * du, double * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgtsv2_nopivot(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver (no pivoting)

hipsparseXgtsv2_nopivot solves a tridiagonal linear system for multiple right-hand sides without pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2_nopivot(hipsparseHandle_t handle, int m, int n, const hipComplex * dl, const hipComplex * d, const hipComplex * du, hipComplex * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgtsv2_nopivot(handle, m, n, dl, d, du, B, ldb, pBuffer)#

Tridiagonal solver (no pivoting)

hipsparseXgtsv2_nopivot solves a tridiagonal linear system for multiple right-hand sides without pivoting

\[T*B = B\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

n (int) – IN:

number of columns in the dense matrix B.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

B (Pointer/object) – INOUT:

Dense matrix of size ( ldb, n ).

ldb (int) – IN:

Leading dimension of B. Must satisfy ldb >= max(1, m).

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2_nopivot(hipsparseHandle_t handle, int m, int n, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, hipDoubleComplex * B, int ldb, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSgtsv2StridedBatch_bufferSizeExt(handle, m, dl, d, du, x, batchCount, batchStride, pBufferSizeInBytes)#

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2StridedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system where the ith system lower diagonal starts at dl+batchStride*i.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system where the ith system diagonal starts at d+batchStride*i.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system where the ith system upper diagonal starts at du+batchStride*i.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2StridedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2StridedBatch_bufferSizeExt(hipsparseHandle_t handle, int m, const float * dl, const float * d, const float * du, const float * x, int batchCount, int batchStride, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgtsv2StridedBatch_bufferSizeExt(handle, m, dl, d, du, x, batchCount, batchStride, pBufferSizeInBytes)#

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2StridedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system where the ith system lower diagonal starts at dl+batchStride*i.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system where the ith system diagonal starts at d+batchStride*i.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system where the ith system upper diagonal starts at du+batchStride*i.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2StridedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2StridedBatch_bufferSizeExt(hipsparseHandle_t handle, int m, const double * dl, const double * d, const double * du, const double * x, int batchCount, int batchStride, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgtsv2StridedBatch_bufferSizeExt(handle, m, dl, d, du, x, batchCount, batchStride, pBufferSizeInBytes)#

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2StridedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system where the ith system lower diagonal starts at dl+batchStride*i.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system where the ith system diagonal starts at d+batchStride*i.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system where the ith system upper diagonal starts at du+batchStride*i.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2StridedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2StridedBatch_bufferSizeExt(hipsparseHandle_t handle, int m, const hipComplex * dl, const hipComplex * d, const hipComplex * du, const hipComplex * x, int batchCount, int batchStride, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgtsv2StridedBatch_bufferSizeExt(handle, m, dl, d, du, x, batchCount, batchStride, pBufferSizeInBytes)#

hipsparseXgtsv2StridedBatch_bufferSizeExt returns the size of the temporary storage buffer in bytes that is required by hipsparseSgtsv2StridedBatch .

The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system.

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system where the ith system lower diagonal starts at dl+batchStride*i.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system where the ith system diagonal starts at d+batchStride*i.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system where the ith system upper diagonal starts at du+batchStride*i.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgtsv2StridedBatch .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2StridedBatch_bufferSizeExt(hipsparseHandle_t handle, int m, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, const hipDoubleComplex * x, int batchCount, int batchStride, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgtsv2StridedBatch(handle, m, dl, d, du, x, batchCount, batchStride, pBuffer)#

Strided batch tridiagonal solver (no pivoting).

hipsparseXgtsv2StridedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed one after the other into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the strided memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsv2StridedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it to hipsparseSgtsv2StridedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsv2StridedBatch .

The strided batch routines write each batch matrix one after the other in memory. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In strided format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & t^{0}_{10} & t^{0}_{21} & 0 & t^{1}_{10} & t^{1}_{21} & 0 & t^{2}_{10} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{0}_{11} & t^{0}_{22} & t^{1}_{00} & t^{1}_{11} & t^{1}_{22} & t^{2}_{00} & t^{2}_{11} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{0}_{12} & 0 & t^{1}_{01} & t^{1}_{12} & 0 & t^{2}_{01} & t^{2}_{12} & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgtsv2StridedBatch(hipsparseHandle_t handle, int m, const float * dl, const float * d, const float * du, float * x, int batchCount, int batchStride, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDgtsv2StridedBatch(handle, m, dl, d, du, x, batchCount, batchStride, pBuffer)#

Strided batch tridiagonal solver (no pivoting).

hipsparseXgtsv2StridedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed one after the other into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the strided memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsv2StridedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it to hipsparseSgtsv2StridedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsv2StridedBatch .

The strided batch routines write each batch matrix one after the other in memory. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In strided format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & t^{0}_{10} & t^{0}_{21} & 0 & t^{1}_{10} & t^{1}_{21} & 0 & t^{2}_{10} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{0}_{11} & t^{0}_{22} & t^{1}_{00} & t^{1}_{11} & t^{1}_{22} & t^{2}_{00} & t^{2}_{11} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{0}_{12} & 0 & t^{1}_{01} & t^{1}_{12} & 0 & t^{2}_{01} & t^{2}_{12} & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgtsv2StridedBatch(hipsparseHandle_t handle, int m, const double * dl, const double * d, const double * du, double * x, int batchCount, int batchStride, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCgtsv2StridedBatch(handle, m, dl, d, du, x, batchCount, batchStride, pBuffer)#

Strided batch tridiagonal solver (no pivoting).

hipsparseXgtsv2StridedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed one after the other into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the strided memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsv2StridedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it to hipsparseSgtsv2StridedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsv2StridedBatch .

The strided batch routines write each batch matrix one after the other in memory. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In strided format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & t^{0}_{10} & t^{0}_{21} & 0 & t^{1}_{10} & t^{1}_{21} & 0 & t^{2}_{10} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{0}_{11} & t^{0}_{22} & t^{1}_{00} & t^{1}_{11} & t^{1}_{22} & t^{2}_{00} & t^{2}_{11} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{0}_{12} & 0 & t^{1}_{01} & t^{1}_{12} & 0 & t^{2}_{01} & t^{2}_{12} & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgtsv2StridedBatch(hipsparseHandle_t handle, int m, const hipComplex * dl, const hipComplex * d, const hipComplex * du, hipComplex * x, int batchCount, int batchStride, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZgtsv2StridedBatch(handle, m, dl, d, du, x, batchCount, batchStride, pBuffer)#

Strided batch tridiagonal solver (no pivoting).

hipsparseXgtsv2StridedBatch solves a batched tridiagonal linear system

\[T^{i}*x^{i} = x^{i}\]

where for each batch \(i=0\ldots\) batchCount, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed one after the other into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of the strided memory pattern.

Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsv2StridedBatch_bufferSizeExt to determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it to hipsparseSgtsv2StridedBatch to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgtsv2StridedBatch .

The strided batch routines write each batch matrix one after the other in memory. For example, consider the following batch matrices:

\[\begin{split}\begin{bmatrix} t^{0}_{00} & t^{0}_{01} & 0 \\ t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\ 0 & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & 0 \\ t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\ 0 & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & 0 \\ t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\ 0 & t^{2}_{21} & t^{2}_{22} \end{bmatrix}\end{split}\]

In strided format, the upper, lower, and diagonal arrays would look like:

\[\begin{split}\begin{align} \text{lower} &= \begin{bmatrix} 0 & t^{0}_{10} & t^{0}_{21} & 0 & t^{1}_{10} & t^{1}_{21} & 0 & t^{2}_{10} & t^{2}_{21} \end{bmatrix} \\ \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{0}_{11} & t^{0}_{22} & t^{1}_{00} & t^{1}_{11} & t^{1}_{22} & t^{2}_{00} & t^{2}_{11} & t^{2}_{22} \end{bmatrix} \\ \text{upper} &= \begin{bmatrix} t^{0}_{01} & t^{0}_{12} & 0 & t^{1}_{01} & t^{1}_{12} & 0 & t^{2}_{01} & t^{2}_{12} & 0 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

size of the tridiagonal linear system (must be >= 2).

dl (Pointer/object) – IN:

lower diagonal of the tridiagonal system. The first entry must be zero.

d (Pointer/object) – IN:

main diagonal of the tridiagonal system.

du (Pointer/object) – IN:

upper diagonal of the tridiagonal system. The last entry must be zero.

x (Pointer/object) – INOUT:

Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.

batchCount (int) – IN:

The number of systems to solve.

batchStride (int) – IN:

The number of elements that separate each system, which must satisfy batchStride >= m.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgtsv2StridedBatch(hipsparseHandle_t handle, int m, const hipDoubleComplex * dl, const hipDoubleComplex * d, const hipDoubleComplex * du, hipDoubleComplex * x, int batchCount, int batchStride, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSbsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseXbsr2csr converts a BSR matrix into a CSR matrix. It is assumed that csrValC, csrColIndC, and csrRowPtrC are allocated. Allocation size for csrRowPtrC is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csrValC and csrColInd is computed by the number of blocks in the BSR matrix multiplied by the block dimension squared.

For example, given the BSR matrix using block dimension 2:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The resulting CSR matrix row pointer, column indices, and values arrays are:

\[\begin{split}\begin{align} \text{csrRowPtrC} &= \begin{bmatrix} 0 & 4 & 8 & 12 & 16 \end{bmatrix} \\ \text{csrColIndC} &= \begin{bmatrix} 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 \end{bmatrix} \\ \text{csrValC} &= \begin{bmatrix} 1 & 0 & 0 & 2 & 3 & 4 & 0 & 0 & 5 & 0 & 6 & 7 & 1 & 2 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix, which must be non-negative.

nb (int) – IN:

number of block columns in the sparse BSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix. Must be positive.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*blockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSbsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipsparseMatDescr_t descrC, float * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseDbsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseXbsr2csr converts a BSR matrix into a CSR matrix. It is assumed that csrValC, csrColIndC, and csrRowPtrC are allocated. Allocation size for csrRowPtrC is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csrValC and csrColInd is computed by the number of blocks in the BSR matrix multiplied by the block dimension squared.

For example, given the BSR matrix using block dimension 2:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The resulting CSR matrix row pointer, column indices, and values arrays are:

\[\begin{split}\begin{align} \text{csrRowPtrC} &= \begin{bmatrix} 0 & 4 & 8 & 12 & 16 \end{bmatrix} \\ \text{csrColIndC} &= \begin{bmatrix} 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 \end{bmatrix} \\ \text{csrValC} &= \begin{bmatrix} 1 & 0 & 0 & 2 & 3 & 4 & 0 & 0 & 5 & 0 & 6 & 7 & 1 & 2 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix, which must be non-negative.

nb (int) – IN:

number of block columns in the sparse BSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix. Must be positive.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*blockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDbsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipsparseMatDescr_t descrC, double * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseCbsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseXbsr2csr converts a BSR matrix into a CSR matrix. It is assumed that csrValC, csrColIndC, and csrRowPtrC are allocated. Allocation size for csrRowPtrC is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csrValC and csrColInd is computed by the number of blocks in the BSR matrix multiplied by the block dimension squared.

For example, given the BSR matrix using block dimension 2:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The resulting CSR matrix row pointer, column indices, and values arrays are:

\[\begin{split}\begin{align} \text{csrRowPtrC} &= \begin{bmatrix} 0 & 4 & 8 & 12 & 16 \end{bmatrix} \\ \text{csrColIndC} &= \begin{bmatrix} 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 \end{bmatrix} \\ \text{csrValC} &= \begin{bmatrix} 1 & 0 & 0 & 2 & 3 & 4 & 0 & 0 & 5 & 0 & 6 & 7 & 1 & 2 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix, which must be non-negative.

nb (int) – IN:

number of block columns in the sparse BSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix. Must be positive.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*blockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCbsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipsparseMatDescr_t descrC, hipComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseZbsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, blockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

Convert a sparse BSR matrix into a sparse CSR matrix.

hipsparseXbsr2csr converts a BSR matrix into a CSR matrix. It is assumed that csrValC, csrColIndC, and csrRowPtrC are allocated. Allocation size for csrRowPtrC is computed by the number of block rows multiplied by the block dimension plus one. Allocation for csrValC and csrColInd is computed by the number of blocks in the BSR matrix multiplied by the block dimension squared.

For example, given the BSR matrix using block dimension 2:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The resulting CSR matrix row pointer, column indices, and values arrays are:

\[\begin{split}\begin{align} \text{csrRowPtrC} &= \begin{bmatrix} 0 & 4 & 8 & 12 & 16 \end{bmatrix} \\ \text{csrColIndC} &= \begin{bmatrix} 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 & 0 & 1 & 2 & 3 \end{bmatrix} \\ \text{csrValC} &= \begin{bmatrix} 1 & 0 & 0 & 2 & 3 & 4 & 0 & 0 & 5 & 0 & 6 & 7 & 1 & 2 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse BSR matrix, which must be non-negative.

nb (int) – IN:

number of block columns in the sparse BSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix. Must be positive.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*blockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*blockDim*blockDim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZbsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int blockDim, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseXcoo2csr(handle, cooRowInd, nnz, m, csrRowPtr, idxBase)#

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.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

cooRowInd (PointerToInt/object) – IN:

array of nnz elements containing the row indices of the sparse COO matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix. Must be non-negative.

m (int) – IN:

number of rows of the sparse CSR matrix. Must be non-negative.

csrRowPtr (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcoo2csr(hipsparseHandle_t handle, const int * cooRowInd, int nnz, int m, int * csrRowPtr, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseXcoosort_bufferSizeExt(handle, m, n, nnz, cooRows, cooCols, pBufferSizeInBytes)#

Sort a sparse COO matrix.

hipsparseXcoosort_bufferSizeExt returns the size of the temporary storage buffer in bytes required by hipsparseXcoosortByRow () and hipsparseXcoosortByColumn (). The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse COO matrix.

n (int) – IN:

number of columns of the sparse COO matrix.

nnz (int) – IN:

number of non-zero entries of the sparse COO matrix.

cooRows (PointerToInt/object) – IN:

array of nnz elements containing the row indices of the sparse COO matrix.

cooCols (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse COO matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcoosortByRow() and hipsparseXcoosortByColumn().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcoosort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int * cooRows, const int * cooCols, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcoosortByRow(handle, m, n, nnz, cooRows, cooCols, P, pBuffer)#

Sort a sparse COO matrix by row.

hipsparseXcoosortByRow sorts a matrix in COO format by row. The sorted permutation vector P can be used to obtain sorted cooVal array. In this case, P must be initialized as the identity permutation. See hipsparseCreateIdentityPermutation (). To apply the permutation vector to the COO values, see hipsparseSgthr .

hipsparseXcoosortByRow requires an extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined by hipsparseXcoosort_bufferSizeExt ().

Note:

P can be NULL if a sorted permutation vector is not required.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse COO matrix.

n (int) – IN:

number of columns of the sparse COO matrix.

nnz (int) – IN:

number of non-zero entries of the sparse COO matrix.

cooRows (PointerToInt/object) – INOUT:

array of nnz elements containing the row indices of the sparse COO matrix.

cooCols (PointerToInt/object) – INOUT:

array of nnz elements containing the column indices of the sparse COO matrix.

P (PointerToInt/object) – INOUT:

array of nnz integers containing the unsorted map indices. Can be NULL.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseXcoosort_bufferSizeExt ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcoosortByRow(hipsparseHandle_t handle, int m, int n, int nnz, int * cooRows, int * cooCols, int * P, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXcoosortByColumn(handle, m, n, nnz, cooRows, cooCols, P, pBuffer)#

Sort a sparse COO matrix by column.

hipsparseXcoosortByColumn sorts a matrix in COO format by column. The sorted permutation vector P can be used to obtain the sorted cooVal array. In this case, P must be initialized as the identity permutation. See hipsparseCreateIdentityPermutation (). To apply the permutation vector to the COO values, see hipsparseSgthr .

hipsparseXcoosortByColumn requires an extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined by hipsparseXcoosort_bufferSizeExt ().

Note:

P can be NULL if a sorted permutation vector is not required.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse COO matrix.

n (int) – IN:

number of columns of the sparse COO matrix.

nnz (int) – IN:

number of non-zero entries of the sparse COO matrix.

cooRows (PointerToInt/object) – INOUT:

array of nnz elements containing the row indices of the sparse COO matrix.

cooCols (PointerToInt/object) – INOUT:

array of nnz elements containing the column indices of the sparse COO matrix.

P (PointerToInt/object) – INOUT:

array of nnz integers containing the unsorted map indices. Can be NULL.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseXcoosort_bufferSizeExt ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcoosortByColumn(hipsparseHandle_t handle, int m, int n, int nnz, int * cooRows, int * cooCols, int * P, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCreateIdentityPermutation(handle, n, p)#

Create the identity map.

hipsparseCreateIdentityPermutation stores the identity map in p, such that \(p = 0:1:(n-1)\).

for(i = 0; i < n; ++i)
{
    p[i] = i;
}
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPASRE library context queue.

n (int) – IN:

size of the map p.

p (PointerToInt/object) – OUT:

array of n integers containing the map.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateIdentityPermutation(hipsparseHandle_t handle, int n, int * p)
rocm.bindings.hipsparse.hipsparseScsc2dense(handle, m, n, descr, cscVal, cscRowInd, cscColPtr, A, ld)#

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

Given the input CSC 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 CSC matrix has index base of one, it must be set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase () prior to calling hipsparseXcsc2dense.

For example, consider the sparse CSC matrix:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]

hipsparseXcsc2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

cscVal (Pointer/object) – IN:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) non-zero elements of matrix A.

cscRowInd (PointerToInt/object) – IN:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – IN:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsc2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float * cscVal, const int * cscRowInd, const int * cscColPtr, float * A, int ld)
rocm.bindings.hipsparse.hipsparseDcsc2dense(handle, m, n, descr, cscVal, cscRowInd, cscColPtr, A, ld)#

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

Given the input CSC 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 CSC matrix has index base of one, it must be set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase () prior to calling hipsparseXcsc2dense.

For example, consider the sparse CSC matrix:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]

hipsparseXcsc2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

cscVal (Pointer/object) – IN:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) non-zero elements of matrix A.

cscRowInd (PointerToInt/object) – IN:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – IN:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsc2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const double * cscVal, const int * cscRowInd, const int * cscColPtr, double * A, int ld)
rocm.bindings.hipsparse.hipsparseCcsc2dense(handle, m, n, descr, cscVal, cscRowInd, cscColPtr, A, ld)#

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

Given the input CSC 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 CSC matrix has index base of one, it must be set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase () prior to calling hipsparseXcsc2dense.

For example, consider the sparse CSC matrix:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]

hipsparseXcsc2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

cscVal (Pointer/object) – IN:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) non-zero elements of matrix A.

cscRowInd (PointerToInt/object) – IN:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – IN:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsc2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipComplex * cscVal, const int * cscRowInd, const int * cscColPtr, hipComplex * A, int ld)
rocm.bindings.hipsparse.hipsparseZcsc2dense(handle, m, n, descr, cscVal, cscRowInd, cscColPtr, A, ld)#

hipsparseXcsc2dense functions convert the sparse matrix in CSC format into a dense matrix.

Given the input CSC 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 CSC matrix has index base of one, it must be set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase () prior to calling hipsparseXcsc2dense.

For example, consider the sparse CSC matrix:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]

hipsparseXcsc2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

cscVal (Pointer/object) – IN:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) non-zero elements of matrix A.

cscRowInd (PointerToInt/object) – IN:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – IN:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsc2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipDoubleComplex * cscVal, const int * cscRowInd, const int * cscColPtr, hipDoubleComplex * A, int ld)
rocm.bindings.hipsparse.hipsparseXcscsort_bufferSizeExt(handle, m, n, nnz, cscColPtr, cscRowInd, pBufferSizeInBytes)#

Sort a sparse CSC matrix.

hipsparseXcscsort_bufferSizeExt returns the size of the temporary storage buffer in bytes required by hipsparseXcscsort(). The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSC matrix.

n (int) – IN:

number of columns of the sparse CSC matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix.

cscColPtr (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

cscRowInd (PointerToInt/object) – IN:

array of nnz elements containing the row indices of the sparse CSC matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcscsort ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcscsort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int * cscColPtr, const int * cscRowInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcscsort(handle, m, n, nnz, descrA, cscColPtr, cscRowInd, P, pBuffer)#

Sort a sparse CSC matrix

hipsparseXcscsort sorts a matrix in CSC format. The sorted permutation vector P can be used to obtain sorted cscVal array. In this case, P must be initialized as the identity permutation. See hipsparseCreateIdentityPermutation (). To apply the permutation vector to the CSC values, see hipsparseSgthr “hipsparseXgthr()”.

hipsparseXcscsort requires extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined by hipsparseXcscsort_bufferSizeExt ().

Note:

P can be NULL if a sorted permutation vector is not required.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSC matrix.

n (int) – IN:

number of columns of the sparse CSC matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSC matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSC matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

cscColPtr (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

cscRowInd (PointerToInt/object) – INOUT:

array of nnz elements containing the row indices of the sparse CSC matrix.

P (PointerToInt/object) – INOUT:

array of nnz integers containing the unsorted map indices. Can be NULL.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseXcscsort_bufferSizeExt ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcscsort(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, const int * cscColPtr, int * cscRowInd, int * P, void * pBuffer)
rocm.bindings.hipsparse.hipsparseXcsr2bsrNnz(handle, dirA, m, n, descrA, csrRowPtrA, csrColIndA, blockDim, descrC, bsrRowPtrC, bsrNnzb)#

This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse BSR matrix, given a sparse CSR matrix as input.

Consider the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \\ 1 & 2 & 3 & 4 \end{bmatrix}\end{split}\]

stored as a sparse CSR matrix. This function computes both the BSR row pointer array as well as the total number of non-zero blocks that results when converting the CSR matrix to the BSR format. Assuming a block dimension of 2, the above matrix, after conversion to the BSR format, looks like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

and the resulting BSR row pointer array and total non-zero blocks after hipsparseXcsr2bsrNnz has been called looks like:

\[\begin{split}\begin{align} \text{bsrRowPtrC} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bsrNnzb} &= 4 \end{align}\end{split}\]

In general, when converting a CSR matrix of size m x n to a BSR matrix, the resulting BSR matrix will have size mb x nb where mb and nb equal:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / blockDim + 1} \\ \text{nb} &= \text{(n - 1) / blockDim + 1} \end{align}\end{split}\]

In particular, it can be the case that blockDim does not divide evenly into m and/or n. In these cases, the CSR matrix is expanded in size to fit full BSR blocks. For example, using the original CSR matrix and block dimension 3 instead of 2, the function hipsparseXcsr2bsrNnz computes the BSR row pointer array and total number of non-zero blocks for the BSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \\ 5 & 0 & 6 \end{array} & \begin{array}{c c c} 2 & 0 & 0 \\ 0 & 0 & 0 \\ 7 & 0 & 0 \end{array} \\ \hline \begin{array}{c c c} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 4 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{array} \\ \end{array} \right]\end{split}\]
Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix. Must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrA (PointerToInt/object) – IN:

integer array containing m+1 elements that points to the start of each row of the CSR matrix.

csrColIndA (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

blockDim (int) – IN:

the block dimension of the BSR matrix, which is between \(1\) and \(\min(m, n)\).

descrC (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrRowPtrC (PointerToInt/object) – OUT:

integer array containing mb+1 elements that point to the start of each block row of the BSR matrix.

bsrNnzb (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsr2bsrNnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const int * csrRowPtrA, const int * csrColIndA, int blockDim, const hipsparseMatDescr_t descrC, int * bsrRowPtrC, int * bsrNnzb)
rocm.bindings.hipsparse.hipsparseScsr2bsr(handle, dirA, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, blockDim, descrC, bsrValC, bsrRowPtrC, bsrColIndC)#

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseXcsr2bsr completes the conversion of a CSR matrix into a BSR matrix. It is assumed that bsrValC, bsrColIndC, and bsrRowPtrC are allocated. The allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the BSR matrix defined as:

\[\begin{align} \text{mb} &= \text{(m - 1) / blockDim + 1} \end{align}\]

The allocation size for bsrColIndC, that is, bsrNnzb, is computed using hipsparseXcsr2bsrNnz (), which also fills the bsrRowPtrC array. The allocation size for bsrValC is then equal to:

\[\text{bsrNnzb * blockDim * blockDim}\]

For example, given the CSR matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \\ 1 & 2 & 3 & 4 \end{bmatrix}\end{split}\]

The resulting BSR matrix using block dimension 2 would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The call to hipsparseXcsr2bsrNnz results in the BSR row pointer array:

\[\begin{split}\begin{align} \text{bsrRowPtrC} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

and the call to hipsparseXcsr2bsr completes the conversion resulting in the BSR column indices and values arrays:

\[\begin{split}\begin{align} \text{bsrColIndC} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrValC} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 0 & 2 & 0 & 0 & 5 & 0 & 1 & 2 & 6 & 7 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

The dirA parameter determines the order of the BSR block values. The example above uses row order. Using column ordering would result instead in the BSR values array:

\[\begin{split}\text{bsrValC} &= \begin{bmatrix} 1 & 3 & 0 & 4 & 0 & 0 & 2 & 0 & 5 & 1 & 0 & 2 & 6 & 3 & 7 & 4 \end{bmatrix} \\\end{split}\]
Note:

hipsparseXcsr2bsr requires extra temporary storage that is allocated internally if blockDim > 16.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrC (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndC (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2bsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, int blockDim, const hipsparseMatDescr_t descrC, float * bsrValC, int * bsrRowPtrC, int * bsrColIndC)
rocm.bindings.hipsparse.hipsparseDcsr2bsr(handle, dirA, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, blockDim, descrC, bsrValC, bsrRowPtrC, bsrColIndC)#

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseXcsr2bsr completes the conversion of a CSR matrix into a BSR matrix. It is assumed that bsrValC, bsrColIndC, and bsrRowPtrC are allocated. The allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the BSR matrix defined as:

\[\begin{align} \text{mb} &= \text{(m - 1) / blockDim + 1} \end{align}\]

The allocation size for bsrColIndC, that is, bsrNnzb, is computed using hipsparseXcsr2bsrNnz (), which also fills the bsrRowPtrC array. The allocation size for bsrValC is then equal to:

\[\text{bsrNnzb * blockDim * blockDim}\]

For example, given the CSR matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \\ 1 & 2 & 3 & 4 \end{bmatrix}\end{split}\]

The resulting BSR matrix using block dimension 2 would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The call to hipsparseXcsr2bsrNnz results in the BSR row pointer array:

\[\begin{split}\begin{align} \text{bsrRowPtrC} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

and the call to hipsparseXcsr2bsr completes the conversion resulting in the BSR column indices and values arrays:

\[\begin{split}\begin{align} \text{bsrColIndC} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrValC} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 0 & 2 & 0 & 0 & 5 & 0 & 1 & 2 & 6 & 7 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

The dirA parameter determines the order of the BSR block values. The example above uses row order. Using column ordering would result instead in the BSR values array:

\[\begin{split}\text{bsrValC} &= \begin{bmatrix} 1 & 3 & 0 & 4 & 0 & 0 & 2 & 0 & 5 & 1 & 0 & 2 & 6 & 3 & 7 & 4 \end{bmatrix} \\\end{split}\]
Note:

hipsparseXcsr2bsr requires extra temporary storage that is allocated internally if blockDim > 16.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrC (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndC (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2bsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, int blockDim, const hipsparseMatDescr_t descrC, double * bsrValC, int * bsrRowPtrC, int * bsrColIndC)
rocm.bindings.hipsparse.hipsparseCcsr2bsr(handle, dirA, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, blockDim, descrC, bsrValC, bsrRowPtrC, bsrColIndC)#

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseXcsr2bsr completes the conversion of a CSR matrix into a BSR matrix. It is assumed that bsrValC, bsrColIndC, and bsrRowPtrC are allocated. The allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the BSR matrix defined as:

\[\begin{align} \text{mb} &= \text{(m - 1) / blockDim + 1} \end{align}\]

The allocation size for bsrColIndC, that is, bsrNnzb, is computed using hipsparseXcsr2bsrNnz (), which also fills the bsrRowPtrC array. The allocation size for bsrValC is then equal to:

\[\text{bsrNnzb * blockDim * blockDim}\]

For example, given the CSR matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \\ 1 & 2 & 3 & 4 \end{bmatrix}\end{split}\]

The resulting BSR matrix using block dimension 2 would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The call to hipsparseXcsr2bsrNnz results in the BSR row pointer array:

\[\begin{split}\begin{align} \text{bsrRowPtrC} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

and the call to hipsparseXcsr2bsr completes the conversion resulting in the BSR column indices and values arrays:

\[\begin{split}\begin{align} \text{bsrColIndC} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrValC} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 0 & 2 & 0 & 0 & 5 & 0 & 1 & 2 & 6 & 7 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

The dirA parameter determines the order of the BSR block values. The example above uses row order. Using column ordering would result instead in the BSR values array:

\[\begin{split}\text{bsrValC} &= \begin{bmatrix} 1 & 3 & 0 & 4 & 0 & 0 & 2 & 0 & 5 & 1 & 0 & 2 & 6 & 3 & 7 & 4 \end{bmatrix} \\\end{split}\]
Note:

hipsparseXcsr2bsr requires extra temporary storage that is allocated internally if blockDim > 16.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrC (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndC (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2bsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const hipComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, int blockDim, const hipsparseMatDescr_t descrC, hipComplex * bsrValC, int * bsrRowPtrC, int * bsrColIndC)
rocm.bindings.hipsparse.hipsparseZcsr2bsr(handle, dirA, m, n, descrA, csrValA, csrRowPtrA, csrColIndA, blockDim, descrC, bsrValC, bsrRowPtrC, bsrColIndC)#

Convert a sparse CSR matrix into a sparse BSR matrix.

hipsparseXcsr2bsr completes the conversion of a CSR matrix into a BSR matrix. It is assumed that bsrValC, bsrColIndC, and bsrRowPtrC are allocated. The allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the BSR matrix defined as:

\[\begin{align} \text{mb} &= \text{(m - 1) / blockDim + 1} \end{align}\]

The allocation size for bsrColIndC, that is, bsrNnzb, is computed using hipsparseXcsr2bsrNnz (), which also fills the bsrRowPtrC array. The allocation size for bsrValC is then equal to:

\[\text{bsrNnzb * blockDim * blockDim}\]

For example, given the CSR matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \\ 1 & 2 & 3 & 4 \end{bmatrix}\end{split}\]

The resulting BSR matrix using block dimension 2 would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

The call to hipsparseXcsr2bsrNnz results in the BSR row pointer array:

\[\begin{split}\begin{align} \text{bsrRowPtrC} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

and the call to hipsparseXcsr2bsr completes the conversion resulting in the BSR column indices and values arrays:

\[\begin{split}\begin{align} \text{bsrColIndC} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrValC} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 0 & 2 & 0 & 0 & 5 & 0 & 1 & 2 & 6 & 7 & 3 & 4 \end{bmatrix} \\ \end{align}\end{split}\]

The dirA parameter determines the order of the BSR block values. The example above uses row order. Using column ordering would result instead in the BSR values array:

\[\begin{split}\text{bsrValC} &= \begin{bmatrix} 1 & 3 & 0 & 4 & 0 & 0 & 2 & 0 & 5 & 1 & 0 & 2 & 6 & 3 & 7 & 4 \end{bmatrix} \\\end{split}\]
Note:

hipsparseXcsr2bsr requires extra temporary storage that is allocated internally if blockDim > 16.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

blockDim (int) – IN:

size of the blocks in the sparse BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValC (Pointer/object) – OUT:

array of nnzb*blockDim*blockDim containing the values of the sparse BSR matrix.

bsrRowPtrC (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndC (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2bsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, int blockDim, const hipsparseMatDescr_t descrC, hipDoubleComplex * bsrValC, int * bsrRowPtrC, int * bsrColIndC)
rocm.bindings.hipsparse.hipsparseXcsr2coo(handle, csrRowPtr, nnz, m, cooRowInd, idxBase)#

Convert a sparse CSR matrix into a sparse COO matrix.

hipsparseXcsr2coo converts the CSR array containing the row offsets that point to the start of every row into a COO array of row indices. All arrays are assumed to be allocated by the user prior to calling hipsparseXcsr2coo.

For example, given the CSR row pointer array (assuming zero index base):

\[\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 1 & 3 & 4 \end{bmatrix} \end{align}\]

Calling hipsparseXcsr2coo results in the COO row indices array:

\[\begin{align} \text{cooRowInd} &= \begin{bmatrix} 0 & 1 & 1 & 2 \end{bmatrix} \end{align}\]
Note:

This function can also be used to convert a CSC array containing the column offsets into a COO array of column indices.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix. Must be non-negative.

m (int) – IN:

number of rows of the sparse CSR matrix. Must be non-negative.

cooRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse COO matrix.

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsr2coo(hipsparseHandle_t handle, const int * csrRowPtr, int nnz, int m, int * cooRowInd, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseScsr2csc(handle, m, n, nnz, csrSortedVal, csrSortedRowPtr, csrSortedColInd, cscSortedVal, cscSortedRowInd, cscSortedColPtr, copyValues, idxBase)#

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseXcsr2csc converts a CSR matrix into a CSC matrix. hipsparseXcsr2csc can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscSortedVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

For example given the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

Represented using the sparse CSR format as:

\[\begin{split}\begin{align} \text{csrSortedRowPtr} &= \begin{bmatrix} 0 & 2 & 4 & 7 \end{bmatrix} \\ \text{csrSortedColInd} &= \begin{bmatrix} 0 & 3 & 0 & 1 & 0 & 2 & 3 \end{bmatrix} \\ \text{csrSortedVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 \end{bmatrix} \end{align}\end{split}\]

this function converts it to the sparse CSC format:

\[\begin{split}\begin{align} \text{cscSortedRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscSortedColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscSortedVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix, which must be non-negative.

csrSortedVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscSortedVal (Pointer/object) – OUT:

array of nnz elements of the sparse CSC matrix.

cscSortedRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse CSC matrix.

cscSortedColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2csc(hipsparseHandle_t handle, int m, int n, int nnz, const float * csrSortedVal, const int * csrSortedRowPtr, const int * csrSortedColInd, float * cscSortedVal, int * cscSortedRowInd, int * cscSortedColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseDcsr2csc(handle, m, n, nnz, csrSortedVal, csrSortedRowPtr, csrSortedColInd, cscSortedVal, cscSortedRowInd, cscSortedColPtr, copyValues, idxBase)#

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseXcsr2csc converts a CSR matrix into a CSC matrix. hipsparseXcsr2csc can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscSortedVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

For example given the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

Represented using the sparse CSR format as:

\[\begin{split}\begin{align} \text{csrSortedRowPtr} &= \begin{bmatrix} 0 & 2 & 4 & 7 \end{bmatrix} \\ \text{csrSortedColInd} &= \begin{bmatrix} 0 & 3 & 0 & 1 & 0 & 2 & 3 \end{bmatrix} \\ \text{csrSortedVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 \end{bmatrix} \end{align}\end{split}\]

this function converts it to the sparse CSC format:

\[\begin{split}\begin{align} \text{cscSortedRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscSortedColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscSortedVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix, which must be non-negative.

csrSortedVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscSortedVal (Pointer/object) – OUT:

array of nnz elements of the sparse CSC matrix.

cscSortedRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse CSC matrix.

cscSortedColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2csc(hipsparseHandle_t handle, int m, int n, int nnz, const double * csrSortedVal, const int * csrSortedRowPtr, const int * csrSortedColInd, double * cscSortedVal, int * cscSortedRowInd, int * cscSortedColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCcsr2csc(handle, m, n, nnz, csrSortedVal, csrSortedRowPtr, csrSortedColInd, cscSortedVal, cscSortedRowInd, cscSortedColPtr, copyValues, idxBase)#

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseXcsr2csc converts a CSR matrix into a CSC matrix. hipsparseXcsr2csc can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscSortedVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

For example given the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

Represented using the sparse CSR format as:

\[\begin{split}\begin{align} \text{csrSortedRowPtr} &= \begin{bmatrix} 0 & 2 & 4 & 7 \end{bmatrix} \\ \text{csrSortedColInd} &= \begin{bmatrix} 0 & 3 & 0 & 1 & 0 & 2 & 3 \end{bmatrix} \\ \text{csrSortedVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 \end{bmatrix} \end{align}\end{split}\]

this function converts it to the sparse CSC format:

\[\begin{split}\begin{align} \text{cscSortedRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscSortedColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscSortedVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix, which must be non-negative.

csrSortedVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscSortedVal (Pointer/object) – OUT:

array of nnz elements of the sparse CSC matrix.

cscSortedRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse CSC matrix.

cscSortedColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2csc(hipsparseHandle_t handle, int m, int n, int nnz, const hipComplex * csrSortedVal, const int * csrSortedRowPtr, const int * csrSortedColInd, hipComplex * cscSortedVal, int * cscSortedRowInd, int * cscSortedColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseZcsr2csc(handle, m, n, nnz, csrSortedVal, csrSortedRowPtr, csrSortedColInd, cscSortedVal, cscSortedRowInd, cscSortedColPtr, copyValues, idxBase)#

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseXcsr2csc converts a CSR matrix into a CSC matrix. hipsparseXcsr2csc can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscSortedVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

For example given the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

Represented using the sparse CSR format as:

\[\begin{split}\begin{align} \text{csrSortedRowPtr} &= \begin{bmatrix} 0 & 2 & 4 & 7 \end{bmatrix} \\ \text{csrSortedColInd} &= \begin{bmatrix} 0 & 3 & 0 & 1 & 0 & 2 & 3 \end{bmatrix} \\ \text{csrSortedVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 5 & 6 & 7 \end{bmatrix} \end{align}\end{split}\]

this function converts it to the sparse CSC format:

\[\begin{split}\begin{align} \text{cscSortedRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscSortedColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscSortedVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix, which must be non-negative.

csrSortedVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrSortedRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscSortedVal (Pointer/object) – OUT:

array of nnz elements of the sparse CSC matrix.

cscSortedRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse CSC matrix.

cscSortedColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2csc(hipsparseHandle_t handle, int m, int n, int nnz, const hipDoubleComplex * csrSortedVal, const int * csrSortedRowPtr, const int * csrSortedColInd, hipDoubleComplex * cscSortedVal, int * cscSortedRowInd, int * cscSortedColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase)
rocm.bindings.hipsparse.hipsparseCsr2cscEx2_bufferSize(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscColPtr, cscRowInd, valType, copyValues, idxBase, alg, pBufferSizeInBytes)#

This function computes the size of the user-allocated temporary storage buffer used when converting a sparse CSR matrix into a sparse CSC matrix.

hipsparseCsr2cscEx2_bufferSize calculates the required user allocated temporary buffer needed by hipsparseCsr2cscEx2 to convert a CSR matrix into a CSC matrix. hipsparseCsr2cscEx2 can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

csrVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscVal (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix.

cscColPtr (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

cscRowInd (PointerToInt/object) – IN:

array of nnz elements containing the row indices of the sparse CSC matrix.

valType (hipDataType) – IN:

The data type of the values arrays csrVal and cscVal. Can be HIP_R_32F, HIP_R_64F, HIP_C_32F, or HIP_C_64F.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

alg (hipsparseCsr2CscAlg_t) – IN:

HIPSPARSE_CSR2CSC_ALG_DEFAULT, HIPSPARSE_CSR2CSC_ALG1, or HIPSPARSE_CSR2CSC_ALG2.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseCsr2cscEx2().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsr2cscEx2_bufferSize(hipsparseHandle_t handle, int m, int n, int nnz, const void * csrVal, const int * csrRowPtr, const int * csrColInd, void * cscVal, int * cscColPtr, int * cscRowInd, hipDataType valType, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, hipsparseCsr2CscAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCsr2cscEx2(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, cscVal, cscColPtr, cscRowInd, valType, copyValues, idxBase, alg, buffer)#

Convert a sparse CSR matrix into a sparse CSC matrix.

hipsparseCsr2cscEx2 converts a CSR matrix into a CSC matrix. hipsparseCsr2cscEx2 can also be used to convert a CSC matrix into a CSR matrix. copyValues decides whether cscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

csrVal (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

cscVal (Pointer/object) – IN:

array of nnz elements of the sparse CSC matrix.

cscColPtr (PointerToInt/object) – IN:

array of n+1 elements that point to the start of every column of the sparse CSC matrix.

cscRowInd (PointerToInt/object) – IN:

array of nnz elements containing the row indices of the sparse CSC matrix.

valType (hipDataType) – IN:

The data type of the values arrays csrVal and cscVal. Can be HIP_R_32F, HIP_R_64F, HIP_C_32F, or HIP_C_64F.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

alg (hipsparseCsr2CscAlg_t) – IN:

HIPSPARSE_CSR2CSC_ALG_DEFAULT, HIPSPARSE_CSR2CSC_ALG1 or HIPSPARSE_CSR2CSC_ALG2.

buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseCsr2cscEx2_bufferSize().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsr2cscEx2(hipsparseHandle_t handle, int m, int n, int nnz, const void * csrVal, const int * csrRowPtr, const int * csrColInd, void * cscVal, int * cscColPtr, int * cscRowInd, hipDataType valType, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, hipsparseCsr2CscAlg_t alg, void * buffer)
rocm.bindings.hipsparse.hipsparseScsr2csr_compress(handle, m, n, descrA, csrValA, csrColIndA, csrRowPtrA, nnzA, nnzPerRow, csrValC, csrColIndC, csrRowPtrC, tol)#

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

descrA (Pointer/object) – IN:

matrix descriptor for the CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the uncompressed sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzA (int) – IN:

number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – IN:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the compressed sparse CSC matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the row indices of the compressed sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every column of the compressed sparse CSR matrix.

tol (float/int) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2csr_compress(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrColIndA, const int * csrRowPtrA, int nnzA, const int * nnzPerRow, float * csrValC, int * csrColIndC, int * csrRowPtrC, float tol)
rocm.bindings.hipsparse.hipsparseDcsr2csr_compress(handle, m, n, descrA, csrValA, csrColIndA, csrRowPtrA, nnzA, nnzPerRow, csrValC, csrColIndC, csrRowPtrC, tol)#

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

descrA (Pointer/object) – IN:

matrix descriptor for the CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the uncompressed sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzA (int) – IN:

number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – IN:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the compressed sparse CSC matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the row indices of the compressed sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every column of the compressed sparse CSR matrix.

tol (float/int) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2csr_compress(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrColIndA, const int * csrRowPtrA, int nnzA, const int * nnzPerRow, double * csrValC, int * csrColIndC, int * csrRowPtrC, double tol)
rocm.bindings.hipsparse.hipsparseCcsr2csr_compress(handle, m, n, descrA, csrValA, csrColIndA, csrRowPtrA, nnzA, nnzPerRow, csrValC, csrColIndC, csrRowPtrC, tol)#

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

descrA (Pointer/object) – IN:

matrix descriptor for the CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the uncompressed sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzA (int) – IN:

number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – IN:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the compressed sparse CSC matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the row indices of the compressed sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every column of the compressed sparse CSR matrix.

tol (float2) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2csr_compress(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const hipComplex * csrValA, const int * csrColIndA, const int * csrRowPtrA, int nnzA, const int * nnzPerRow, hipComplex * csrValC, int * csrColIndC, int * csrRowPtrC, hipComplex tol)
rocm.bindings.hipsparse.hipsparseZcsr2csr_compress(handle, m, n, descrA, csrValA, csrColIndA, csrRowPtrA, nnzA, nnzPerRow, csrValC, csrColIndC, csrRowPtrC, tol)#

Convert a sparse CSR matrix into a compressed sparse CSR matrix.

hipsparseXcsr2csr_compress converts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative threshold tol:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

descrA (Pointer/object) – IN:

matrix descriptor for the CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the uncompressed sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzA (int) – IN:

number of elements in the column indices and values arrays of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – IN:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

csrValC (Pointer/object) – OUT:

array of nnzC elements of the compressed sparse CSC matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the row indices of the compressed sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every column of the compressed sparse CSR matrix.

tol (double2) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrValA, const int * csrColIndA, const int * csrRowPtrA, int nnzA, const int * nnzPerRow, hipDoubleComplex * csrValC, int * csrColIndC, int * csrRowPtrC, hipDoubleComplex tol)
rocm.bindings.hipsparse.hipsparseScsr2csru(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the sorted CSR format to the unsorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2csru(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, float * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsr2csru(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the sorted CSR format to the unsorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2csru(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, double * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsr2csru(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the sorted CSR format to the unsorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2csru(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsr2csru(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the sorted CSR format to the unsorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2csru(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsr2dense(handle, m, n, descr, csrVal, csrRowPtr, csrColInd, A, ld)#

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{split}\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}\end{split}\]

hipsparseXcsr2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A, the supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, float * A, int ld)
rocm.bindings.hipsparse.hipsparseDcsr2dense(handle, m, n, descr, csrVal, csrRowPtr, csrColInd, A, ld)#

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{split}\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}\end{split}\]

hipsparseXcsr2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A, the supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, double * A, int ld)
rocm.bindings.hipsparse.hipsparseCcsr2dense(handle, m, n, descr, csrVal, csrRowPtr, csrColInd, A, ld)#

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{split}\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}\end{split}\]

hipsparseXcsr2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A, the supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipComplex * csrVal, const int * csrRowPtr, const int * csrColInd, hipComplex * A, int ld)
rocm.bindings.hipsparse.hipsparseZcsr2dense(handle, m, n, descr, csrVal, csrRowPtr, csrColInd, A, ld)#

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{split}\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}\end{split}\]

hipsparseXcsr2dense is used to convert to the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the values in the A array are column ordered:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A, the supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

A (Pointer/object) – OUT:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2dense(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipDoubleComplex * csrVal, const int * csrRowPtr, const int * csrColInd, hipDoubleComplex * A, int ld)
rocm.bindings.hipsparse.hipsparseScsr2gebsr_bufferSize(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr_bufferSize returns the size of the temporary buffer that is required by hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr . After the temporary buffer size has been determined, it must be allocated by the user prior to calling hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr .

See hipsparseScsr2gebsr() for a complete code example.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

integer array containing m+1 elements that point to the start of each row of the CSR matrix.

csrColInd (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

rowBlockDim (int) – IN:

the row block dimension of the general BSR matrix. Between 1 and m.

colBlockDim (int) – IN:

the col block dimension of the general BSR matrix. Between 1 and n.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsr2gebsrNnz () and hipsparseScsr2gebsr .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsr2gebsr_bufferSize(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr_bufferSize returns the size of the temporary buffer that is required by hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr . After the temporary buffer size has been determined, it must be allocated by the user prior to calling hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr .

See hipsparseScsr2gebsr() for a complete code example.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

integer array containing m+1 elements that point to the start of each row of the CSR matrix.

csrColInd (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

rowBlockDim (int) – IN:

the row block dimension of the general BSR matrix. Between 1 and m.

colBlockDim (int) – IN:

the col block dimension of the general BSR matrix. Between 1 and n.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsr2gebsrNnz () and hipsparseScsr2gebsr .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsr2gebsr_bufferSize(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr_bufferSize returns the size of the temporary buffer that is required by hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr . After the temporary buffer size has been determined, it must be allocated by the user prior to calling hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr .

See hipsparseScsr2gebsr() for a complete code example.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

integer array containing m+1 elements that point to the start of each row of the CSR matrix.

csrColInd (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

rowBlockDim (int) – IN:

the row block dimension of the general BSR matrix. Between 1 and m.

colBlockDim (int) – IN:

the col block dimension of the general BSR matrix. Between 1 and n.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsr2gebsrNnz () and hipsparseScsr2gebsr .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const hipComplex * csrVal, const int * csrRowPtr, const int * csrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsr2gebsr_bufferSize(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr_bufferSize returns the size of the temporary buffer that is required by hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr . After the temporary buffer size has been determined, it must be allocated by the user prior to calling hipsparseXcsr2gebsrNnz and hipsparseScsr2gebsr .

See hipsparseScsr2gebsr() for a complete code example.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

integer array containing m+1 elements that point to the start of each row of the CSR matrix.

csrColInd (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

rowBlockDim (int) – IN:

the row block dimension of the general BSR matrix. Between 1 and m.

colBlockDim (int) – IN:

the col block dimension of the general BSR matrix. Between 1 and n.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsr2gebsrNnz () and hipsparseScsr2gebsr .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const hipDoubleComplex * csrVal, const int * csrRowPtr, const int * csrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcsr2gebsrNnz(handle, dir, m, n, csr_descr, csrRowPtr, csrColInd, bsr_descr, bsrRowPtr, rowBlockDim, colBlockDim, bsrNnzDevhost, pbuffer)#

This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse GEBSR matrix given a sparse CSR matrix as input.

This is the second step in converting a CSR matrix to a GEBSR matrix. The user must first call hipsparseScsr2gebsr_bufferSize to determine the size of the required temporary storage buffer. The user then allocates this buffer as well as the bsrRowPtr array ( size mb+1 ) and passes both to hipsparseXcsr2gebsrNnz(). This second step then computes the number of non-zero block columns per row and the total number of non-zero blocks.

In general, when converting a CSR matrix of size m x n to a GEBSR matrix, the resulting GEBSR matrix will have size mb x nb, where mb and nb equal:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / rowBlockDim + 1} \\ \text{nb} &= \text{(n - 1) / colBlockDim + 1} \end{align}\end{split}\]

For example, given a matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 & 4 & 0 \\ 3 & 4 & 0 & 0 & 5 & 1 \\ 5 & 0 & 6 & 7 & 6 & 2 \end{bmatrix}\end{split}\]

represented in CSR format with the arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 3 & 7 & 12 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 4 & 0 & 1 & 4 & 5 & 0 & 2 & 3 & 4 & 5 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 1 & 2 & 4 & 3 & 4 & 5 & 1 & 5 & 6 & 7 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

the bsrRowPtr array and total non-zero block count will be filled with:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 3 \end{bmatrix} \\ \text{*bsrNnzDevhost} &= 3 \end{align}\end{split}\]
Note:

As indicated, bsrNnzDevhost can point either to host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

It might be the case that rowBlockDim does not divide evenly into m and/or that colBlockDim does not divide evenly into n. In these cases, the CSR matrix is expanded in size to fit full GEBSR blocks. For example, using the original CSR matrix but this time with rowBlockDim=2 and colBlockDim=3, the function hipsparseXcsr2gebsrNnz computes the GEBSR row pointer array and total number of non-zero blocks for the GEBSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 4 & 0 \\ 0 & 5 & 1 \end{array} \\ \hline \begin{array}{c c c} 5 & 0 & 6 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 7 & 6 & 2 \\ 0 & 0 & 0 \end{array} \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtr (PointerToInt/object) – IN:

integer array containing m+1 elements that point to the start of each row of the CSR matrix.

csrColInd (PointerToInt/object) – IN:

integer array of the column indices for each non-zero element in the CSR matrix.

bsr_descr (Pointer/object) – IN:

descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrRowPtr (PointerToInt/object) – OUT:

integer array containing mb+1 elements that point to the start of each block row of the general BSR matrix.

rowBlockDim (int) – IN:

the row block dimension of the general BSR matrix, which is between \(1\) and \(\min(m, n)\).

colBlockDim (int) – IN:

the col block dimension of the general BSR matrix, which is between \(1\) and \(\min(m, n)\).

bsrNnzDevhost (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

pbuffer (Pointer/object) – IN:

buffer allocated by the user whose size is determined by calling hipsparseScsr2gebsr_bufferSize “hipsparseXcsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsr2gebsrNnz(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const int * csrRowPtr, const int * csrColInd, const hipsparseMatDescr_t bsr_descr, int * bsrRowPtr, int rowBlockDim, int colBlockDim, int * bsrNnzDevhost, void * pbuffer)
rocm.bindings.hipsparse.hipsparseScsr2gebsr(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, bsr_descr, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pbuffer)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr converts a CSR matrix into a GEBSR matrix. It is assumed that bsrVal, bsrColInd, and bsrRowPtr are allocated. Allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed using hipsparseXcsr2gebsrNnz , which also fills in bsrRowPtr.

In more detail, hipsparseXcsr2gebsr is the third and final step of the conversion from CSR to GEBSR. The user first determines the size of the required user-allocated temporary storage buffer using hipsparseScsr2gebsr_bufferSize . The user then allocates this buffer as well as the row pointer array bsrRowPtr with size mb+1, where mb is the number of block rows in the GEBSR matrix and nb is the number of block columns in GEBSR matrix:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / rowBlockDim + 1} \\ \text{nb} &= \text{(n - 1) / colBlockDim + 1} \end{align}\end{split}\]

Both the temporary storage buffer and the GEBSR row pointer array are then passed to hipsparseXcsr2gebsrNnz , which fills the GEBSR row pointer array bsrRowPtr and also computes the number of non-zero blocks, bsrNnzDevhost, that will exist in the GEBSR matrix. The user then allocates both the GEBSR column indices array bsrColInd with size bsrNnzDevhost as well as the GEBSR values array bsrVal with size bsrNnzDevhost*rowBlockDim*colBlockDim. Finally, with all arrays allocated, the conversion is completed by calling hipsparseXcsr2gebsr.

For example, assuming the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 & 4 & 0 \\ 3 & 4 & 0 & 0 & 5 & 1 \\ 5 & 0 & 6 & 7 & 6 & 2 \end{bmatrix}\end{split}\]

represented in CSR format with the arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 3 & 7 & 12 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 4 & 0 & 1 & 4 & 5 & 0 & 2 & 3 & 4 & 5 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 1 & 2 & 4 & 3 & 4 & 5 & 1 & 5 & 6 & 7 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

then using rowBlockDim=3 and colBlockDim=2, the final GEBSR matrix is:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 3 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 6 & 7 \end{array} & \begin{array}{c c} 4 & 0 \\ 5 & 1 \\ 6 & 2 \end{array} \end{array} \right]\end{split}\]

and is represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 3 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 2 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 3 & 0 & 0 & 2 & 0 & 0 & 6 & 7 & 4 & 0 & 5 & 1 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

The above example assumes that the blocks are row ordered. If instead the blocks are column ordered, the bsrVal arrays become:

\[\begin{align} \text{bsrVal} &= \begin{bmatrix} 1 & 3 & 3 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 & 4 & 5 & 6 & 0 & 1 & 2 \end{bmatrix} \end{align}\]

The block order direction is determined by dir.

It might be the case that rowBlockDim does not divide evenly into m and/or that colBlockDim does not divide evenly into n. In these cases, the CSR matrix is expanded in size to fit full GEBSR blocks. For example, using the original CSR matrix but this time with rowBlockDim=2 and colBlockDim=3, the resulting GEBSR matrix would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 4 & 0 \\ 0 & 5 & 1 \end{array} \\ \hline \begin{array}{c c c} 5 & 0 & 6 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 7 & 6 & 2 \\ 0 & 0 & 0 \end{array} \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

bsr_descr (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrVal (Pointer/object) – OUT:

array of nnzb* rowBlockDim* colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtr (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColInd (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

pbuffer (Pointer/object) – IN:

buffer allocated by the user. The buffer size is determined by calling hipsparseScsr2gebsr_bufferSize “hipsparseXcsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, const hipsparseMatDescr_t bsr_descr, float * bsrVal, int * bsrRowPtr, int * bsrColInd, int rowBlockDim, int colBlockDim, void * pbuffer)
rocm.bindings.hipsparse.hipsparseDcsr2gebsr(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, bsr_descr, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pbuffer)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr converts a CSR matrix into a GEBSR matrix. It is assumed that bsrVal, bsrColInd, and bsrRowPtr are allocated. Allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed using hipsparseXcsr2gebsrNnz , which also fills in bsrRowPtr.

In more detail, hipsparseXcsr2gebsr is the third and final step of the conversion from CSR to GEBSR. The user first determines the size of the required user-allocated temporary storage buffer using hipsparseScsr2gebsr_bufferSize . The user then allocates this buffer as well as the row pointer array bsrRowPtr with size mb+1, where mb is the number of block rows in the GEBSR matrix and nb is the number of block columns in GEBSR matrix:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / rowBlockDim + 1} \\ \text{nb} &= \text{(n - 1) / colBlockDim + 1} \end{align}\end{split}\]

Both the temporary storage buffer and the GEBSR row pointer array are then passed to hipsparseXcsr2gebsrNnz , which fills the GEBSR row pointer array bsrRowPtr and also computes the number of non-zero blocks, bsrNnzDevhost, that will exist in the GEBSR matrix. The user then allocates both the GEBSR column indices array bsrColInd with size bsrNnzDevhost as well as the GEBSR values array bsrVal with size bsrNnzDevhost*rowBlockDim*colBlockDim. Finally, with all arrays allocated, the conversion is completed by calling hipsparseXcsr2gebsr.

For example, assuming the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 & 4 & 0 \\ 3 & 4 & 0 & 0 & 5 & 1 \\ 5 & 0 & 6 & 7 & 6 & 2 \end{bmatrix}\end{split}\]

represented in CSR format with the arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 3 & 7 & 12 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 4 & 0 & 1 & 4 & 5 & 0 & 2 & 3 & 4 & 5 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 1 & 2 & 4 & 3 & 4 & 5 & 1 & 5 & 6 & 7 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

then using rowBlockDim=3 and colBlockDim=2, the final GEBSR matrix is:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 3 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 6 & 7 \end{array} & \begin{array}{c c} 4 & 0 \\ 5 & 1 \\ 6 & 2 \end{array} \end{array} \right]\end{split}\]

and is represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 3 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 2 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 3 & 0 & 0 & 2 & 0 & 0 & 6 & 7 & 4 & 0 & 5 & 1 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

The above example assumes that the blocks are row ordered. If instead the blocks are column ordered, the bsrVal arrays become:

\[\begin{align} \text{bsrVal} &= \begin{bmatrix} 1 & 3 & 3 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 & 4 & 5 & 6 & 0 & 1 & 2 \end{bmatrix} \end{align}\]

The block order direction is determined by dir.

It might be the case that rowBlockDim does not divide evenly into m and/or that colBlockDim does not divide evenly into n. In these cases, the CSR matrix is expanded in size to fit full GEBSR blocks. For example, using the original CSR matrix but this time with rowBlockDim=2 and colBlockDim=3, the resulting GEBSR matrix would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 4 & 0 \\ 0 & 5 & 1 \end{array} \\ \hline \begin{array}{c c c} 5 & 0 & 6 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 7 & 6 & 2 \\ 0 & 0 & 0 \end{array} \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

bsr_descr (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrVal (Pointer/object) – OUT:

array of nnzb* rowBlockDim* colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtr (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColInd (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

pbuffer (Pointer/object) – IN:

buffer allocated by the user. The buffer size is determined by calling hipsparseScsr2gebsr_bufferSize “hipsparseXcsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, const hipsparseMatDescr_t bsr_descr, double * bsrVal, int * bsrRowPtr, int * bsrColInd, int rowBlockDim, int colBlockDim, void * pbuffer)
rocm.bindings.hipsparse.hipsparseCcsr2gebsr(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, bsr_descr, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pbuffer)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr converts a CSR matrix into a GEBSR matrix. It is assumed that bsrVal, bsrColInd, and bsrRowPtr are allocated. Allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed using hipsparseXcsr2gebsrNnz , which also fills in bsrRowPtr.

In more detail, hipsparseXcsr2gebsr is the third and final step of the conversion from CSR to GEBSR. The user first determines the size of the required user-allocated temporary storage buffer using hipsparseScsr2gebsr_bufferSize . The user then allocates this buffer as well as the row pointer array bsrRowPtr with size mb+1, where mb is the number of block rows in the GEBSR matrix and nb is the number of block columns in GEBSR matrix:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / rowBlockDim + 1} \\ \text{nb} &= \text{(n - 1) / colBlockDim + 1} \end{align}\end{split}\]

Both the temporary storage buffer and the GEBSR row pointer array are then passed to hipsparseXcsr2gebsrNnz , which fills the GEBSR row pointer array bsrRowPtr and also computes the number of non-zero blocks, bsrNnzDevhost, that will exist in the GEBSR matrix. The user then allocates both the GEBSR column indices array bsrColInd with size bsrNnzDevhost as well as the GEBSR values array bsrVal with size bsrNnzDevhost*rowBlockDim*colBlockDim. Finally, with all arrays allocated, the conversion is completed by calling hipsparseXcsr2gebsr.

For example, assuming the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 & 4 & 0 \\ 3 & 4 & 0 & 0 & 5 & 1 \\ 5 & 0 & 6 & 7 & 6 & 2 \end{bmatrix}\end{split}\]

represented in CSR format with the arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 3 & 7 & 12 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 4 & 0 & 1 & 4 & 5 & 0 & 2 & 3 & 4 & 5 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 1 & 2 & 4 & 3 & 4 & 5 & 1 & 5 & 6 & 7 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

then using rowBlockDim=3 and colBlockDim=2, the final GEBSR matrix is:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 3 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 6 & 7 \end{array} & \begin{array}{c c} 4 & 0 \\ 5 & 1 \\ 6 & 2 \end{array} \end{array} \right]\end{split}\]

and is represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 3 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 2 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 3 & 0 & 0 & 2 & 0 & 0 & 6 & 7 & 4 & 0 & 5 & 1 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

The above example assumes that the blocks are row ordered. If instead the blocks are column ordered, the bsrVal arrays become:

\[\begin{align} \text{bsrVal} &= \begin{bmatrix} 1 & 3 & 3 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 & 4 & 5 & 6 & 0 & 1 & 2 \end{bmatrix} \end{align}\]

The block order direction is determined by dir.

It might be the case that rowBlockDim does not divide evenly into m and/or that colBlockDim does not divide evenly into n. In these cases, the CSR matrix is expanded in size to fit full GEBSR blocks. For example, using the original CSR matrix but this time with rowBlockDim=2 and colBlockDim=3, the resulting GEBSR matrix would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 4 & 0 \\ 0 & 5 & 1 \end{array} \\ \hline \begin{array}{c c c} 5 & 0 & 6 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 7 & 6 & 2 \\ 0 & 0 & 0 \end{array} \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

bsr_descr (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrVal (Pointer/object) – OUT:

array of nnzb* rowBlockDim* colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtr (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColInd (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

pbuffer (Pointer/object) – IN:

buffer allocated by the user. The buffer size is determined by calling hipsparseScsr2gebsr_bufferSize “hipsparseXcsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const hipComplex * csrVal, const int * csrRowPtr, const int * csrColInd, const hipsparseMatDescr_t bsr_descr, hipComplex * bsrVal, int * bsrRowPtr, int * bsrColInd, int rowBlockDim, int colBlockDim, void * pbuffer)
rocm.bindings.hipsparse.hipsparseZcsr2gebsr(handle, dir, m, n, csr_descr, csrVal, csrRowPtr, csrColInd, bsr_descr, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pbuffer)#

Convert a sparse CSR matrix into a sparse GEBSR matrix.

hipsparseXcsr2gebsr converts a CSR matrix into a GEBSR matrix. It is assumed that bsrVal, bsrColInd, and bsrRowPtr are allocated. Allocation size for bsrRowPtr is computed as mb+1, where mb is the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed using hipsparseXcsr2gebsrNnz , which also fills in bsrRowPtr.

In more detail, hipsparseXcsr2gebsr is the third and final step of the conversion from CSR to GEBSR. The user first determines the size of the required user-allocated temporary storage buffer using hipsparseScsr2gebsr_bufferSize . The user then allocates this buffer as well as the row pointer array bsrRowPtr with size mb+1, where mb is the number of block rows in the GEBSR matrix and nb is the number of block columns in GEBSR matrix:

\[\begin{split}\begin{align} \text{mb} &= \text{(m - 1) / rowBlockDim + 1} \\ \text{nb} &= \text{(n - 1) / colBlockDim + 1} \end{align}\end{split}\]

Both the temporary storage buffer and the GEBSR row pointer array are then passed to hipsparseXcsr2gebsrNnz , which fills the GEBSR row pointer array bsrRowPtr and also computes the number of non-zero blocks, bsrNnzDevhost, that will exist in the GEBSR matrix. The user then allocates both the GEBSR column indices array bsrColInd with size bsrNnzDevhost as well as the GEBSR values array bsrVal with size bsrNnzDevhost*rowBlockDim*colBlockDim. Finally, with all arrays allocated, the conversion is completed by calling hipsparseXcsr2gebsr.

For example, assuming the matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 & 4 & 0 \\ 3 & 4 & 0 & 0 & 5 & 1 \\ 5 & 0 & 6 & 7 & 6 & 2 \end{bmatrix}\end{split}\]

represented in CSR format with the arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 3 & 7 & 12 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 4 & 0 & 1 & 4 & 5 & 0 & 2 & 3 & 4 & 5 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 1 & 2 & 4 & 3 & 4 & 5 & 1 & 5 & 6 & 7 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

then using rowBlockDim=3 and colBlockDim=2, the final GEBSR matrix is:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 3 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 6 & 7 \end{array} & \begin{array}{c c} 4 & 0 \\ 5 & 1 \\ 6 & 2 \end{array} \end{array} \right]\end{split}\]

and is represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 3 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 2 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 0 & 3 & 4 & 3 & 0 & 0 & 2 & 0 & 0 & 6 & 7 & 4 & 0 & 5 & 1 & 6 & 2 \end{bmatrix} \end{align}\end{split}\]

The above example assumes that the blocks are row ordered. If instead the blocks are column ordered, the bsrVal arrays become:

\[\begin{align} \text{bsrVal} &= \begin{bmatrix} 1 & 3 & 3 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 & 4 & 5 & 6 & 0 & 1 & 2 \end{bmatrix} \end{align}\]

The block order direction is determined by dir.

It might be the case that rowBlockDim does not divide evenly into m and/or that colBlockDim does not divide evenly into n. In these cases, the CSR matrix is expanded in size to fit full GEBSR blocks. For example, using the original CSR matrix but this time with rowBlockDim=2 and colBlockDim=3, the resulting GEBSR matrix would look like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 4 & 0 \\ 0 & 5 & 1 \end{array} \\ \hline \begin{array}{c c c} 5 & 0 & 6 \\ 0 & 0 & 0 \end{array} & \begin{array}{c c c} 7 & 6 & 2 \\ 0 & 0 & 0 \end{array} \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dir (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

csr_descr (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrVal (Pointer/object) – IN:

array of nnz elements containing the values of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

bsr_descr (Pointer/object) – IN:

descriptor of the sparse BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrVal (Pointer/object) – OUT:

array of nnzb* rowBlockDim* colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtr (PointerToInt/object) – OUT:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColInd (PointerToInt/object) – OUT:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

pbuffer (Pointer/object) – IN:

buffer allocated by the user. The buffer size is determined by calling hipsparseScsr2gebsr_bufferSize “hipsparseXcsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dir, int m, int n, const hipsparseMatDescr_t csr_descr, const hipDoubleComplex * csrVal, const int * csrRowPtr, const int * csrColInd, const hipsparseMatDescr_t bsr_descr, hipDoubleComplex * bsrVal, int * bsrRowPtr, int * bsrColInd, int rowBlockDim, int colBlockDim, void * pbuffer)
rocm.bindings.hipsparse.hipsparseScsr2hyb(handle, m, n, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, hybA, userEllWidth, partitionType)#

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseXcsr2hyb converts a CSR matrix into a HYB matrix. It is assumed that hyb has been initialized with hipsparseCreateHybMat ().

Note:

This function requires a significant amount of storage for the HYB matrix, depending on the matrix structure.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array containing the column indices of the sparse CSR matrix.

hybA (Pointer/object) – OUT:

sparse matrix in HYB format.

userEllWidth (int) – IN:

width of the ELL part of the HYB matrix (only required if partitionType == HIPSPARSE_HYB_PARTITION_USER ). Must be non-negative.

partitionType (hipsparseHybPartition_t) – IN:

HIPSPARSE_HYB_PARTITION_AUTO (recommended), HIPSPARSE_HYB_PARTITION_USER , or HIPSPARSE_HYB_PARTITION_MAX .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsr2hyb(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const float * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipsparseHybMat_t hybA, int userEllWidth, hipsparseHybPartition_t partitionType)
rocm.bindings.hipsparse.hipsparseDcsr2hyb(handle, m, n, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, hybA, userEllWidth, partitionType)#

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseXcsr2hyb converts a CSR matrix into a HYB matrix. It is assumed that hyb has been initialized with hipsparseCreateHybMat ().

Note:

This function requires a significant amount of storage for the HYB matrix, depending on the matrix structure.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array containing the column indices of the sparse CSR matrix.

hybA (Pointer/object) – OUT:

sparse matrix in HYB format.

userEllWidth (int) – IN:

width of the ELL part of the HYB matrix (only required if partitionType == HIPSPARSE_HYB_PARTITION_USER ). Must be non-negative.

partitionType (hipsparseHybPartition_t) – IN:

HIPSPARSE_HYB_PARTITION_AUTO (recommended), HIPSPARSE_HYB_PARTITION_USER , or HIPSPARSE_HYB_PARTITION_MAX .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsr2hyb(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const double * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipsparseHybMat_t hybA, int userEllWidth, hipsparseHybPartition_t partitionType)
rocm.bindings.hipsparse.hipsparseCcsr2hyb(handle, m, n, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, hybA, userEllWidth, partitionType)#

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseXcsr2hyb converts a CSR matrix into a HYB matrix. It is assumed that hyb has been initialized with hipsparseCreateHybMat ().

Note:

This function requires a significant amount of storage for the HYB matrix, depending on the matrix structure.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array containing the column indices of the sparse CSR matrix.

hybA (Pointer/object) – OUT:

sparse matrix in HYB format.

userEllWidth (int) – IN:

width of the ELL part of the HYB matrix (only required if partitionType == HIPSPARSE_HYB_PARTITION_USER ). Must be non-negative.

partitionType (hipsparseHybPartition_t) – IN:

HIPSPARSE_HYB_PARTITION_AUTO (recommended), HIPSPARSE_HYB_PARTITION_USER , or HIPSPARSE_HYB_PARTITION_MAX .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsr2hyb(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const hipComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipsparseHybMat_t hybA, int userEllWidth, hipsparseHybPartition_t partitionType)
rocm.bindings.hipsparse.hipsparseZcsr2hyb(handle, m, n, descrA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, hybA, userEllWidth, partitionType)#

Convert a sparse CSR matrix into a sparse HYB matrix.

hipsparseXcsr2hyb converts a CSR matrix into a HYB matrix. It is assumed that hyb has been initialized with hipsparseCreateHybMat ().

Note:

This function requires a significant amount of storage for the HYB matrix, depending on the matrix structure.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix, which must be non-negative.

n (int) – IN:

number of columns of the sparse CSR matrix, which must be non-negative.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrSortedValA (Pointer/object) – IN:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – IN:

array containing the column indices of the sparse CSR matrix.

hybA (Pointer/object) – OUT:

sparse matrix in HYB format.

userEllWidth (int) – IN:

width of the ELL part of the HYB matrix (only required if partitionType == HIPSPARSE_HYB_PARTITION_USER ). Must be non-negative.

partitionType (hipsparseHybPartition_t) – IN:

HIPSPARSE_HYB_PARTITION_AUTO (recommended), HIPSPARSE_HYB_PARTITION_USER , or HIPSPARSE_HYB_PARTITION_MAX .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsr2hyb(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrSortedValA, const int * csrSortedRowPtrA, const int * csrSortedColIndA, hipsparseHybMat_t hybA, int userEllWidth, hipsparseHybPartition_t partitionType)
rocm.bindings.hipsparse.hipsparseXcsrsort_bufferSizeExt(handle, m, n, nnz, csrRowPtr, csrColInd, pBufferSizeInBytes)#

Sort a sparse CSR matrix.

hipsparseXcsrsort_bufferSizeExt returns the size of the temporary storage buffer in bytes required by hipsparseXcsrsort(). The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXcsrsort ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrsort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int * csrRowPtr, const int * csrColInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXcsrsort(handle, m, n, nnz, descrA, csrRowPtr, csrColInd, P, pBuffer)#

Sort a sparse CSR matrix.

hipsparseXcsrsort sorts a matrix in CSR format. The sorted permutation vector P can be used to obtain the sorted csrVal array. In this case, P must be initialized as the identity permutation. See hipsparseCreateIdentityPermutation (). To apply the permutation vector to the CSR values, see hipsparseSgthr “hipsparseXgthr()”.

hipsparseXcsrsort requires extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined by hipsparseXcsrsort_bufferSizeExt().

Note:

P can be NULL if a sorted permutation vector is not required.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

n (int) – IN:

number of columns of the sparse CSR matrix.

nnz (int) – IN:

number of non-zero entries of the sparse CSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColInd (PointerToInt/object) – INOUT:

array of nnz elements containing the column indices of the sparse CSR matrix.

P (PointerToInt/object) – INOUT:

array of nnz integers containing the unsorted map indices. Can be NULL.

pBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseXcsrsort_bufferSizeExt ().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXcsrsort(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, const int * csrRowPtr, int * csrColInd, int * P, void * pBuffer)
rocm.bindings.hipsparse.hipsparseScsru2csr_bufferSizeExt(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function calculates the amount of temporary storage in bytes required for hipsparseXcsru2csr() and hipsparseXcsr2csru().

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBufferSizeInBytes (PointerToUInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsru2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, float * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDcsru2csr_bufferSizeExt(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function calculates the amount of temporary storage in bytes required for hipsparseXcsru2csr() and hipsparseXcsr2csru().

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBufferSizeInBytes (PointerToUInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsru2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, double * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCcsru2csr_bufferSizeExt(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function calculates the amount of temporary storage in bytes required for hipsparseXcsru2csr() and hipsparseXcsr2csru().

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBufferSizeInBytes (PointerToUInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsru2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, hipComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZcsru2csr_bufferSizeExt(handle, m, n, nnz, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function calculates the amount of temporary storage in bytes required for hipsparseXcsru2csr() and hipsparseXcsr2csru().

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBufferSizeInBytes (PointerToUInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsru2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, hipDoubleComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseScsru2csr(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the unsorted CSR format to the sorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsru2csr(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, float * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseDcsru2csr(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the unsorted CSR format to the sorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsru2csr(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, double * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseCcsru2csr(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the unsorted CSR format to the sorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsru2csr(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, hipComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseZcsru2csr(handle, m, n, nnz, descrA, csrVal, csrRowPtr, csrColInd, info, pBuffer)#

This function converts the unsorted CSR format to the sorted CSR format. The required temporary storage has to be allocated by the user.

Args:
handle (Pointer/object):

(undocumented)

m (int):

(undocumented)

n (int):

(undocumented)

nnz (int):

(undocumented)

descrA (Pointer/object):

(undocumented)

csrVal (Pointer/object):

(undocumented)

csrRowPtr (PointerToInt/object):

(undocumented)

csrColInd (PointerToInt/object):

(undocumented)

info (csru2csrInfo/object):

(undocumented)

pBuffer (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsru2csr(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, hipDoubleComplex * csrVal, const int * csrRowPtr, int * csrColInd, csru2csrInfo_t info, void * pBuffer)
rocm.bindings.hipsparse.hipsparseSdense2csc(handle, m, n, descr, A, ld, nnzPerColumn, cscVal, cscRowInd, cscColPtr)#

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

Given a dense, column-ordered, matrix A with leading dimension ld, where ld>=m, hipsparseXdense2csc converts the matrix to a sparse CSC format matrix. All the parameters are assumed to have been preallocated by the user and the arrays are filled in based on number of non-zeros per row, which can be pre-computed with hipsparseSnnz . Users can set the desired index base in the output CSC matrix by setting it in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (that is, the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the A values have column ordering with leading dimension ld=m:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]

the conversion results in the CSC arrays:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerColumn (PointerToInt/object) – IN:

array of size n containing the number of non-zero elements per column.

cscVal (Pointer/object) – OUT:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) nonzero elements of matrix A.

cscRowInd (PointerToInt/object) – OUT:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – OUT:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSdense2csc(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float * A, int ld, const int * nnzPerColumn, float * cscVal, int * cscRowInd, int * cscColPtr)
rocm.bindings.hipsparse.hipsparseDdense2csc(handle, m, n, descr, A, ld, nnzPerColumn, cscVal, cscRowInd, cscColPtr)#

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

Given a dense, column-ordered, matrix A with leading dimension ld, where ld>=m, hipsparseXdense2csc converts the matrix to a sparse CSC format matrix. All the parameters are assumed to have been preallocated by the user and the arrays are filled in based on number of non-zeros per row, which can be pre-computed with hipsparseSnnz . Users can set the desired index base in the output CSC matrix by setting it in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (that is, the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the A values have column ordering with leading dimension ld=m:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]

the conversion results in the CSC arrays:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerColumn (PointerToInt/object) – IN:

array of size n containing the number of non-zero elements per column.

cscVal (Pointer/object) – OUT:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) nonzero elements of matrix A.

cscRowInd (PointerToInt/object) – OUT:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – OUT:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDdense2csc(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const double * A, int ld, const int * nnzPerColumn, double * cscVal, int * cscRowInd, int * cscColPtr)
rocm.bindings.hipsparse.hipsparseCdense2csc(handle, m, n, descr, A, ld, nnzPerColumn, cscVal, cscRowInd, cscColPtr)#

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

Given a dense, column-ordered, matrix A with leading dimension ld, where ld>=m, hipsparseXdense2csc converts the matrix to a sparse CSC format matrix. All the parameters are assumed to have been preallocated by the user and the arrays are filled in based on number of non-zeros per row, which can be pre-computed with hipsparseSnnz . Users can set the desired index base in the output CSC matrix by setting it in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (that is, the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the A values have column ordering with leading dimension ld=m:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]

the conversion results in the CSC arrays:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerColumn (PointerToInt/object) – IN:

array of size n containing the number of non-zero elements per column.

cscVal (Pointer/object) – OUT:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) nonzero elements of matrix A.

cscRowInd (PointerToInt/object) – OUT:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – OUT:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCdense2csc(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipComplex * A, int ld, const int * nnzPerColumn, hipComplex * cscVal, int * cscRowInd, int * cscColPtr)
rocm.bindings.hipsparse.hipsparseZdense2csc(handle, m, n, descr, A, ld, nnzPerColumn, cscVal, cscRowInd, cscColPtr)#

hipsparseXdense2csc functions convert the matrix A in dense format into a sparse matrix in CSC format.

Given a dense, column-ordered, matrix A with leading dimension ld, where ld>=m, hipsparseXdense2csc converts the matrix to a sparse CSC format matrix. All the parameters are assumed to have been preallocated by the user and the arrays are filled in based on number of non-zeros per row, which can be pre-computed with hipsparseSnnz . Users can set the desired index base in the output CSC matrix by setting it in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (that is, the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

where the A values have column ordering with leading dimension ld=m:

\[\begin{split}\text{A} &= \begin{bmatrix} 1 & 3 & 5 & 0 & 4 & 0 & 0 & 0 & 6 & 2 & 0 & 7 \end{bmatrix} \\\end{split}\]

the conversion results in the CSC arrays:

\[\begin{split}\begin{align} \text{cscRowInd} &= \begin{bmatrix} 0 & 1 & 2 & 1 & 2 & 0 & 2 \end{bmatrix} \\ \text{cscColPtr} &= \begin{bmatrix} 0 & 3 & 4 & 5 & 7 \end{bmatrix} \\ \text{cscVal} &= \begin{bmatrix} 1 & 3 & 5 & 4 & 6 & 2 & 7 \end{bmatrix} \\ \end{align}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerColumn (PointerToInt/object) – IN:

array of size n containing the number of non-zero elements per column.

cscVal (Pointer/object) – OUT:

array of nnz ( = cscColPtr[n] - cscColPtr[0] ) nonzero elements of matrix A.

cscRowInd (PointerToInt/object) – OUT:

integer array of nnz ( = cscColPtr[n] - cscColPtr[0] ) column indices of the non-zero elements of matrix A.

cscColPtr (PointerToInt/object) – OUT:

integer array of n+1 elements that contains the start of every column and the end of the last column plus one.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZdense2csc(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipDoubleComplex * A, int ld, const int * nnzPerColumn, hipDoubleComplex * cscVal, int * cscRowInd, int * cscColPtr)
rocm.bindings.hipsparse.hipsparseSdense2csr(handle, m, n, descr, A, ld, nnzPerRow, csrVal, csrRowPtr, csrColInd)#

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

Given a dense, column-ordered matrix A with leading dimension ld where ld>=m, hipsparseXdense2csr converts the matrix to a sparse CSR format matrix. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on the number of non-zeros per row, which can be pre-computed with hipsparseSnnz . The desired index base in the output CSR matrix is set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (which is the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

The conversion results in the CSR arrays:

\[\begin{split}\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}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A, which must be at least m.

nnzPerRow (PointerToInt/object) – IN:

array of size m containing the number of non-zero elements per row.

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const float * A, int ld, const int * nnzPerRow, float * csrVal, int * csrRowPtr, int * csrColInd)
rocm.bindings.hipsparse.hipsparseDdense2csr(handle, m, n, descr, A, ld, nnzPerRow, csrVal, csrRowPtr, csrColInd)#

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

Given a dense, column-ordered matrix A with leading dimension ld where ld>=m, hipsparseXdense2csr converts the matrix to a sparse CSR format matrix. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on the number of non-zeros per row, which can be pre-computed with hipsparseSnnz . The desired index base in the output CSR matrix is set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (which is the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

The conversion results in the CSR arrays:

\[\begin{split}\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}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A, which must be at least m.

nnzPerRow (PointerToInt/object) – IN:

array of size m containing the number of non-zero elements per row.

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const double * A, int ld, const int * nnzPerRow, double * csrVal, int * csrRowPtr, int * csrColInd)
rocm.bindings.hipsparse.hipsparseCdense2csr(handle, m, n, descr, A, ld, nnzPerRow, csrVal, csrRowPtr, csrColInd)#

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

Given a dense, column-ordered matrix A with leading dimension ld where ld>=m, hipsparseXdense2csr converts the matrix to a sparse CSR format matrix. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on the number of non-zeros per row, which can be pre-computed with hipsparseSnnz . The desired index base in the output CSR matrix is set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (which is the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

The conversion results in the CSR arrays:

\[\begin{split}\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}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A, which must be at least m.

nnzPerRow (PointerToInt/object) – IN:

array of size m containing the number of non-zero elements per row.

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipComplex * A, int ld, const int * nnzPerRow, hipComplex * csrVal, int * csrRowPtr, int * csrColInd)
rocm.bindings.hipsparse.hipsparseZdense2csr(handle, m, n, descr, A, ld, nnzPerRow, csrVal, csrRowPtr, csrColInd)#

hipsparseXdense2csr converts the matrix A in dense format into a sparse matrix in CSR format.

Given a dense, column-ordered matrix A with leading dimension ld where ld>=m, hipsparseXdense2csr converts the matrix to a sparse CSR format matrix. All the parameters are assumed to have been pre-allocated by the user and the arrays are filled in based on the number of non-zeros per row, which can be pre-computed with hipsparseSnnz . The desired index base in the output CSR matrix is set in the hipsparseMatDescr_t . See hipsparseSetMatIndexBase ().

As an example, if using index base zero (which is the default) and the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

The conversion results in the CSR arrays:

\[\begin{split}\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}\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

A (Pointer/object) – IN:

array of dimensions (ld, n).

ld (int) – IN:

leading dimension of dense array A, which must be at least m.

nnzPerRow (PointerToInt/object) – IN:

array of size m containing the number of non-zero elements per row.

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZdense2csr(hipsparseHandle_t handle, int m, int n, const hipsparseMatDescr_t descr, const hipDoubleComplex * A, int ld, const int * nnzPerRow, hipDoubleComplex * csrVal, int * csrRowPtr, int * csrColInd)
rocm.bindings.hipsparse.hipsparseSgebsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDim, colBlockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

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{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]

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:

\[\begin{split} \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]\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse general BSR matrix.

nb (int) – IN:

number of block columns in the sparse general BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse general BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*rowBlockDim*colBlockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*rowBlockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgebsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDim, int colBlockDim, const hipsparseMatDescr_t descrC, float * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseDgebsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDim, colBlockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

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{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]

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:

\[\begin{split} \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]\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse general BSR matrix.

nb (int) – IN:

number of block columns in the sparse general BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse general BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*rowBlockDim*colBlockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*rowBlockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgebsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDim, int colBlockDim, const hipsparseMatDescr_t descrC, double * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseCgebsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDim, colBlockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

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{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]

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:

\[\begin{split} \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]\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse general BSR matrix.

nb (int) – IN:

number of block columns in the sparse general BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse general BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*rowBlockDim*colBlockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*rowBlockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgebsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDim, int colBlockDim, const hipsparseMatDescr_t descrC, hipComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseZgebsr2csr(handle, dirA, mb, nb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDim, colBlockDim, descrC, csrValC, csrRowPtrC, csrColIndC)#

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{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]

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:

\[\begin{split} \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]\end{split}\]
Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows in the sparse general BSR matrix.

nb (int) – IN:

number of block columns in the sparse general BSR matrix.

descrA (Pointer/object) – IN:

descriptor of the sparse general BSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse BSR matrix.

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse BSR matrix.

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse general BSR matrix.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzb*rowBlockDim*colBlockDim elements containing the values of the sparse CSR matrix.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 where m=mb*rowBlockDim elements that point to the start of every row of the sparse CSR matrix.

csrColIndC (PointerToInt/object) – OUT:

array of nnzb*block_dim*block_dim elements containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgebsr2csr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDim, int colBlockDim, const hipsparseMatDescr_t descrC, hipDoubleComplex * csrValC, int * csrRowPtrC, int * csrColIndC)
rocm.bindings.hipsparse.hipsparseSgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseXgebsr2gebsc_bufferSize returns the size of the temporary storage buffer required by hipsparseSgebsr2gebsc . This is the first step in converting a sparse matrix in GEBSR format to a sparse matrix in GEBSC format. After the size of the temporary storage buffer has been determined, it must be allocated by the user.

See hipsparseSgebsr2gebsc() for a complete code example.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse General BSR matrix.

nb (int) – IN:

number of columns of the sparse General BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse General BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse General BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every row of the sparse General BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnzb elements containing the column indices of the sparse General BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse General BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse General BSR matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgebsr2gebsc(), hipsparseDgebsr2gebsc(), hipsparseCgebsr2gebsc(), and hipsparseZgebsr2gebsc().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgebsr2gebsc_bufferSize(hipsparseHandle_t handle, int mb, int nb, int nnzb, const float * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseXgebsr2gebsc_bufferSize returns the size of the temporary storage buffer required by hipsparseSgebsr2gebsc . This is the first step in converting a sparse matrix in GEBSR format to a sparse matrix in GEBSC format. After the size of the temporary storage buffer has been determined, it must be allocated by the user.

See hipsparseSgebsr2gebsc() for a complete code example.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse General BSR matrix.

nb (int) – IN:

number of columns of the sparse General BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse General BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse General BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every row of the sparse General BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnzb elements containing the column indices of the sparse General BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse General BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse General BSR matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgebsr2gebsc(), hipsparseDgebsr2gebsc(), hipsparseCgebsr2gebsc(), and hipsparseZgebsr2gebsc().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgebsr2gebsc_bufferSize(hipsparseHandle_t handle, int mb, int nb, int nnzb, const double * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseXgebsr2gebsc_bufferSize returns the size of the temporary storage buffer required by hipsparseSgebsr2gebsc . This is the first step in converting a sparse matrix in GEBSR format to a sparse matrix in GEBSC format. After the size of the temporary storage buffer has been determined, it must be allocated by the user.

See hipsparseSgebsr2gebsc() for a complete code example.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse General BSR matrix.

nb (int) – IN:

number of columns of the sparse General BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse General BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse General BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every row of the sparse General BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnzb elements containing the column indices of the sparse General BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse General BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse General BSR matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgebsr2gebsc(), hipsparseDgebsr2gebsc(), hipsparseCgebsr2gebsc(), and hipsparseZgebsr2gebsc().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgebsr2gebsc_bufferSize(hipsparseHandle_t handle, int mb, int nb, int nnzb, const hipComplex * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgebsr2gebsc_bufferSize(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, pBufferSizeInBytes)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseXgebsr2gebsc_bufferSize returns the size of the temporary storage buffer required by hipsparseSgebsr2gebsc . This is the first step in converting a sparse matrix in GEBSR format to a sparse matrix in GEBSC format. After the size of the temporary storage buffer has been determined, it must be allocated by the user.

See hipsparseSgebsr2gebsc() for a complete code example.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse General BSR matrix.

nb (int) – IN:

number of columns of the sparse General BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse General BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb*rowBlockDim*colBlockDim containing the values of the sparse General BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every row of the sparse General BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnzb elements containing the column indices of the sparse General BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse General BSR matrix.

colBlockDim (int) – IN:

column size of the blocks in the sparse General BSR matrix.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSgebsr2gebsc(), hipsparseDgebsr2gebsc(), hipsparseCgebsr2gebsc(), and hipsparseZgebsr2gebsc().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgebsr2gebsc_bufferSize(hipsparseHandle_t handle, int mb, int nb, int nnzb, const hipDoubleComplex * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, bscVal, bscRowInd, bscColPtr, copyValues, idxBase, temp_buffer)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseXgebsr2gebsc converts a GEBSR matrix into a GEBSC matrix. hipsparseXgebsr2gebsc can also be used to convert a GEBSC matrix into a GEBSR matrix. copyValues decides whether bscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

hipsparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by hipsparseSgebsr2gebsc_bufferSize “hipsparseXgebsr2gebsc_bufferSize()”.

For example, given the GEBSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 2 \\ 3 & 4 \\ 6 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 3 & 4 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \\ 3 & 4 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 0 & 2 & 0 & 0 & 3 & 4 & 5 & 0 & 1 & 2 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]

this function converts the matrix to GEBSC format:

\[\begin{split}\begin{align} \text{bscRowInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bscColPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bscVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 5 & 0 & 1 & 2 & 3 & 4 & 0 & 2 & 0 & 0 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse general BSR matrix.

nb (int) – IN:

number of columns of the sparse general BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse general BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb * rowBlockDim * colBlockDim elements of the sparse general BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse general BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse general BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

bscVal (Pointer/object) – OUT:

array of nnz elements of the sparse BSC matrix.

bscRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse BSC matrix.

bscColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse BSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

temp_buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSgebsr2gebsc_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgebsr2gebsc(hipsparseHandle_t handle, int mb, int nb, int nnzb, const float * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, float * bscVal, int * bscRowInd, int * bscColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, void * temp_buffer)
rocm.bindings.hipsparse.hipsparseDgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, bscVal, bscRowInd, bscColPtr, copyValues, idxBase, temp_buffer)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseXgebsr2gebsc converts a GEBSR matrix into a GEBSC matrix. hipsparseXgebsr2gebsc can also be used to convert a GEBSC matrix into a GEBSR matrix. copyValues decides whether bscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

hipsparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by hipsparseSgebsr2gebsc_bufferSize “hipsparseXgebsr2gebsc_bufferSize()”.

For example, given the GEBSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 2 \\ 3 & 4 \\ 6 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 3 & 4 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \\ 3 & 4 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 0 & 2 & 0 & 0 & 3 & 4 & 5 & 0 & 1 & 2 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]

this function converts the matrix to GEBSC format:

\[\begin{split}\begin{align} \text{bscRowInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bscColPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bscVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 5 & 0 & 1 & 2 & 3 & 4 & 0 & 2 & 0 & 0 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse general BSR matrix.

nb (int) – IN:

number of columns of the sparse general BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse general BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb * rowBlockDim * colBlockDim elements of the sparse general BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse general BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse general BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

bscVal (Pointer/object) – OUT:

array of nnz elements of the sparse BSC matrix.

bscRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse BSC matrix.

bscColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse BSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

temp_buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSgebsr2gebsc_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgebsr2gebsc(hipsparseHandle_t handle, int mb, int nb, int nnzb, const double * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, double * bscVal, int * bscRowInd, int * bscColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, void * temp_buffer)
rocm.bindings.hipsparse.hipsparseCgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, bscVal, bscRowInd, bscColPtr, copyValues, idxBase, temp_buffer)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseXgebsr2gebsc converts a GEBSR matrix into a GEBSC matrix. hipsparseXgebsr2gebsc can also be used to convert a GEBSC matrix into a GEBSR matrix. copyValues decides whether bscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

hipsparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by hipsparseSgebsr2gebsc_bufferSize “hipsparseXgebsr2gebsc_bufferSize()”.

For example, given the GEBSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 2 \\ 3 & 4 \\ 6 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 3 & 4 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \\ 3 & 4 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 0 & 2 & 0 & 0 & 3 & 4 & 5 & 0 & 1 & 2 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]

this function converts the matrix to GEBSC format:

\[\begin{split}\begin{align} \text{bscRowInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bscColPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bscVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 5 & 0 & 1 & 2 & 3 & 4 & 0 & 2 & 0 & 0 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse general BSR matrix.

nb (int) – IN:

number of columns of the sparse general BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse general BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb * rowBlockDim * colBlockDim elements of the sparse general BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse general BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse general BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

bscVal (Pointer/object) – OUT:

array of nnz elements of the sparse BSC matrix.

bscRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse BSC matrix.

bscColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse BSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

temp_buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSgebsr2gebsc_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgebsr2gebsc(hipsparseHandle_t handle, int mb, int nb, int nnzb, const hipComplex * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, hipComplex * bscVal, int * bscRowInd, int * bscColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, void * temp_buffer)
rocm.bindings.hipsparse.hipsparseZgebsr2gebsc(handle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, rowBlockDim, colBlockDim, bscVal, bscRowInd, bscColPtr, copyValues, idxBase, temp_buffer)#

Convert a sparse GEBSR matrix into a sparse GEBSC matrix

hipsparseXgebsr2gebsc converts a GEBSR matrix into a GEBSC matrix. hipsparseXgebsr2gebsc can also be used to convert a GEBSC matrix into a GEBSR matrix. copyValues decides whether bscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC ) or not (HIPSPARSE_ACTION_SYMBOLIC ).

hipsparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by hipsparseSgebsr2gebsc_bufferSize “hipsparseXgebsr2gebsc_bufferSize()”.

For example, given the GEBSR matrix:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 2 \\ 3 & 4 \\ 6 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 0 \\ 3 & 4 \end{array} \\ \hline \begin{array}{c c} 5 & 0 \\ 1 & 2 \\ 3 & 4 \end{array} & \begin{array}{c c} 6 & 7 \\ 3 & 4 \\ 3 & 4 \end{array} \\ \end{array} \right]\end{split}\]

represented with the arrays:

\[\begin{split}\begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bsrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 0 & 2 & 0 & 0 & 3 & 4 & 5 & 0 & 1 & 2 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]

this function converts the matrix to GEBSC format:

\[\begin{split}\begin{align} \text{bscRowInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\ \text{bscColPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\ \text{bscVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 5 & 0 & 1 & 2 & 3 & 4 & 0 & 2 & 0 & 0 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align}\end{split}\]
Note:

The resulting matrix can also be seen as the transpose of the input matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

mb (int) – IN:

number of rows of the sparse general BSR matrix.

nb (int) – IN:

number of columns of the sparse general BSR matrix.

nnzb (int) – IN:

number of non-zero entries of the sparse general BSR matrix.

bsrVal (Pointer/object) – IN:

array of nnzb * rowBlockDim * colBlockDim elements of the sparse general BSR matrix.

bsrRowPtr (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse general BSR matrix.

bsrColInd (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse general BSR matrix.

rowBlockDim (int) – IN:

row size of the blocks in the sparse general BSR matrix.

colBlockDim (int) – IN:

col size of the blocks in the sparse general BSR matrix.

bscVal (Pointer/object) – OUT:

array of nnz elements of the sparse BSC matrix.

bscRowInd (PointerToInt/object) – OUT:

array of nnz elements containing the row indices of the sparse BSC matrix.

bscColPtr (PointerToInt/object) – OUT:

array of n+1 elements that point to the start of every column of the sparse BSC matrix.

copyValues (hipsparseAction_t) – IN:

HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC .

idxBase (hipsparseIndexBase_t) – IN:

HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE .

temp_buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSgebsr2gebsc_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgebsr2gebsc(hipsparseHandle_t handle, int mb, int nb, int nnzb, const hipDoubleComplex * bsrVal, const int * bsrRowPtr, const int * bsrColInd, int rowBlockDim, int colBlockDim, hipDoubleComplex * bscVal, int * bscRowInd, int * bscColPtr, hipsparseAction_t copyValues, hipsparseIndexBase_t idxBase, void * temp_buffer)
rocm.bindings.hipsparse.hipsparseSgebsr2gebsr_bufferSize(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, rowBlockDimC, colBlockDimC, pBufferSizeInBytes)#

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse GEBSR matrix to another sparse GEBSR matrix.

hipsparseXgebsr2gebsr_bufferSize returns the size of the temporary storage buffer that is required by hipsparseXgebsr2gebsrNnz () and hipsparseSgebsr2gebsr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXgebsr2gebsrNnz(), hipsparseSgebsr2gebsr(), hipsparseDgebsr2gebsr(), hipsparseCgebsr2gebsr(), and hipsparseZgebsr2gebsr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgebsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, int rowBlockDimC, int colBlockDimC, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDgebsr2gebsr_bufferSize(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, rowBlockDimC, colBlockDimC, pBufferSizeInBytes)#

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse GEBSR matrix to another sparse GEBSR matrix.

hipsparseXgebsr2gebsr_bufferSize returns the size of the temporary storage buffer that is required by hipsparseXgebsr2gebsrNnz () and hipsparseSgebsr2gebsr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXgebsr2gebsrNnz(), hipsparseSgebsr2gebsr(), hipsparseDgebsr2gebsr(), hipsparseCgebsr2gebsr(), and hipsparseZgebsr2gebsr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgebsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, int rowBlockDimC, int colBlockDimC, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseCgebsr2gebsr_bufferSize(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, rowBlockDimC, colBlockDimC, pBufferSizeInBytes)#

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse GEBSR matrix to another sparse GEBSR matrix.

hipsparseXgebsr2gebsr_bufferSize returns the size of the temporary storage buffer that is required by hipsparseXgebsr2gebsrNnz () and hipsparseSgebsr2gebsr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXgebsr2gebsrNnz(), hipsparseSgebsr2gebsr(), hipsparseDgebsr2gebsr(), hipsparseCgebsr2gebsr(), and hipsparseZgebsr2gebsr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgebsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, int rowBlockDimC, int colBlockDimC, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseZgebsr2gebsr_bufferSize(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, rowBlockDimC, colBlockDimC, pBufferSizeInBytes)#

This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse GEBSR matrix to another sparse GEBSR matrix.

hipsparseXgebsr2gebsr_bufferSize returns the size of the temporary storage buffer that is required by hipsparseXgebsr2gebsrNnz () and hipsparseSgebsr2gebsr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

pBufferSizeInBytes (PointerToInt/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseXgebsr2gebsrNnz(), hipsparseSgebsr2gebsr(), hipsparseDgebsr2gebsr(), hipsparseCgebsr2gebsr(), and hipsparseZgebsr2gebsr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgebsr2gebsr_bufferSize(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, int rowBlockDimC, int colBlockDimC, int * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseXgebsr2gebsrNnz(handle, dirA, mb, nb, nnzb, descrA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, descrC, bsrRowPtrC, rowBlockDimC, colBlockDimC, nnzTotalDevHostPtr, buffer)#

This function is used when converting a GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). Specifically, this function determines the number of non-zero blocks that will exist in \(C\) (stored using either a host or device pointer) and computes the row pointer array for \(C\).

The routine supports asynchronous execution.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix A.

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

descrC (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrRowPtrC (PointerToInt/object) – IN:

array of mbC+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\) where mbC = ( m+rowBlockDimC-1 ) / rowBlockDimC.

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero blocks in general BSR sparse matrix \(C\), stored using device or host memory.

buffer (Pointer/object) – OUT:

buffer allocated by the user. The size is determined by calling hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseXgebsr2gebsrNnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, const hipsparseMatDescr_t descrC, int * bsrRowPtrC, int rowBlockDimC, int colBlockDimC, int * nnzTotalDevHostPtr, void * buffer)
rocm.bindings.hipsparse.hipsparseSgebsr2gebsr(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, descrC, bsrValC, bsrRowPtrC, bsrColIndC, rowBlockDimC, colBlockDimC, buffer)#

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

The conversion uses three steps. First, the user calls hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()” to determine the size of the required temporary storage buffer. The user then allocates this buffer. Secondly, the user then allocates mbC+1 integers for the row pointer array for \(C\) where:

\[\begin{split}\begin{align} \text{mbC} &= \text{(m - 1) / rowBlockDimC + 1} \\ \text{nbC} &= \text{(n - 1) / colBlockDimC + 1} \end{align}\end{split}\]

The user then calls hipsparseXgebsr2gebsrNnz() to fill in the row pointer array for \(C\) ( bsrRowPtrC ) and determine the number of non-zero blocks that will exist in \(C\). Finally, the user allocates space for the column indices array of \(C\) to have nnzbC elements and space for the values array of \(C\) to have nnzbC*rowBlockDimC*colBlockDimC and then calls hipsparseXgebsr2gebsr to complete the conversion.

It could be the case that rowBlockDimC does not divide evenly into m or colBlockDim does not divide evenly into n. In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (using rowBlockDimA=2, colBlockDimA=3) looks like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 0 & 0 \\ 4 & 5 & 6 \end{array} \\ \hline \begin{array}{c c c} 1 & 2 & 3 \\ 1 & 2 & 0 \end{array} & \begin{array}{c c c} 4 & 0 & 0 \\ 3 & 0 & 1 \end{array} \\ \end{array} \right]\end{split}\]

then if the user specifies rowBlockDimC=3 and colBlockDimC=2, the output GEBSR matrix C would be:

\[\begin{split} \left[ \begin{array}{c | c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 1 & 2 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 4 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 0 \\ 5 & 6 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 1 & 2 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 3 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 1 \\ 0 & 0 \\ 0 & 0 \end{array} \\ \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

descrC (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValC (Pointer/object) – IN:

array of nnzbC*rowBlockDimC*colBlockDimC containing the values of the sparse general BSR matrix \(C\).

bsrRowPtrC (PointerToInt/object) – IN:

array of mbC+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\).

bsrColIndC (PointerToInt/object) – IN:

array of nnzbC elements containing the block column indices of the sparse general BSR matrix \(C\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

buffer (Pointer/object) – OUT:

buffer allocated by the user. The size is determined by calling hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSgebsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const float * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, const hipsparseMatDescr_t descrC, float * bsrValC, int * bsrRowPtrC, int * bsrColIndC, int rowBlockDimC, int colBlockDimC, void * buffer)
rocm.bindings.hipsparse.hipsparseDgebsr2gebsr(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, descrC, bsrValC, bsrRowPtrC, bsrColIndC, rowBlockDimC, colBlockDimC, buffer)#

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

The conversion uses three steps. First, the user calls hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()” to determine the size of the required temporary storage buffer. The user then allocates this buffer. Secondly, the user then allocates mbC+1 integers for the row pointer array for \(C\) where:

\[\begin{split}\begin{align} \text{mbC} &= \text{(m - 1) / rowBlockDimC + 1} \\ \text{nbC} &= \text{(n - 1) / colBlockDimC + 1} \end{align}\end{split}\]

The user then calls hipsparseXgebsr2gebsrNnz() to fill in the row pointer array for \(C\) ( bsrRowPtrC ) and determine the number of non-zero blocks that will exist in \(C\). Finally, the user allocates space for the column indices array of \(C\) to have nnzbC elements and space for the values array of \(C\) to have nnzbC*rowBlockDimC*colBlockDimC and then calls hipsparseXgebsr2gebsr to complete the conversion.

It could be the case that rowBlockDimC does not divide evenly into m or colBlockDim does not divide evenly into n. In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (using rowBlockDimA=2, colBlockDimA=3) looks like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 0 & 0 \\ 4 & 5 & 6 \end{array} \\ \hline \begin{array}{c c c} 1 & 2 & 3 \\ 1 & 2 & 0 \end{array} & \begin{array}{c c c} 4 & 0 & 0 \\ 3 & 0 & 1 \end{array} \\ \end{array} \right]\end{split}\]

then if the user specifies rowBlockDimC=3 and colBlockDimC=2, the output GEBSR matrix C would be:

\[\begin{split} \left[ \begin{array}{c | c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 1 & 2 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 4 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 0 \\ 5 & 6 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 1 & 2 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 3 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 1 \\ 0 & 0 \\ 0 & 0 \end{array} \\ \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

descrC (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValC (Pointer/object) – IN:

array of nnzbC*rowBlockDimC*colBlockDimC containing the values of the sparse general BSR matrix \(C\).

bsrRowPtrC (PointerToInt/object) – IN:

array of mbC+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\).

bsrColIndC (PointerToInt/object) – IN:

array of nnzbC elements containing the block column indices of the sparse general BSR matrix \(C\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

buffer (Pointer/object) – OUT:

buffer allocated by the user. The size is determined by calling hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDgebsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const double * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, const hipsparseMatDescr_t descrC, double * bsrValC, int * bsrRowPtrC, int * bsrColIndC, int rowBlockDimC, int colBlockDimC, void * buffer)
rocm.bindings.hipsparse.hipsparseCgebsr2gebsr(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, descrC, bsrValC, bsrRowPtrC, bsrColIndC, rowBlockDimC, colBlockDimC, buffer)#

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

The conversion uses three steps. First, the user calls hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()” to determine the size of the required temporary storage buffer. The user then allocates this buffer. Secondly, the user then allocates mbC+1 integers for the row pointer array for \(C\) where:

\[\begin{split}\begin{align} \text{mbC} &= \text{(m - 1) / rowBlockDimC + 1} \\ \text{nbC} &= \text{(n - 1) / colBlockDimC + 1} \end{align}\end{split}\]

The user then calls hipsparseXgebsr2gebsrNnz() to fill in the row pointer array for \(C\) ( bsrRowPtrC ) and determine the number of non-zero blocks that will exist in \(C\). Finally, the user allocates space for the column indices array of \(C\) to have nnzbC elements and space for the values array of \(C\) to have nnzbC*rowBlockDimC*colBlockDimC and then calls hipsparseXgebsr2gebsr to complete the conversion.

It could be the case that rowBlockDimC does not divide evenly into m or colBlockDim does not divide evenly into n. In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (using rowBlockDimA=2, colBlockDimA=3) looks like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 0 & 0 \\ 4 & 5 & 6 \end{array} \\ \hline \begin{array}{c c c} 1 & 2 & 3 \\ 1 & 2 & 0 \end{array} & \begin{array}{c c c} 4 & 0 & 0 \\ 3 & 0 & 1 \end{array} \\ \end{array} \right]\end{split}\]

then if the user specifies rowBlockDimC=3 and colBlockDimC=2, the output GEBSR matrix C would be:

\[\begin{split} \left[ \begin{array}{c | c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 1 & 2 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 4 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 0 \\ 5 & 6 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 1 & 2 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 3 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 1 \\ 0 & 0 \\ 0 & 0 \end{array} \\ \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

descrC (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValC (Pointer/object) – IN:

array of nnzbC*rowBlockDimC*colBlockDimC containing the values of the sparse general BSR matrix \(C\).

bsrRowPtrC (PointerToInt/object) – IN:

array of mbC+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\).

bsrColIndC (PointerToInt/object) – IN:

array of nnzbC elements containing the block column indices of the sparse general BSR matrix \(C\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

buffer (Pointer/object) – OUT:

buffer allocated by the user. The size is determined by calling hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCgebsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const hipComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, const hipsparseMatDescr_t descrC, hipComplex * bsrValC, int * bsrRowPtrC, int * bsrColIndC, int rowBlockDimC, int colBlockDimC, void * buffer)
rocm.bindings.hipsparse.hipsparseZgebsr2gebsr(handle, dirA, mb, nb, nnzb, descrA, bsrValA, bsrRowPtrA, bsrColIndA, rowBlockDimA, colBlockDimA, descrC, bsrValC, bsrRowPtrC, bsrColIndC, rowBlockDimC, colBlockDimC, buffer)#

This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\).

The conversion uses three steps. First, the user calls hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()” to determine the size of the required temporary storage buffer. The user then allocates this buffer. Secondly, the user then allocates mbC+1 integers for the row pointer array for \(C\) where:

\[\begin{split}\begin{align} \text{mbC} &= \text{(m - 1) / rowBlockDimC + 1} \\ \text{nbC} &= \text{(n - 1) / colBlockDimC + 1} \end{align}\end{split}\]

The user then calls hipsparseXgebsr2gebsrNnz() to fill in the row pointer array for \(C\) ( bsrRowPtrC ) and determine the number of non-zero blocks that will exist in \(C\). Finally, the user allocates space for the column indices array of \(C\) to have nnzbC elements and space for the values array of \(C\) to have nnzbC*rowBlockDimC*colBlockDimC and then calls hipsparseXgebsr2gebsr to complete the conversion.

It could be the case that rowBlockDimC does not divide evenly into m or colBlockDim does not divide evenly into n. In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (using rowBlockDimA=2, colBlockDimA=3) looks like:

\[\begin{split} \left[ \begin{array}{c | c} \begin{array}{c c c} 1 & 0 & 0 \\ 3 & 4 & 0 \end{array} & \begin{array}{c c c} 2 & 0 & 0 \\ 4 & 5 & 6 \end{array} \\ \hline \begin{array}{c c c} 1 & 2 & 3 \\ 1 & 2 & 0 \end{array} & \begin{array}{c c c} 4 & 0 & 0 \\ 3 & 0 & 1 \end{array} \\ \end{array} \right]\end{split}\]

then if the user specifies rowBlockDimC=3 and colBlockDimC=2, the output GEBSR matrix C would be:

\[\begin{split} \left[ \begin{array}{c | c | c} \begin{array}{c c} 1 & 0 \\ 3 & 4 \\ 1 & 2 \end{array} & \begin{array}{c c} 0 & 2 \\ 0 & 4 \\ 3 & 4 \end{array} & \begin{array}{c c} 0 & 0 \\ 5 & 6 \\ 0 & 0 \end{array} \\ \hline \begin{array}{c c} 1 & 2 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 3 \\ 0 & 0 \\ 0 & 0 \end{array} & \begin{array}{c c} 0 & 1 \\ 0 & 0 \\ 0 & 0 \end{array} \\ \end{array} \right]\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

the storage format of the blocks, HIPSPARSE_DIRECTION_ROW or HIPSPARSE_DIRECTION_COLUMN .

mb (int) – IN:

number of block rows of the general BSR sparse matrix \(A\).

nb (int) – IN:

number of block columns of the general BSR sparse matrix \(A\).

nnzb (int) – IN:

number of blocks in the general BSR sparse matrix \(A\).

descrA (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(A\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and also any valid value of the hipsparseIndexBase_t .

bsrValA (Pointer/object) – IN:

array of nnzb*rowBlockDimA*colBlockDimA containing the values of the sparse general BSR matrix \(A\).

bsrRowPtrA (PointerToInt/object) – IN:

array of mb+1 elements that point to the start of every block row of the sparse general BSR matrix \(A\).

bsrColIndA (PointerToInt/object) – IN:

array of nnzb elements containing the block column indices of the sparse general BSR matrix \(A\).

rowBlockDimA (int) – IN:

row size of the blocks in the sparse general BSR matrix \(A\).

colBlockDimA (int) – IN:

column size of the blocks in the sparse general BSR matrix \(A\).

descrC (Pointer/object) – IN:

the descriptor of the general BSR sparse matrix \(C\). The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

bsrValC (Pointer/object) – IN:

array of nnzbC*rowBlockDimC*colBlockDimC containing the values of the sparse general BSR matrix \(C\).

bsrRowPtrC (PointerToInt/object) – IN:

array of mbC+1 elements that point to the start of every block row of the sparse general BSR matrix \(C\).

bsrColIndC (PointerToInt/object) – IN:

array of nnzbC elements containing the block column indices of the sparse general BSR matrix \(C\).

rowBlockDimC (int) – IN:

row size of the blocks in the sparse general BSR matrix \(C\).

colBlockDimC (int) – IN:

column size of the blocks in the sparse general BSR matrix \(C\).

buffer (Pointer/object) – OUT:

buffer allocated by the user. The size is determined by calling hipsparseSgebsr2gebsr_bufferSize “hipsparseXgebsr2gebsr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZgebsr2gebsr(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nb, int nnzb, const hipsparseMatDescr_t descrA, const hipDoubleComplex * bsrValA, const int * bsrRowPtrA, const int * bsrColIndA, int rowBlockDimA, int colBlockDimA, const hipsparseMatDescr_t descrC, hipDoubleComplex * bsrValC, int * bsrRowPtrC, int * bsrColIndC, int rowBlockDimC, int colBlockDimC, void * buffer)
rocm.bindings.hipsparse.hipsparseShyb2csr(handle, descrA, hybA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)#

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseXhyb2csr converts a HYB matrix into a CSR matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

descrA (Pointer/object) – IN:

descriptor of the sparse HYB matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

hybA (Pointer/object) – IN:

sparse matrix in HYB format.

csrSortedValA (Pointer/object) – OUT:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – OUT:

array containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseShyb2csr(hipsparseHandle_t handle, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, float * csrSortedValA, int * csrSortedRowPtrA, int * csrSortedColIndA)
rocm.bindings.hipsparse.hipsparseDhyb2csr(handle, descrA, hybA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)#

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseXhyb2csr converts a HYB matrix into a CSR matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

descrA (Pointer/object) – IN:

descriptor of the sparse HYB matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

hybA (Pointer/object) – IN:

sparse matrix in HYB format.

csrSortedValA (Pointer/object) – OUT:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – OUT:

array containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDhyb2csr(hipsparseHandle_t handle, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, double * csrSortedValA, int * csrSortedRowPtrA, int * csrSortedColIndA)
rocm.bindings.hipsparse.hipsparseChyb2csr(handle, descrA, hybA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)#

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseXhyb2csr converts a HYB matrix into a CSR matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

descrA (Pointer/object) – IN:

descriptor of the sparse HYB matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

hybA (Pointer/object) – IN:

sparse matrix in HYB format.

csrSortedValA (Pointer/object) – OUT:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – OUT:

array containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseChyb2csr(hipsparseHandle_t handle, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, hipComplex * csrSortedValA, int * csrSortedRowPtrA, int * csrSortedColIndA)
rocm.bindings.hipsparse.hipsparseZhyb2csr(handle, descrA, hybA, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA)#

Convert a sparse HYB matrix into a sparse CSR matrix.

hipsparseXhyb2csr converts a HYB matrix into a CSR matrix.

Note:

This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

descrA (Pointer/object) – IN:

descriptor of the sparse HYB matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

hybA (Pointer/object) – IN:

sparse matrix in HYB format.

csrSortedValA (Pointer/object) – OUT:

array containing the values of the sparse CSR matrix.

csrSortedRowPtrA (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrSortedColIndA (PointerToInt/object) – OUT:

array containing the column indices of the sparse CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZhyb2csr(hipsparseHandle_t handle, const hipsparseMatDescr_t descrA, const hipsparseHybMat_t hybA, hipDoubleComplex * csrSortedValA, int * csrSortedRowPtrA, int * csrSortedColIndA)
rocm.bindings.hipsparse.hipsparseSnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowColumn, nnzTotalDevHostPtr)#

hipsparseXnnz computes the number of non-zero elements per row or column and the total number of non-zero elements in a dense matrix.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

using dirA == HIPSPARSE_DIRECTION_ROW results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 2 & 2 & 3 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]

while using dirA == HIPSPARSE_DIRECTION_COLUMN results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 3 & 1 & 1 & 2 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]
Note:

As indicated, nnzTotalDevHostPtr can point either to host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descrA (Pointer/object) – IN:

the descriptor of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerRowColumn (PointerToInt/object) – OUT:

array of size m or n containing the number of non-zero elements per row or column, respectively.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSnnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const float * A, int lda, int * nnzPerRowColumn, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseDnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowColumn, nnzTotalDevHostPtr)#

hipsparseXnnz computes the number of non-zero elements per row or column and the total number of non-zero elements in a dense matrix.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

using dirA == HIPSPARSE_DIRECTION_ROW results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 2 & 2 & 3 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]

while using dirA == HIPSPARSE_DIRECTION_COLUMN results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 3 & 1 & 1 & 2 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]
Note:

As indicated, nnzTotalDevHostPtr can point either to host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descrA (Pointer/object) – IN:

the descriptor of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerRowColumn (PointerToInt/object) – OUT:

array of size m or n containing the number of non-zero elements per row or column, respectively.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const double * A, int lda, int * nnzPerRowColumn, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseCnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowColumn, nnzTotalDevHostPtr)#

hipsparseXnnz computes the number of non-zero elements per row or column and the total number of non-zero elements in a dense matrix.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

using dirA == HIPSPARSE_DIRECTION_ROW results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 2 & 2 & 3 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]

while using dirA == HIPSPARSE_DIRECTION_COLUMN results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 3 & 1 & 1 & 2 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]
Note:

As indicated, nnzTotalDevHostPtr can point either to host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descrA (Pointer/object) – IN:

the descriptor of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerRowColumn (PointerToInt/object) – OUT:

array of size m or n containing the number of non-zero elements per row or column, respectively.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCnnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const hipComplex * A, int lda, int * nnzPerRowColumn, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseZnnz(handle, dirA, m, n, descrA, A, lda, nnzPerRowColumn, nnzTotalDevHostPtr)#

hipsparseXnnz computes the number of non-zero elements per row or column and the total number of non-zero elements in a dense matrix.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 1 & 0 & 0 & 2 \\ 3 & 4 & 0 & 0 \\ 5 & 0 & 6 & 7 \end{bmatrix}\end{split}\]

using dirA == HIPSPARSE_DIRECTION_ROW results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 2 & 2 & 3 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]

while using dirA == HIPSPARSE_DIRECTION_COLUMN results in:

\[\begin{split}\begin{align} \text{nnzPerRowColumn} &= \begin{bmatrix} 3 & 1 & 1 & 2 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 7 \end{align}\end{split}\]
Note:

As indicated, nnzTotalDevHostPtr can point either to host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode ().

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

dirA (hipsparseDirection_t) – IN:

direction that specifies whether to count non-zero elements by HIPSPARSE_DIRECTION_ROW or by HIPSPARSE_DIRECTION_COLUMN .

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

descrA (Pointer/object) – IN:

the descriptor of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

nnzPerRowColumn (PointerToInt/object) – OUT:

array of size m or n containing the number of non-zero elements per row or column, respectively.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZnnz(hipsparseHandle_t handle, hipsparseDirection_t dirA, int m, int n, const hipsparseMatDescr_t descrA, const hipDoubleComplex * A, int lda, int * nnzPerRowColumn, int * nnzTotalDevHostPtr)
rocm.bindings.hipsparse.hipsparseSnnz_compress(handle, m, descrA, csrValA, csrRowPtrA, nnzPerRow, nnzC, tol)#

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed. It also computes the total number of remaining elements in the matrix.

Given an input sparse matrix \(A\) in CSR format, the resulting compressed sparse CSR matrix \(C\) is computed using:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

descrA (Pointer/object) – IN:

the descriptor of the sparse CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – OUT:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

nnzC (PointerToInt/object) – OUT:

number of elements in the column indices and values arrays of the compressed sparse CSR matrix. Can be either host or device pointer.

tol (float/int) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSnnz_compress(hipsparseHandle_t handle, int m, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, int * nnzPerRow, int * nnzC, float tol)
rocm.bindings.hipsparse.hipsparseDnnz_compress(handle, m, descrA, csrValA, csrRowPtrA, nnzPerRow, nnzC, tol)#

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed. It also computes the total number of remaining elements in the matrix.

Given an input sparse matrix \(A\) in CSR format, the resulting compressed sparse CSR matrix \(C\) is computed using:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

descrA (Pointer/object) – IN:

the descriptor of the sparse CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – OUT:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

nnzC (PointerToInt/object) – OUT:

number of elements in the column indices and values arrays of the compressed sparse CSR matrix. Can be either host or device pointer.

tol (float/int) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnnz_compress(hipsparseHandle_t handle, int m, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, int * nnzPerRow, int * nnzC, double tol)
rocm.bindings.hipsparse.hipsparseCnnz_compress(handle, m, descrA, csrValA, csrRowPtrA, nnzPerRow, nnzC, tol)#

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed. It also computes the total number of remaining elements in the matrix.

Given an input sparse matrix \(A\) in CSR format, the resulting compressed sparse CSR matrix \(C\) is computed using:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

descrA (Pointer/object) – IN:

the descriptor of the sparse CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – OUT:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

nnzC (PointerToInt/object) – OUT:

number of elements in the column indices and values arrays of the compressed sparse CSR matrix. Can be either host or device pointer.

tol (float2) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCnnz_compress(hipsparseHandle_t handle, int m, const hipsparseMatDescr_t descrA, const hipComplex * csrValA, const int * csrRowPtrA, int * nnzPerRow, int * nnzC, hipComplex tol)
rocm.bindings.hipsparse.hipsparseZnnz_compress(handle, m, descrA, csrValA, csrRowPtrA, nnzPerRow, nnzC, tol)#

This function is used as the first step in converting a CSR matrix to a compressed CSR matrix.

Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed. It also computes the total number of remaining elements in the matrix.

Given an input sparse matrix \(A\) in CSR format, the resulting compressed sparse CSR matrix \(C\) is computed using:

\[C(i,j) = A(i, j) \text{ if |A(i, j)| > tol}\]
Note:

In the case of complex matrices, only the magnitude of the real part of tol is used.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the sparse CSR matrix.

descrA (Pointer/object) – IN:

the descriptor of the sparse CSR matrix.

csrValA (Pointer/object) – IN:

array of nnzA elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix.

nnzPerRow (PointerToInt/object) – OUT:

array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix.

nnzC (PointerToInt/object) – OUT:

number of elements in the column indices and values arrays of the compressed sparse CSR matrix. Can be either host or device pointer.

tol (double2) – IN:

the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in output compressed CSR matrix.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZnnz_compress(hipsparseHandle_t handle, int m, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, int * nnzPerRow, int * nnzC, hipDoubleComplex tol)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csr_bufferSize(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, pBufferSizeInBytes)#

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csr_bufferSize returns the size of the temporary buffer that is required by hipsparseXpruneCsr2csrNnz and hipsparseXpruneCsr2csr. The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnz(), hipsparseDpruneCsr2csrNnz(), hipsparseSpruneCsr2csr(), and hipsparseDpruneCsr2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csr_bufferSize(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * threshold, const hipsparseMatDescr_t descrC, const float * csrValC, const int * csrRowPtrC, const int * csrColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csr_bufferSize(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, pBufferSizeInBytes)#

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csr_bufferSize returns the size of the temporary buffer that is required by hipsparseXpruneCsr2csrNnz and hipsparseXpruneCsr2csr. The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnz(), hipsparseDpruneCsr2csrNnz(), hipsparseSpruneCsr2csr(), and hipsparseDpruneCsr2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csr_bufferSize(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * threshold, const hipsparseMatDescr_t descrC, const double * csrValC, const int * csrRowPtrC, const int * csrColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csr_bufferSizeExt(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, pBufferSizeInBytes)#

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csr_bufferSizeExt returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnz and hipsparseSpruneCsr2csr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnz(), hipsparseDpruneCsr2csrNnz(), hipsparseSpruneCsr2csr(), and hipsparseDpruneCsr2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * threshold, const hipsparseMatDescr_t descrC, const float * csrValC, const int * csrRowPtrC, const int * csrColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csr_bufferSizeExt(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, pBufferSizeInBytes)#

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csr_bufferSizeExt returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnz and hipsparseSpruneCsr2csr . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnz(), hipsparseDpruneCsr2csrNnz(), hipsparseSpruneCsr2csr(), and hipsparseDpruneCsr2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * threshold, const hipsparseMatDescr_t descrC, const double * csrValC, const int * csrRowPtrC, const int * csrColIndC, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csrNnz(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrRowPtrC, nnzTotalDevHostPtr, buffer)#

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrNnz computes the number of non-zero elements per row and the total number of non-zero elements in a sparse CSR matrix after elements less than the threshold are pruned from the matrix.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of nonzero elements in device or host memory.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csr_bufferSize “hipsparseXpruneCsr2csr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csrNnz(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * threshold, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csrNnz(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrRowPtrC, nnzTotalDevHostPtr, buffer)#

Convert and prune sparse a CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrNnz computes the number of non-zero elements per row and the total number of non-zero elements in a sparse CSR matrix after elements less than the threshold are pruned from the matrix.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of nonzero elements in device or host memory.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csr_bufferSize “hipsparseXpruneCsr2csr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csrNnz(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * threshold, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csr(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, buffer)#

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been preallocated by the user. The user first calls hipsparseSpruneCsr2csr_bufferSize to determine the size of the buffer used by hipsparseSpruneCsr2csrNnz and hipsparseXpruneCsr2csr(), which the user then allocates. The user then allocates csrRowPtrC to have m+1 elements and then calls hipsparseXpruneCsr2csrNnz(), which fills in the csrRowPtrC array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then calls hipsparseXpruneCsr2csr() to complete the conversion. 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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

buffer (Pointer/object) – IN:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csr_bufferSize “hipsparseXpruneCsr2csr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csr(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * threshold, const hipsparseMatDescr_t descrC, float * csrValC, const int * csrRowPtrC, int * csrColIndC, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csr(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, threshold, descrC, csrValC, csrRowPtrC, csrColIndC, buffer)#

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been preallocated by the user. The user first calls hipsparseSpruneCsr2csr_bufferSize to determine the size of the buffer used by hipsparseSpruneCsr2csrNnz and hipsparseXpruneCsr2csr(), which the user then allocates. The user then allocates csrRowPtrC to have m+1 elements and then calls hipsparseXpruneCsr2csrNnz(), which fills in the csrRowPtrC array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then calls hipsparseXpruneCsr2csr() to complete the conversion. 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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold which can exist in either host or device memory.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – OUT:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

buffer (Pointer/object) – IN:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csr_bufferSize “hipsparseXpruneCsr2csr_bufferSize()”.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csr(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * threshold, const hipsparseMatDescr_t descrC, double * csrValC, const int * csrRowPtrC, int * csrColIndC, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csrByPercentage_bufferSize(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBufferSizeInBytes)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrByPercentage_bufferSize returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnzByPercentage . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnzByPercentage(), hipsparseDpruneCsr2csrNnzByPercentage(), hipsparseSpruneCsr2csrByPercentage(), and hipsparseDpruneCsr2csrByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csrByPercentage_bufferSize(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, float percentage, const hipsparseMatDescr_t descrC, const float * csrValC, const int * csrRowPtrC, const int * csrColIndC, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csrByPercentage_bufferSize(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBufferSizeInBytes)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrByPercentage_bufferSize returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnzByPercentage . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnzByPercentage(), hipsparseDpruneCsr2csrNnzByPercentage(), hipsparseSpruneCsr2csrByPercentage(), and hipsparseDpruneCsr2csrByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csrByPercentage_bufferSize(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, double percentage, const hipsparseMatDescr_t descrC, const double * csrValC, const int * csrRowPtrC, const int * csrColIndC, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csrByPercentage_bufferSizeExt(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBufferSizeInBytes)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrByPercentage_bufferSizeExt returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnzByPercentage . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnzByPercentage(), hipsparseDpruneCsr2csrNnzByPercentage(), hipsparseSpruneCsr2csrByPercentage(), and hipsparseDpruneCsr2csrByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csrByPercentage_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, float percentage, const hipsparseMatDescr_t descrC, const float * csrValC, const int * csrRowPtrC, const int * csrColIndC, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csrByPercentage_bufferSizeExt(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, pBufferSizeInBytes)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrByPercentage_bufferSizeExt returns the size of the temporary buffer that is required by hipsparseSpruneCsr2csrNnzByPercentage . The temporary storage buffer must be allocated by the user.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – IN:

array of nnzC elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – IN:

array of nnzC elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneCsr2csrNnzByPercentage(), hipsparseDpruneCsr2csrNnzByPercentage(), hipsparseSpruneCsr2csrByPercentage(), and hipsparseDpruneCsr2csrByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csrByPercentage_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, double percentage, const hipsparseMatDescr_t descrC, const double * csrValC, const int * csrRowPtrC, const int * csrColIndC, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csrNnzByPercentage(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrRowPtrC, nnzTotalDevHostPtr, info, buffer)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrNnzByPercentage computes the number of non-zero elements per row and the total number of non-zero elements in a sparse CSR matrix after elements less than the threshold are pruned from the matrix.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

info (pruneInfo/object) – IN:

prune info structure.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csrByPercentage_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csrNnzByPercentage(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, float percentage, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csrNnzByPercentage(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrRowPtrC, nnzTotalDevHostPtr, info, buffer)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

hipsparseXpruneCsr2csrNnzByPercentage computes the number of non-zero elements per row and the total number of non-zero elements in a sparse CSR matrix after elements less than the threshold are pruned from the matrix.

Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrRowPtrC (PointerToInt/object) – OUT:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

info (pruneInfo/object) – IN:

prune info structure.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csrByPercentage_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csrNnzByPercentage(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, double percentage, const hipsparseMatDescr_t descrC, int * csrRowPtrC, int * nnzTotalDevHostPtr, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneCsr2csrByPercentage(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, buffer)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been preallocated by the user. The user first calls hipsparseSpruneCsr2csr_bufferSize to determine the size of the buffer used by hipsparseSpruneCsr2csrNnz and hipsparseXpruneCsr2csr(), which the user then allocates. The user then allocates csrRowPtrC to have m+1 elements and then calls hipsparseSpruneCsr2csrNnz which fills in the csrRowPtrC array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then calls hipsparseXpruneCsr2csr() to complete the conversion. The 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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnz_C elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – OUT:

array of nnz_C elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

buffer (Pointer/object) – IN:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csrByPercentage_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneCsr2csrByPercentage(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, float percentage, const hipsparseMatDescr_t descrC, float * csrValC, const int * csrRowPtrC, int * csrColIndC, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneCsr2csrByPercentage(handle, m, n, nnzA, descrA, csrValA, csrRowPtrA, csrColIndA, percentage, descrC, csrValC, csrRowPtrC, csrColIndC, info, buffer)#

Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix.

This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been preallocated by the user. The user first calls hipsparseSpruneCsr2csr_bufferSize to determine the size of the buffer used by hipsparseSpruneCsr2csrNnz and hipsparseXpruneCsr2csr(), which the user then allocates. The user then allocates csrRowPtrC to have m+1 elements and then calls hipsparseSpruneCsr2csrNnz which fills in the csrRowPtrC array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then calls hipsparseXpruneCsr2csr() to complete the conversion. The 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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows in the sparse CSR matrix.

n (int) – IN:

number of columns in the sparse CSR matrix.

nnzA (int) – IN:

number of non-zeros in the sparse CSR matrix A.

descrA (Pointer/object) – IN:

descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValA (Pointer/object) – IN:

array of nnzA elements containing the values of the sparse CSR matrix A.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix A.

csrColIndA (PointerToInt/object) – IN:

array of nnzA elements containing the column indices of the sparse CSR matrix A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descrC (Pointer/object) – IN:

descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.

csrValC (Pointer/object) – OUT:

array of nnz_C elements containing the values of the sparse CSR matrix C.

csrRowPtrC (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix C.

csrColIndC (PointerToInt/object) – OUT:

array of nnz_C elements containing the column indices of the sparse CSR matrix C.

info (pruneInfo/object) – IN:

prune info structure.

buffer (Pointer/object) – IN:

buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csrByPercentage_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneCsr2csrByPercentage(hipsparseHandle_t handle, int m, int n, int nnzA, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, double percentage, const hipsparseMatDescr_t descrC, double * csrValC, const int * csrRowPtrC, int * csrColIndC, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneDense2csr_bufferSize(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, pBufferSizeInBytes)#

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix.

Specifically given an input dense column-ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]
Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csr_bufferSize(hipsparseHandle_t handle, int m, int n, const float * A, int lda, const float * threshold, const hipsparseMatDescr_t descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneDense2csr_bufferSize(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, pBufferSizeInBytes)#

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix.

Specifically given an input dense column-ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]
Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csr_bufferSize(hipsparseHandle_t handle, int m, int n, const double * A, int lda, const double * threshold, const hipsparseMatDescr_t descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneDense2csr_bufferSizeExt(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, pBufferSizeInBytes)#

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix.

Specifically given an input dense column-ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]
Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float * A, int lda, const float * threshold, const hipsparseMatDescr_t descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneDense2csr_bufferSizeExt(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, pBufferSizeInBytes)#

hipsparseXpruneDense2csr_bufferSize computes the the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix.

Specifically given an input dense column-ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]
Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A. Must be non-negative.

n (int) – IN:

number of columns of the dense matrix A. Must be non-negative.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A. Must be at least m.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csr_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double * A, int lda, const double * threshold, const hipsparseMatDescr_t descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneDense2csrNnz(handle, m, n, A, lda, threshold, descr, csrRowPtr, nnzTotalDevHostPtr, buffer)#

hipsparseXpruneDense2csrNnz computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix after the elements less than the (non-negative) threshold are pruned from the matrix.

Given an input dense column ordered matrix A, with leading dimension lda where lda>=m, the resulting pruned sparse CSR matrix \(C\) is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]

First, the user must determine the size of the required temporary buffer using the routine hipsparseSpruneDense2csr_bufferSize and then allocate it. Next, the user allocates csrRowPtr with size m+1. Then the function passes both the temporary storage buffer and csrRowPtr to hipsparseXpruneDense2csrNnz to determine the total number of non-zeros that will exist in the sparse CSR matrix C (after pruning has been performed on A ) as well as fill the output CSR row pointer array csrRowPtr.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 6 & 2 & 3 & 7 \\ 5 & 6 & 7 & 8 \\ 5 & 4 & 8 & 1 \end{bmatrix}\end{split}\]

and the threshold value 5, the resulting matrix after pruning is:

\[\begin{split}\begin{bmatrix} 6 & 0 & 0 & 7 \\ 0 & 6 & 7 & 8 \\ 0 & 0 & 8 & 0 \end{bmatrix}\end{split}\]

and the corresponding row pointer array and non-zero count:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 5 & 6 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 6 \end{align}\end{split}\]
Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of the dense array A.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneDense2csr_bufferSize or hipsparseSpruneDense2csr_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csrNnz(hipsparseHandle_t handle, int m, int n, const float * A, int lda, const float * threshold, const hipsparseMatDescr_t descr, int * csrRowPtr, int * nnzTotalDevHostPtr, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneDense2csrNnz(handle, m, n, A, lda, threshold, descr, csrRowPtr, nnzTotalDevHostPtr, buffer)#

hipsparseXpruneDense2csrNnz computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix after the elements less than the (non-negative) threshold are pruned from the matrix.

Given an input dense column ordered matrix A, with leading dimension lda where lda>=m, the resulting pruned sparse CSR matrix \(C\) is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]

First, the user must determine the size of the required temporary buffer using the routine hipsparseSpruneDense2csr_bufferSize and then allocate it. Next, the user allocates csrRowPtr with size m+1. Then the function passes both the temporary storage buffer and csrRowPtr to hipsparseXpruneDense2csrNnz to determine the total number of non-zeros that will exist in the sparse CSR matrix C (after pruning has been performed on A ) as well as fill the output CSR row pointer array csrRowPtr.

For example, given the dense matrix:

\[\begin{split}\begin{bmatrix} 6 & 2 & 3 & 7 \\ 5 & 6 & 7 & 8 \\ 5 & 4 & 8 & 1 \end{bmatrix}\end{split}\]

and the threshold value 5, the resulting matrix after pruning is:

\[\begin{split}\begin{bmatrix} 6 & 0 & 0 & 7 \\ 0 & 6 & 7 & 8 \\ 0 & 0 & 8 & 0 \end{bmatrix}\end{split}\]

and the corresponding row pointer array and non-zero count:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 5 & 6 \end{bmatrix} \\ \text{nnzTotalDevHostPtr} &= 6 \end{align}\end{split}\]
Note:

The routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of the dense array A.

threshold (Pointer/object) – IN:

pointer to the pruning non-negative threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneDense2csr_bufferSize or hipsparseSpruneDense2csr_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csrNnz(hipsparseHandle_t handle, int m, int n, const double * A, int lda, const double * threshold, const hipsparseMatDescr_t descr, int * csrRowPtr, int * nnzTotalDevHostPtr, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneDense2csr(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, buffer)#

hipsparseXpruneDense2csr converts the matrix A in dense format into a sparse matrix in CSR format, while pruning values that are less than the (non-negative) threshold. All the parameters are assumed to have been pre-allocated by the user.

Given an input dense column ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]

The user first calls hipsparseSpruneDense2csr_bufferSize to determine the size of the required user-allocated temporary storage buffer. The user then allocates this buffer. Next, the user allocates csrRowPtr to have m+1 elements and then calls hipsparseSpruneDense2csrNnz , which fills in the csrRowPtr array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then allocates csrColInd and csrVal to have size nnzTotalDevHostPtr and completes the conversion by calling hipsparseXpruneDense2csr().

For example, performing these steps with the dense input matrix A :

\[\begin{split}\begin{bmatrix} 6 & 2 & 3 & 7 \\ 5 & 6 & 7 & 8 \\ 5 & 4 & 8 & 1 \end{bmatrix}\end{split}\]

and the threshold value 5, results in the pruned matrix C:

\[\begin{split}\begin{bmatrix} 6 & 0 & 0 & 7 \\ 0 & 6 & 7 & 8 \\ 0 & 0 & 8 & 0 \end{bmatrix}\end{split}\]

and corresponding CSR row, column, and values arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 5 & 6 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 1 & 2 & 3 & 2 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 6 & 7 & 6 & 7 & 8 & 8 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

The routine hipsparseXpruneDense2csr() is executed asynchronously with respect to the host and can return control to the application on the host before the entire result is ready.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSpruneDense2csr_bufferSize or hipsparseSpruneDense2csr_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csr(hipsparseHandle_t handle, int m, int n, const float * A, int lda, const float * threshold, const hipsparseMatDescr_t descr, float * csrVal, const int * csrRowPtr, int * csrColInd, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneDense2csr(handle, m, n, A, lda, threshold, descr, csrVal, csrRowPtr, csrColInd, buffer)#

hipsparseXpruneDense2csr converts the matrix A in dense format into a sparse matrix in CSR format, while pruning values that are less than the (non-negative) threshold. All the parameters are assumed to have been pre-allocated by the user.

Given an input dense column ordered matrix A, with leading dimension lda, where lda>=m, the resulting pruned sparse CSR matrix C is computed using:

\[|C(i,j)| = A(i, j) \text{ if |A(i, j)| > threshold}\]

The user first calls hipsparseSpruneDense2csr_bufferSize to determine the size of the required user-allocated temporary storage buffer. The user then allocates this buffer. Next, the user allocates csrRowPtr to have m+1 elements and then calls hipsparseSpruneDense2csrNnz , which fills in the csrRowPtr array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then allocates csrColInd and csrVal to have size nnzTotalDevHostPtr and completes the conversion by calling hipsparseXpruneDense2csr().

For example, performing these steps with the dense input matrix A :

\[\begin{split}\begin{bmatrix} 6 & 2 & 3 & 7 \\ 5 & 6 & 7 & 8 \\ 5 & 4 & 8 & 1 \end{bmatrix}\end{split}\]

and the threshold value 5, results in the pruned matrix C:

\[\begin{split}\begin{bmatrix} 6 & 0 & 0 & 7 \\ 0 & 6 & 7 & 8 \\ 0 & 0 & 8 & 0 \end{bmatrix}\end{split}\]

and corresponding CSR row, column, and values arrays:

\[\begin{split}\begin{align} \text{csrRowPtr} &= \begin{bmatrix} 0 & 2 & 5 & 6 \end{bmatrix} \\ \text{csrColInd} &= \begin{bmatrix} 0 & 3 & 1 & 2 & 3 & 2 \end{bmatrix} \\ \text{csrVal} &= \begin{bmatrix} 6 & 7 & 6 & 7 & 8 & 8 \end{bmatrix} \\ \end{align}\end{split}\]
Note:

The routine hipsparseXpruneDense2csr() is executed asynchronously with respect to the host and can return control to the application on the host before the entire result is ready.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

threshold (Pointer/object) – IN:

pointer to the non-negative pruning threshold, which can exist in either host or device memory.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSpruneDense2csr_bufferSize or hipsparseSpruneDense2csr_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csr(hipsparseHandle_t handle, int m, int n, const double * A, int lda, const double * threshold, const hipsparseMatDescr_t descr, double * csrVal, const int * csrRowPtr, int * csrColInd, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneDense2csrByPercentage_bufferSize(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

hipsparseXpruneDense2csrByPercentage_bufferSize functions convert the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix where the pruning is done based on a percentage.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseXpruneDense2csrByPercentage_bufferSize, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (whose size is determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage .

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) nonzero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csrByPercentage_bufferSize(hipsparseHandle_t handle, int m, int n, const float * A, int lda, float percentage, const hipsparseMatDescr_t descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneDense2csrByPercentage_bufferSize(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

hipsparseXpruneDense2csrByPercentage_bufferSize functions convert the size of the user-allocated temporary storage buffer used when converting a dense matrix to a pruned CSR matrix where the pruning is done based on a percentage.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseXpruneDense2csrByPercentage_bufferSize, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (whose size is determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage .

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) nonzero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csrByPercentage_bufferSize(hipsparseHandle_t handle, int m, int n, const double * A, int lda, double percentage, const hipsparseMatDescr_t descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneDense2csrByPercentage_bufferSizeExt(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function computes the size of the user-allocated temporary storage buffer used when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseXpruneDense2csrByPercentage_bufferSizeExt, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (whose size is determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage .

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csrByPercentage_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const float * A, int lda, float percentage, const hipsparseMatDescr_t descr, const float * csrVal, const int * csrRowPtr, const int * csrColInd, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDpruneDense2csrByPercentage_bufferSizeExt(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, pBufferSizeInBytes)#

This function computes the size of the user-allocated temporary storage buffer used when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseXpruneDense2csrByPercentage_bufferSizeExt, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (whose size is determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage .

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
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.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – IN:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – IN:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csrByPercentage_bufferSizeExt(hipsparseHandle_t handle, int m, int n, const double * A, int lda, double percentage, const hipsparseMatDescr_t descr, const double * csrVal, const int * csrRowPtr, const int * csrColInd, pruneInfo_t info, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpruneDense2csrNnzByPercentage(handle, m, n, A, lda, percentage, descr, csrRowPtr, nnzTotalDevHostPtr, info, buffer)#

This function computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseSpruneDense2csrByPercentage_bufferSize , which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseXpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (which have a size determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage “hipsparseXpruneDense2csrByPercentage()”.

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
Note:

This routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

info (pruneInfo/object) – IN:

prune information structure

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneDense2csrByPercentage_bufferSize or hipsparseSpruneDense2csrByPercentage_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csrNnzByPercentage(hipsparseHandle_t handle, int m, int n, const float * A, int lda, float percentage, const hipsparseMatDescr_t descr, int * csrRowPtr, int * nnzTotalDevHostPtr, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneDense2csrNnzByPercentage(handle, m, n, A, lda, percentage, descr, csrRowPtr, nnzTotalDevHostPtr, info, buffer)#

This function computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseSpruneDense2csrByPercentage_bufferSize , which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseXpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (which have a size determined by the value at nnzTotalDevHostPtr) and calling hipsparseSpruneDense2csrByPercentage “hipsparseXpruneDense2csrByPercentage()”.

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
Note:

This routine supports asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A.

csrRowPtr (PointerToInt/object) – OUT:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

nnzTotalDevHostPtr (PointerToInt/object) – OUT:

total number of non-zero elements in device or host memory.

info (pruneInfo/object) – IN:

prune information structure

buffer (Pointer/object) – OUT:

buffer allocated by the user whose size is determined by calling hipsparseSpruneDense2csrByPercentage_bufferSize or hipsparseSpruneDense2csrByPercentage_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csrNnzByPercentage(hipsparseHandle_t handle, int m, int n, const double * A, int lda, double percentage, const hipsparseMatDescr_t descr, int * csrRowPtr, int * nnzTotalDevHostPtr, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseSpruneDense2csrByPercentage(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, buffer)#

This function computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseSpruneDense2csrByPercentage_bufferSize “hipsparseXpruneDense2csrByPercentage_bufferSize()”, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (which have a size determined by the value at nnzTotalDevHostPtr) and calling hipsparseXpruneDense2csrByPercentage.

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \ cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
Note:

This routine support asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure

buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSpruneDense2csrByPercentage_bufferSize or hipsparseSpruneDense2csrByPercentage_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpruneDense2csrByPercentage(hipsparseHandle_t handle, int m, int n, const float * A, int lda, float percentage, const hipsparseMatDescr_t descr, float * csrVal, const int * csrRowPtr, int * csrColInd, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseDpruneDense2csrByPercentage(handle, m, n, A, lda, percentage, descr, csrVal, csrRowPtr, csrColInd, info, buffer)#

This function computes the number of non-zero elements per row and the total number of non-zero elements in a dense matrix when converting and pruning by percentage a dense matrix to a CSR matrix.

When converting and pruning a dense matrix A to a CSR matrix by percentage, the following steps are performed. First, the user calls hipsparseSpruneDense2csrByPercentage_bufferSize “hipsparseXpruneDense2csrByPercentage_bufferSize()”, which determines the size of the temporary storage buffer. After this is determined, this buffer must be allocated by the user. Next, the user allocates the csrRowPtr array to have m+1 elements and calls hipsparseSpruneDense2csrNnzByPercentage . Finally, the user finishes the conversion by allocating the csrColInd and csrVal arrays (which have a size determined by the value at nnzTotalDevHostPtr) and calling hipsparseXpruneDense2csrByPercentage.

The pruning by percentage works by first sorting the absolute values of the dense matrix A. Users can then determine a position in this sorted array by

\[\begin{split}pos = ceil(m \ cdot n \cdot (percentage/100)) - 1 \\ pos = \min(pos, m \cdot n-1) \\ pos = \max(pos, 0) \\ threshold = sorted_A[pos]\end{split}\]
Note:

This routine support asynchronous execution if the pointer mode is set to device.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of the dense matrix A.

n (int) – IN:

number of columns of the dense matrix A.

A (Pointer/object) – IN:

array of dimensions (lda, n).

lda (int) – IN:

leading dimension of dense array A.

percentage (float/int) – IN:

percentage>=0 and percentage<=100.

descr (Pointer/object) – IN:

the descriptor of the dense matrix A. The supported matrix type is HIPSPARSE_MATRIX_TYPE_GENERAL and any valid value of the hipsparseIndexBase_t .

csrVal (Pointer/object) – OUT:

array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) non-zero elements of matrix A.

csrRowPtr (PointerToInt/object) – IN:

integer array of m+1 elements that contains the start of every row and the end of the last row plus one.

csrColInd (PointerToInt/object) – OUT:

integer array of nnz ( = csrRowPtr[m] - csrRowPtr[0] ) column indices of the non-zero elements of matrix A.

info (pruneInfo/object) – IN:

prune information structure

buffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size is returned by hipsparseSpruneDense2csrByPercentage_bufferSize or hipsparseSpruneDense2csrByPercentage_bufferSizeExt .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDpruneDense2csrByPercentage(hipsparseHandle_t handle, int m, int n, const double * A, int lda, double percentage, const hipsparseMatDescr_t descr, double * csrVal, const int * csrRowPtr, int * csrColInd, pruneInfo_t info, void * buffer)
rocm.bindings.hipsparse.hipsparseScsrcolor(handle, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, fractionToColor, ncolors, coloring, reordering, info)#

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix \(A\) stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fractionToColor is a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array that groups unknowns of the same color. The matrix \(A\) must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix \(A\) is non-symmetric, then the user is responsible to provide the symmetric part \(\frac{A+A^T}{2}\).

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of sparse matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of sparse matrix \(A\). Must be non-negative.

descrA (Pointer/object) – IN:

sparse matrix descriptor.

csrValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

fractionToColor (Pointer/object) – IN:

fraction of nodes to be colored, which should be in the interval \([0.0,1.0]\). For example, \(0.8\) implies that \(80\) percent of nodes will be colored.

ncolors (PointerToInt/object) – OUT:

resulting number of distinct colors.

coloring (PointerToInt/object) – OUT:

resulting mapping of colors.

reordering (PointerToInt/object) – OUT:

optional resulting reordering permutation if reordering is a non-null pointer.

info (Pointer/object) – INOUT:

structure that holds the information collected during the coloring algorithm.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const float * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * fractionToColor, int * ncolors, int * coloring, int * reordering, hipsparseColorInfo_t info)
rocm.bindings.hipsparse.hipsparseDcsrcolor(handle, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, fractionToColor, ncolors, coloring, reordering, info)#

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix \(A\) stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fractionToColor is a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array that groups unknowns of the same color. The matrix \(A\) must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix \(A\) is non-symmetric, then the user is responsible to provide the symmetric part \(\frac{A+A^T}{2}\).

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of sparse matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of sparse matrix \(A\). Must be non-negative.

descrA (Pointer/object) – IN:

sparse matrix descriptor.

csrValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

fractionToColor (Pointer/object) – IN:

fraction of nodes to be colored, which should be in the interval \([0.0,1.0]\). For example, \(0.8\) implies that \(80\) percent of nodes will be colored.

ncolors (PointerToInt/object) – OUT:

resulting number of distinct colors.

coloring (PointerToInt/object) – OUT:

resulting mapping of colors.

reordering (PointerToInt/object) – OUT:

optional resulting reordering permutation if reordering is a non-null pointer.

info (Pointer/object) – INOUT:

structure that holds the information collected during the coloring algorithm.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const double * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * fractionToColor, int * ncolors, int * coloring, int * reordering, hipsparseColorInfo_t info)
rocm.bindings.hipsparse.hipsparseCcsrcolor(handle, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, fractionToColor, ncolors, coloring, reordering, info)#

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix \(A\) stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fractionToColor is a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array that groups unknowns of the same color. The matrix \(A\) must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix \(A\) is non-symmetric, then the user is responsible to provide the symmetric part \(\frac{A+A^T}{2}\).

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of sparse matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of sparse matrix \(A\). Must be non-negative.

descrA (Pointer/object) – IN:

sparse matrix descriptor.

csrValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

fractionToColor (Pointer/object) – IN:

fraction of nodes to be colored, which should be in the interval \([0.0,1.0]\). For example, \(0.8\) implies that \(80\) percent of nodes will be colored.

ncolors (PointerToInt/object) – OUT:

resulting number of distinct colors.

coloring (PointerToInt/object) – OUT:

resulting mapping of colors.

reordering (PointerToInt/object) – OUT:

optional resulting reordering permutation if reordering is a non-null pointer.

info (Pointer/object) – INOUT:

structure that holds the information collected during the coloring algorithm.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const float * fractionToColor, int * ncolors, int * coloring, int * reordering, hipsparseColorInfo_t info)
rocm.bindings.hipsparse.hipsparseZcsrcolor(handle, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, fractionToColor, ncolors, coloring, reordering, info)#

Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format.

hipsparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix \(A\) stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fractionToColor is a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array that groups unknowns of the same color. The matrix \(A\) must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix \(A\) is non-symmetric, then the user is responsible to provide the symmetric part \(\frac{A+A^T}{2}\).

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

m (int) – IN:

number of rows of sparse matrix \(A\). Must be non-negative.

nnz (int) – IN:

number of non-zero entries of sparse matrix \(A\). Must be non-negative.

descrA (Pointer/object) – IN:

sparse matrix descriptor.

csrValA (Pointer/object) – IN:

array of nnz elements of the sparse CSR matrix.

csrRowPtrA (PointerToInt/object) – IN:

array of m+1 elements that point to the start of every row of the sparse CSR matrix.

csrColIndA (PointerToInt/object) – IN:

array of nnz elements containing the column indices of the sparse CSR matrix.

fractionToColor (Pointer/object) – IN:

fraction of nodes to be colored, which should be in the interval \([0.0,1.0]\). For example, \(0.8\) implies that \(80\) percent of nodes will be colored.

ncolors (PointerToInt/object) – OUT:

resulting number of distinct colors.

coloring (PointerToInt/object) – OUT:

resulting mapping of colors.

reordering (PointerToInt/object) – OUT:

optional resulting reordering permutation if reordering is a non-null pointer.

info (Pointer/object) – INOUT:

structure that holds the information collected during the coloring algorithm.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseZcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex * csrValA, const int * csrRowPtrA, const int * csrColIndA, const double * fractionToColor, int * ncolors, int * coloring, int * reordering, hipsparseColorInfo_t info)
class rocm.bindings.hipsparse.hipsparseSpMatDescr_st(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.hipsparse.hipsparseSpMatDescr_t#
rocm.bindings.hipsparse.hipsparseConstSpMatDescr_t#
class rocm.bindings.hipsparse.hipsparseSpGEMMDescr(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.hipsparseSpSVDescr(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

class rocm.bindings.hipsparse.hipsparseSpSMDescr(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.hipsparse.hipsparseSpGEMMDescr_t#
rocm.bindings.hipsparse.hipsparseSpSVDescr_t#
rocm.bindings.hipsparse.hipsparseSpSMDescr_t#
class rocm.bindings.hipsparse.hipsparseFormat_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_FORMAT_CSR: int#
HIPSPARSE_FORMAT_CSC: int#
HIPSPARSE_FORMAT_COO: int#
HIPSPARSE_FORMAT_COO_AOS: int#
HIPSPARSE_FORMAT_BLOCKED_ELL: int#
HIPSPARSE_FORMAT_SLICED_ELL: int#
HIPSPARSE_FORMAT_BSR: int#
class rocm.bindings.hipsparse.hipsparseOrder_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_ORDER_COLUMN: int#
HIPSPARSE_ORDER_COL: int#
HIPSPARSE_ORDER_ROW: int#
class rocm.bindings.hipsparse.hipsparseIndexType_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_INDEX_16U: int#
HIPSPARSE_INDEX_32I: int#
HIPSPARSE_INDEX_64I: int#
class rocm.bindings.hipsparse.hipsparseSpMVAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_MV_ALG_DEFAULT: int#
HIPSPARSE_COOMV_ALG: int#
HIPSPARSE_CSRMV_ALG1: int#
HIPSPARSE_CSRMV_ALG2: int#
HIPSPARSE_SPMV_ALG_DEFAULT: int#
HIPSPARSE_SPMV_COO_ALG1: int#
HIPSPARSE_SPMV_CSR_ALG1: int#
HIPSPARSE_SPMV_CSR_ALG2: int#
HIPSPARSE_SPMV_COO_ALG2: int#
HIPSPARSE_SPMV_SELL_ALG1: int#
HIPSPARSE_SPMV_CSR_ALG3: int#
HIPSPARSE_SPMV_BSR_ALG1: int#
class rocm.bindings.hipsparse.hipsparseSpMMAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_MM_ALG_DEFAULT: int#
HIPSPARSE_COOMM_ALG1: int#
HIPSPARSE_COOMM_ALG2: int#
HIPSPARSE_COOMM_ALG3: int#
HIPSPARSE_CSRMM_ALG1: int#
HIPSPARSE_SPMM_ALG_DEFAULT: int#
HIPSPARSE_SPMM_COO_ALG1: int#
HIPSPARSE_SPMM_COO_ALG2: int#
HIPSPARSE_SPMM_COO_ALG3: int#
HIPSPARSE_SPMM_COO_ALG4: int#
HIPSPARSE_SPMM_CSR_ALG1: int#
HIPSPARSE_SPMM_CSR_ALG2: int#
HIPSPARSE_SPMM_CSR_ALG3: int#
HIPSPARSE_SPMM_BLOCKED_ELL_ALG1: int#
HIPSPARSE_SPMM_BSR_ALG1: int#
class rocm.bindings.hipsparse.hipsparseSparseToDenseAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SPARSETODENSE_ALG_DEFAULT: int#
class rocm.bindings.hipsparse.hipsparseDenseToSparseAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_DENSETOSPARSE_ALG_DEFAULT: int#
class rocm.bindings.hipsparse.hipsparseSDDMMAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SDDMM_ALG_DEFAULT: int#
class rocm.bindings.hipsparse.hipsparseSpSVAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SPSV_ALG_DEFAULT: int#
class rocm.bindings.hipsparse.hipsparseSpSMAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SPSM_ALG_DEFAULT: int#
class rocm.bindings.hipsparse.hipsparseSpMatAttribute_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SPMAT_FILL_MODE: int#
HIPSPARSE_SPMAT_DIAG_TYPE: int#
class rocm.bindings.hipsparse.hipsparseSpGEMMAlg_t#

Bases: enum.IntEnum

(No short description)

HIPSPARSE_SPGEMM_DEFAULT: int#
HIPSPARSE_SPGEMM_CSR_ALG_DETERMINISTIC: int#
HIPSPARSE_SPGEMM_CSR_ALG_NONDETERMINISTIC: int#
HIPSPARSE_SPGEMM_ALG1: int#
HIPSPARSE_SPGEMM_ALG2: int#
HIPSPARSE_SPGEMM_ALG3: int#
rocm.bindings.hipsparse.hipsparseCreateSpVec(size, nnz, indices, values, idxType, idxBase, valueType)#

Create a sparse vector.

hipsparseCreateSpVec creates a sparse vector descriptor. It should be destroyed at the end using hipsparseDestroySpVec().

Args:
size (int):

(undocumented)

nnz (int):

(undocumented)

indices (Pointer/object):

(undocumented)

values (Pointer/object):

(undocumented)

idxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateSpVec(hipsparseSpVecDescr_t * spVecDescr, int64_t size, int64_t nnz, void * indices, void * values, hipsparseIndexType_t idxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstSpVec(spVecDescr, size, nnz, indices, values, idxType, idxBase, valueType)#

Create a const sparse vector.

hipsparseCreateConstSpVec creates a const sparse vector descriptor. It should be destroyed at the end using hipsparseDestroySpVec().

Args:
spVecDescr (ListOfPointer/object):

(undocumented)

size (int):

(undocumented)

nnz (int):

(undocumented)

indices (Pointer/object):

(undocumented)

values (Pointer/object):

(undocumented)

idxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstSpVec(hipsparseConstSpVecDescr_t * spVecDescr, int64_t size, int64_t nnz, const void * indices, const void * values, hipsparseIndexType_t idxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseDestroySpVec(spVecDescr)#

Destroy a sparse vector.

hipsparseDestroySpVec destroys a sparse vector descriptor and releases all resources used by the descriptor.

Args:
spVecDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroySpVec(hipsparseConstSpVecDescr_t spVecDescr)
rocm.bindings.hipsparse.hipsparseSpVecGet(spVecDescr, size, nnz, idxType, idxBase, valueType)#

Get the fields of the sparse vector descriptor.

hipsparseSpVecGet gets the fields of the sparse vector descriptor.

Args:
spVecDescr (Pointer/object):

(undocumented)

size (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

idxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 3 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVecGet(const hipsparseSpVecDescr_t spVecDescr, int64_t * size, int64_t * nnz, void ** indices, void ** values, hipsparseIndexType_t * idxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstSpVecGet(spVecDescr, size, nnz, indices, values, idxType, idxBase, valueType)#

Get the fields of the const sparse vector descriptor.

hipsparseConstSpVecGet gets the fields of the const sparse vector descriptor.

Args:
spVecDescr (Pointer/object):

(undocumented)

size (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

indices (ListOfPointer/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

idxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstSpVecGet(hipsparseConstSpVecDescr_t spVecDescr, int64_t * size, int64_t * nnz, const void ** indices, const void ** values, hipsparseIndexType_t * idxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseSpVecGetIndexBase(spVecDescr, idxBase)#

Get the index base of a sparse vector.

Args:
spVecDescr (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVecGetIndexBase(const hipsparseConstSpVecDescr_t spVecDescr, hipsparseIndexBase_t * idxBase)
rocm.bindings.hipsparse.hipsparseSpVecGetValues(spVecDescr)#

Get the pointer to a sparse vector data array.

Args:
spVecDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVecGetValues(const hipsparseSpVecDescr_t spVecDescr, void ** values)
rocm.bindings.hipsparse.hipsparseConstSpVecGetValues(spVecDescr, values)#

Get the pointer to a sparse vector data array.

Args:
spVecDescr (Pointer/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstSpVecGetValues(hipsparseConstSpVecDescr_t spVecDescr, const void ** values)
rocm.bindings.hipsparse.hipsparseSpVecSetValues(spVecDescr, values)#

Set the pointer of a sparse vector data array.

Args:
spVecDescr (Pointer/object):

(undocumented)

values (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVecSetValues(hipsparseSpVecDescr_t spVecDescr, void * values)
rocm.bindings.hipsparse.hipsparseCreateCoo(rows, cols, nnz, cooRowInd, cooColInd, cooValues, cooIdxType, idxBase, valueType)#

Create a sparse COO matrix descriptor.

hipsparseCreateCoo creates a sparse COO matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

cooRowInd (Pointer/object):

(undocumented)

cooColInd (Pointer/object):

(undocumented)

cooValues (Pointer/object):

(undocumented)

cooIdxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCoo(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void * cooRowInd, void * cooColInd, void * cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstCoo(rows, cols, nnz, cooRowInd, cooColInd, cooValues, cooIdxType, idxBase, valueType)#

Create a sparse COO matrix descriptor.

hipsparseCreateConstCoo creates a sparse COO matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

cooRowInd (Pointer/object):

(undocumented)

cooColInd (Pointer/object):

(undocumented)

cooValues (Pointer/object):

(undocumented)

cooIdxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstCoo(hipsparseConstSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void * cooRowInd, const void * cooColInd, const void * cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateCooAoS(rows, cols, nnz, cooInd, cooValues, cooIdxType, idxBase, valueType)#

Create a sparse COO (AoS) matrix descriptor.

hipsparseCreateCooAoS creates a sparse COO (AoS) matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

cooInd (Pointer/object):

(undocumented)

cooValues (Pointer/object):

(undocumented)

cooIdxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCooAoS(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void * cooInd, void * cooValues, hipsparseIndexType_t cooIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateCsr(rows, cols, nnz, csrRowOffsets, csrColInd, csrValues, csrRowOffsetsType, csrColIndType, idxBase, valueType)#

Create a sparse CSR matrix descriptor.

hipsparseCreateCsr creates a sparse CSR matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

csrRowOffsets (Pointer/object):

(undocumented)

csrColInd (Pointer/object):

(undocumented)

csrValues (Pointer/object):

(undocumented)

csrRowOffsetsType (hipsparseIndexType_t):

(undocumented)

csrColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsr(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void * csrRowOffsets, void * csrColInd, void * csrValues, hipsparseIndexType_t csrRowOffsetsType, hipsparseIndexType_t csrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstCsr(rows, cols, nnz, csrRowOffsets, csrColInd, csrValues, csrRowOffsetsType, csrColIndType, idxBase, valueType)#

Create a sparse CSR matrix descriptor.

hipsparseCreateConstCsr creates a sparse CSR matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

csrRowOffsets (Pointer/object):

(undocumented)

csrColInd (Pointer/object):

(undocumented)

csrValues (Pointer/object):

(undocumented)

csrRowOffsetsType (hipsparseIndexType_t):

(undocumented)

csrColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstCsr(hipsparseConstSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void * csrRowOffsets, const void * csrColInd, const void * csrValues, hipsparseIndexType_t csrRowOffsetsType, hipsparseIndexType_t csrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateCsc(rows, cols, nnz, cscColOffsets, cscRowInd, cscValues, cscColOffsetsType, cscRowIndType, idxBase, valueType)#

Create a sparse CSC matrix descriptor.

hipsparseCreateCsc creates a sparse CSC matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

cscColOffsets (Pointer/object):

(undocumented)

cscRowInd (Pointer/object):

(undocumented)

cscValues (Pointer/object):

(undocumented)

cscColOffsetsType (hipsparseIndexType_t):

(undocumented)

cscRowIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateCsc(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, void * cscColOffsets, void * cscRowInd, void * cscValues, hipsparseIndexType_t cscColOffsetsType, hipsparseIndexType_t cscRowIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstCsc(rows, cols, nnz, cscColOffsets, cscRowInd, cscValues, cscColOffsetsType, cscRowIndType, idxBase, valueType)#

Create a sparse CSC matrix descriptor.

hipsparseCreateConstCsc creates a sparse CSC matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

cscColOffsets (Pointer/object):

(undocumented)

cscRowInd (Pointer/object):

(undocumented)

cscValues (Pointer/object):

(undocumented)

cscColOffsetsType (hipsparseIndexType_t):

(undocumented)

cscRowIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstCsc(hipsparseConstSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, const void * cscColOffsets, const void * cscRowInd, const void * cscValues, hipsparseIndexType_t cscColOffsetsType, hipsparseIndexType_t cscRowIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateBlockedEll(rows, cols, ellBlockSize, ellCols, ellColInd, ellValue, ellIdxType, idxBase, valueType)#

Create a sparse Blocked ELL matrix descriptor.

hipsparseCreateCsr creates a sparse Blocked ELL matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

ellBlockSize (int):

(undocumented)

ellCols (int):

(undocumented)

ellColInd (Pointer/object):

(undocumented)

ellValue (Pointer/object):

(undocumented)

ellIdxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBlockedEll(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, void * ellColInd, void * ellValue, hipsparseIndexType_t ellIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstBlockedEll(rows, cols, ellBlockSize, ellCols, ellColInd, ellValue, ellIdxType, idxBase, valueType)#

Create a sparse Blocked ELL matrix descriptor.

hipsparseCreateConstBlockedEll creates a sparse Blocked ELL matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

ellBlockSize (int):

(undocumented)

ellCols (int):

(undocumented)

ellColInd (Pointer/object):

(undocumented)

ellValue (Pointer/object):

(undocumented)

ellIdxType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstBlockedEll(hipsparseConstSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t ellBlockSize, int64_t ellCols, const void * ellColInd, const void * ellValue, hipsparseIndexType_t ellIdxType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateSlicedEll(rows, cols, nnz, sellValuesSize, sliceSize, sellSliceOffsets, sellColInd, sellValues, sellSliceOffsetsType, sellColIndType, idxBase, valueType)#

Create a sparse Sliced ELL matrix descriptor.

hipsparseCreateSlicedEll creates a sparse Sliced ELL matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

sellValuesSize (int):

(undocumented)

sliceSize (int):

(undocumented)

sellSliceOffsets (Pointer/object):

(undocumented)

sellColInd (Pointer/object):

(undocumented)

sellValues (Pointer/object):

(undocumented)

sellSliceOffsetsType (hipsparseIndexType_t):

(undocumented)

sellColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateSlicedEll(hipsparseSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, int64_t sellValuesSize, int64_t sliceSize, void * sellSliceOffsets, void * sellColInd, void * sellValues, hipsparseIndexType_t sellSliceOffsetsType, hipsparseIndexType_t sellColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstSlicedEll(rows, cols, nnz, sellValuesSize, sliceSize, sellSliceOffsets, sellColInd, sellValues, sellSliceOffsetsType, sellColIndType, idxBase, valueType)#

Create a sparse Sliced ELL matrix descriptor.

hipsparseCreateConstSlicedEll creates a sparse Sliced ELL matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

nnz (int):

(undocumented)

sellValuesSize (int):

(undocumented)

sliceSize (int):

(undocumented)

sellSliceOffsets (Pointer/object):

(undocumented)

sellColInd (Pointer/object):

(undocumented)

sellValues (Pointer/object):

(undocumented)

sellSliceOffsetsType (hipsparseIndexType_t):

(undocumented)

sellColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstSlicedEll(hipsparseConstSpMatDescr_t * spMatDescr, int64_t rows, int64_t cols, int64_t nnz, int64_t sellValuesSize, int64_t sliceSize, const void * sellSliceOffsets, const void * sellColInd, const void * sellValues, hipsparseIndexType_t sellSliceOffsetsType, hipsparseIndexType_t sellColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateBsr(mb, nb, nnzb, rowBlockDim, colBlockDim, bsrRowPtr, bsrColInd, bsrValues, bsrRowPtrType, bsrColIndType, idxBase, valueType, order)#

Create a sparse BSR matrix descriptor.

hipsparseCreateBsr creates a sparse BSR matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

rowBlockDim (int):

(undocumented)

colBlockDim (int):

(undocumented)

bsrRowPtr (Pointer/object):

(undocumented)

bsrColInd (Pointer/object):

(undocumented)

bsrValues (Pointer/object):

(undocumented)

bsrRowPtrType (hipsparseIndexType_t):

(undocumented)

bsrColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

order (hipsparseOrder_t):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateBsr(hipsparseSpMatDescr_t * spMatDescr, int64_t mb, int64_t nb, int64_t nnzb, int64_t rowBlockDim, int64_t colBlockDim, void * bsrRowPtr, void * bsrColInd, void * bsrValues, hipsparseIndexType_t bsrRowPtrType, hipsparseIndexType_t bsrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType, hipsparseOrder_t order)
rocm.bindings.hipsparse.hipsparseCreateConstBsr(mb, nb, nnzb, rowBlockDim, colBlockDim, bsrRowPtr, bsrColInd, bsrValues, bsrRowPtrType, bsrColIndType, idxBase, valueType, order)#

Create a sparse BSR matrix descriptor.

hipsparseCreateConstBsr creates a sparse BSR matrix descriptor. It should be destroyed at the end using hipsparseDestroySpMat.

Args:
mb (int):

(undocumented)

nb (int):

(undocumented)

nnzb (int):

(undocumented)

rowBlockDim (int):

(undocumented)

colBlockDim (int):

(undocumented)

bsrRowPtr (Pointer/object):

(undocumented)

bsrColInd (Pointer/object):

(undocumented)

bsrValues (Pointer/object):

(undocumented)

bsrRowPtrType (hipsparseIndexType_t):

(undocumented)

bsrColIndType (hipsparseIndexType_t):

(undocumented)

idxBase (hipsparseIndexBase_t):

(undocumented)

valueType (hipDataType):

(undocumented)

order (hipsparseOrder_t):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstBsr(hipsparseConstSpMatDescr_t * spMatDescr, int64_t mb, int64_t nb, int64_t nnzb, int64_t rowBlockDim, int64_t colBlockDim, const void * bsrRowPtr, const void * bsrColInd, const void * bsrValues, hipsparseIndexType_t bsrRowPtrType, hipsparseIndexType_t bsrColIndType, hipsparseIndexBase_t idxBase, hipDataType valueType, hipsparseOrder_t order)
rocm.bindings.hipsparse.hipsparseDestroySpMat(spMatDescr)#

Destroy a sparse matrix descriptor.

hipsparseDestroySpMat destroys a sparse matrix descriptor and releases all resources used by the descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroySpMat(hipsparseConstSpMatDescr_t spMatDescr)
rocm.bindings.hipsparse.hipsparseCooGet(spMatDescr, rows, cols, nnz, idxType, idxBase, valueType)#

Get the pointers of a sparse COO matrix.

hipsparseCooGet gets the fields of the sparse COO matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

idxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 4 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCooGet(const hipsparseSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, void ** cooRowInd, void ** cooColInd, void ** cooValues, hipsparseIndexType_t * idxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstCooGet(spMatDescr, rows, cols, nnz, cooRowInd, cooColInd, cooValues, idxType, idxBase, valueType)#

Get the pointers of a sparse COO matrix.

hipsparseConstCooGet gets the fields of the sparse COO matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

cooRowInd (ListOfPointer/object):

(undocumented)

cooColInd (ListOfPointer/object):

(undocumented)

cooValues (ListOfPointer/object):

(undocumented)

idxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstCooGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, const void ** cooRowInd, const void ** cooColInd, const void ** cooValues, hipsparseIndexType_t * idxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseCooAoSGet(spMatDescr, rows, cols, nnz, idxType, idxBase, valueType)#

Get the pointers of a sparse COO (AoS) matrix.

hipsparseCooAoSGet gets the fields of the sparse COO (AoS) matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

idxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 3 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCooAoSGet(const hipsparseSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, void ** cooInd, void ** cooValues, hipsparseIndexType_t * idxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseCsrGet(spMatDescr, rows, cols, nnz, csrRowOffsetsType, csrColIndType, idxBase, valueType)#

Get the pointers of a sparse CSR matrix.

hipsparseCsrGet gets the fields of the sparse CSR matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

csrRowOffsetsType (Pointer/object):

(undocumented)

csrColIndType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 4 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsrGet(const hipsparseSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, void ** csrRowOffsets, void ** csrColInd, void ** csrValues, hipsparseIndexType_t * csrRowOffsetsType, hipsparseIndexType_t * csrColIndType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstCsrGet(spMatDescr, rows, cols, nnz, csrRowOffsets, csrColInd, csrValues, csrRowOffsetsType, csrColIndType, idxBase, valueType)#

Get the pointers of a sparse CSR matrix.

hipsparseConstCsrGet gets the fields of the sparse CSR matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

csrRowOffsets (ListOfPointer/object):

(undocumented)

csrColInd (ListOfPointer/object):

(undocumented)

csrValues (ListOfPointer/object):

(undocumented)

csrRowOffsetsType (Pointer/object):

(undocumented)

csrColIndType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstCsrGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, const void ** csrRowOffsets, const void ** csrColInd, const void ** csrValues, hipsparseIndexType_t * csrRowOffsetsType, hipsparseIndexType_t * csrColIndType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseCscGet(spMatDescr, rows, cols, nnz, cscColOffsetsType, cscRowIndType, idxBase, valueType)#

Get the pointers of a sparse CSC matrix.

hipsparseCscGet gets the fields of the sparse CSC matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

cscColOffsetsType (Pointer/object):

(undocumented)

cscRowIndType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 4 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCscGet(const hipsparseSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, void ** cscColOffsets, void ** cscRowInd, void ** cscValues, hipsparseIndexType_t * cscColOffsetsType, hipsparseIndexType_t * cscRowIndType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstCscGet(spMatDescr, rows, cols, nnz, cscColOffsets, cscRowInd, cscValues, cscColOffsetsType, cscRowIndType, idxBase, valueType)#

Get the pointers of a sparse CSC matrix.

hipsparseConstCscGet gets the fields of the sparse CSC matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

cscColOffsets (ListOfPointer/object):

(undocumented)

cscRowInd (ListOfPointer/object):

(undocumented)

cscValues (ListOfPointer/object):

(undocumented)

cscColOffsetsType (Pointer/object):

(undocumented)

cscRowIndType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstCscGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz, const void ** cscColOffsets, const void ** cscRowInd, const void ** cscValues, hipsparseIndexType_t * cscColOffsetsType, hipsparseIndexType_t * cscRowIndType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseBlockedEllGet(spMatDescr, rows, cols, ellBlockSize, ellCols, ellIdxType, idxBase, valueType)#

Get the pointers of a sparse blocked ELL matrix.

hipsparseBlockedEllGet gets the fields of the sparse blocked ELL matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

ellBlockSize (PointerToInt64/object):

(undocumented)

ellCols (PointerToInt64/object):

(undocumented)

ellIdxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 3 that contains (in that order):

C signature

hipsparseStatus_t hipsparseBlockedEllGet(const hipsparseSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * ellBlockSize, int64_t * ellCols, void ** ellColInd, void ** ellValue, hipsparseIndexType_t * ellIdxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstBlockedEllGet(spMatDescr, rows, cols, ellBlockSize, ellCols, ellColInd, ellValue, ellIdxType, idxBase, valueType)#

Get the pointers of a sparse blocked ELL matrix.

hipsparseConstBlockedEllGet gets the fields of the sparse blocked ELL matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

ellBlockSize (PointerToInt64/object):

(undocumented)

ellCols (PointerToInt64/object):

(undocumented)

ellColInd (ListOfPointer/object):

(undocumented)

ellValue (ListOfPointer/object):

(undocumented)

ellIdxType (Pointer/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstBlockedEllGet(hipsparseConstSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * ellBlockSize, int64_t * ellCols, const void ** ellColInd, const void ** ellValue, hipsparseIndexType_t * ellIdxType, hipsparseIndexBase_t * idxBase, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseCsrSetPointers(spMatDescr, csrRowOffsets, csrColInd, csrValues)#

Set the pointers of a sparse CSR matrix.

hipsparseCsrSetPointers sets the fields of the sparse CSR matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

csrRowOffsets (Pointer/object):

(undocumented)

csrColInd (Pointer/object):

(undocumented)

csrValues (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsrSetPointers(hipsparseSpMatDescr_t spMatDescr, void * csrRowOffsets, void * csrColInd, void * csrValues)
rocm.bindings.hipsparse.hipsparseCscSetPointers(spMatDescr, cscColOffsets, cscRowInd, cscValues)#

Set the pointers of a sparse CSC matrix.

hipsparseCscSetPointers sets the fields of the sparse CSC matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

cscColOffsets (Pointer/object):

(undocumented)

cscRowInd (Pointer/object):

(undocumented)

cscValues (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCscSetPointers(hipsparseSpMatDescr_t spMatDescr, void * cscColOffsets, void * cscRowInd, void * cscValues)
rocm.bindings.hipsparse.hipsparseCooSetPointers(spMatDescr, cooRowInd, cooColInd, cooValues)#

Set the pointers of a sparse COO matrix.

hipsparseCooSetPointers sets the fields of the sparse COO matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

cooRowInd (Pointer/object):

(undocumented)

cooColInd (Pointer/object):

(undocumented)

cooValues (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCooSetPointers(hipsparseSpMatDescr_t spMatDescr, void * cooRowInd, void * cooColInd, void * cooValues)
rocm.bindings.hipsparse.hipsparseBlockedEllSetPointers(spMatDescr, ellColInd, ellValue)#

Set the pointers of a sparse blocked ELL matrix.

hipsparseBlockedEllSetPointers sets the fields of the sparse blocked ELL matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

ellColInd (Pointer/object):

(undocumented)

ellValue (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseBlockedEllSetPointers(hipsparseSpMatDescr_t spMatDescr, void * ellColInd, void * ellValue)
rocm.bindings.hipsparse.hipsparseSpMatGetSize(spMatDescr, rows, cols, nnz)#

Get the sizes of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

nnz (PointerToInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetSize(hipsparseConstSpMatDescr_t spMatDescr, int64_t * rows, int64_t * cols, int64_t * nnz)
rocm.bindings.hipsparse.hipsparseSpMatGetFormat(spMatDescr, format)#

Get the format of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

format (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetFormat(hipsparseConstSpMatDescr_t spMatDescr, hipsparseFormat_t * format)
rocm.bindings.hipsparse.hipsparseSpMatGetIndexBase(spMatDescr, idxBase)#

Get the index base of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

idxBase (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetIndexBase(hipsparseConstSpMatDescr_t spMatDescr, hipsparseIndexBase_t * idxBase)
rocm.bindings.hipsparse.hipsparseSpMatGetValues(spMatDescr)#

Get the pointer of the values array of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetValues(hipsparseSpMatDescr_t spMatDescr, void ** values)
rocm.bindings.hipsparse.hipsparseConstSpMatGetValues(spMatDescr, values)#

Get the pointer of the values array of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstSpMatGetValues(hipsparseConstSpMatDescr_t spMatDescr, const void ** values)
rocm.bindings.hipsparse.hipsparseSpMatSetValues(spMatDescr, values)#

Set the pointer of the values array of a sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

values (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatSetValues(hipsparseSpMatDescr_t spMatDescr, void * values)
rocm.bindings.hipsparse.hipsparseSpMatGetStridedBatch(spMatDescr, batchCount)#

Get the batch count of the sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

batchCount (PointerToInt/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetStridedBatch(hipsparseConstSpMatDescr_t spMatDescr, int * batchCount)
rocm.bindings.hipsparse.hipsparseSpMatSetStridedBatch(spMatDescr, batchCount)#

Set the batch count of the sparse matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

batchCount (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatSetStridedBatch(hipsparseSpMatDescr_t spMatDescr, int batchCount)
rocm.bindings.hipsparse.hipsparseCooSetStridedBatch(spMatDescr, batchCount, batchStride)#

Set the batch count and stride of the sparse COO matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

batchCount (int):

(undocumented)

batchStride (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCooSetStridedBatch(hipsparseSpMatDescr_t spMatDescr, int batchCount, int64_t batchStride)
rocm.bindings.hipsparse.hipsparseCsrSetStridedBatch(spMatDescr, batchCount, offsetsBatchStride, columnsValuesBatchStride)#

Set the batch count and stride of the sparse CSR matrix.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

batchCount (int):

(undocumented)

offsetsBatchStride (int):

(undocumented)

columnsValuesBatchStride (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCsrSetStridedBatch(hipsparseSpMatDescr_t spMatDescr, int batchCount, int64_t offsetsBatchStride, int64_t columnsValuesBatchStride)
rocm.bindings.hipsparse.hipsparseSpMatGetAttribute(spMatDescr, attribute, data, dataSize)#

Get an attribute from a sparse matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

attribute (hipsparseSpMatAttribute_t):

(undocumented)

data (Pointer/object):

(undocumented)

dataSize (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatGetAttribute(hipsparseConstSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, void * data, size_t dataSize)
rocm.bindings.hipsparse.hipsparseSpMatSetAttribute(spMatDescr, attribute, data, dataSize)#

Set an attribute in a sparse matrix descriptor.

Args:
spMatDescr (hipsparseSpMatDescr_st/object):

(undocumented)

attribute (hipsparseSpMatAttribute_t):

(undocumented)

data (Pointer/object):

(undocumented)

dataSize (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMatSetAttribute(hipsparseSpMatDescr_t spMatDescr, hipsparseSpMatAttribute_t attribute, const void * data, size_t dataSize)
rocm.bindings.hipsparse.hipsparseCreateDnVec(size, values, valueType)#

Create a dense vector.

hipsparseCreateDnVec creates a dense vector descriptor. It should be destroyed at the end using hipsparseDestroyDnVec().

Args:
size (int):

(undocumented)

values (Pointer/object):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateDnVec(hipsparseDnVecDescr_t * dnVecDescr, int64_t size, void * values, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseCreateConstDnVec(dnVecDescr, size, values, valueType)#

Create a dense vector.

hipsparseCreateConstDnVec creates a dense vector descriptor. It should be destroyed at the end using hipsparseDestroyDnVec().

Args:
dnVecDescr (ListOfPointer/object):

(undocumented)

size (int):

(undocumented)

values (Pointer/object):

(undocumented)

valueType (hipDataType):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstDnVec(hipsparseConstDnVecDescr_t * dnVecDescr, int64_t size, const void * values, hipDataType valueType)
rocm.bindings.hipsparse.hipsparseDestroyDnVec(dnVecDescr)#

Destroy a dense vector.

hipsparseDestroyDnVec destroys a dense vector descriptor and releases all resources used by the descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyDnVec(hipsparseConstDnVecDescr_t dnVecDescr)
rocm.bindings.hipsparse.hipsparseDnVecGet(dnVecDescr, size, valueType)#

Get the fields from a dense vector.

hipsparseDnVecGet gets the fields of the dense vector descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

size (PointerToInt64/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnVecGet(const hipsparseDnVecDescr_t dnVecDescr, int64_t * size, void ** values, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseConstDnVecGet(dnVecDescr, size, values, valueType)#

Get the fields from a dense vector.

hipsparseConstDnVecGet gets the fields of the dense vector descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

size (PointerToInt64/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstDnVecGet(hipsparseConstDnVecDescr_t dnVecDescr, int64_t * size, const void ** values, hipDataType * valueType)
rocm.bindings.hipsparse.hipsparseDnVecGetValues(dnVecDescr)#

Get the value pointer from a dense vector.

hipsparseDnVecGetValues gets the fields of the dense vector descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnVecGetValues(const hipsparseDnVecDescr_t dnVecDescr, void ** values)
rocm.bindings.hipsparse.hipsparseConstDnVecGetValues(dnVecDescr, values)#

Get the value pointer from a dense vector.

hipsparseConstDnVecGetValues gets the fields of the dense vector descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstDnVecGetValues(hipsparseConstDnVecDescr_t dnVecDescr, const void ** values)
rocm.bindings.hipsparse.hipsparseDnVecSetValues(dnVecDescr, values)#

Set the value pointer of a dense vector.

hipsparseDnVecSetValues sets the fields of the dense vector descriptor.

Args:
dnVecDescr (Pointer/object):

(undocumented)

values (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnVecSetValues(hipsparseDnVecDescr_t dnVecDescr, void * values)
rocm.bindings.hipsparse.hipsparseCreateDnMat(rows, cols, ld, values, valueType, order)#

Create a dense matrix.

hipsparseCreateDnMat creates a dense matrix descriptor. It should be destroyed at the end using hipsparseDestroyDnMat().

Args:
rows (int):

(undocumented)

cols (int):

(undocumented)

ld (int):

(undocumented)

values (Pointer/object):

(undocumented)

valueType (hipDataType):

(undocumented)

order (hipsparseOrder_t):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateDnMat(hipsparseDnMatDescr_t * dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void * values, hipDataType valueType, hipsparseOrder_t order)
rocm.bindings.hipsparse.hipsparseCreateConstDnMat(dnMatDescr, rows, cols, ld, values, valueType, order)#

Create a dense matrix.

hipsparseCreateConstDnMat creates a dense matrix descriptor. It should be destroyed at the end using hipsparseDestroyDnMat().

Args:
dnMatDescr (ListOfPointer/object):

(undocumented)

rows (int):

(undocumented)

cols (int):

(undocumented)

ld (int):

(undocumented)

values (Pointer/object):

(undocumented)

valueType (hipDataType):

(undocumented)

order (hipsparseOrder_t):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseCreateConstDnMat(hipsparseConstDnMatDescr_t * dnMatDescr, int64_t rows, int64_t cols, int64_t ld, const void * values, hipDataType valueType, hipsparseOrder_t order)
rocm.bindings.hipsparse.hipsparseDestroyDnMat(dnMatDescr)#

Destroy a dense matrix.

hipsparseDestroyDnMat destroys a dense matrix descriptor and releases all resources used by the descriptor.

Args:
dnMatDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDestroyDnMat(hipsparseConstDnMatDescr_t dnMatDescr)
rocm.bindings.hipsparse.hipsparseDnMatGet(dnMatDescr, rows, cols, ld, valueType, order)#

Get fields from a dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

ld (PointerToInt64/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

order (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnMatGet(const hipsparseDnMatDescr_t dnMatDescr, int64_t * rows, int64_t * cols, int64_t * ld, void ** values, hipDataType * valueType, hipsparseOrder_t * order)
rocm.bindings.hipsparse.hipsparseConstDnMatGet(dnMatDescr, rows, cols, ld, values, valueType, order)#

Get fields from a dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

rows (PointerToInt64/object):

(undocumented)

cols (PointerToInt64/object):

(undocumented)

ld (PointerToInt64/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

valueType (Pointer/object):

(undocumented)

order (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstDnMatGet(hipsparseConstDnMatDescr_t dnMatDescr, int64_t * rows, int64_t * cols, int64_t * ld, const void ** values, hipDataType * valueType, hipsparseOrder_t * order)
rocm.bindings.hipsparse.hipsparseDnMatGetValues(dnMatDescr)#

Get the value pointer from a dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnMatGetValues(const hipsparseDnMatDescr_t dnMatDescr, void ** values)
rocm.bindings.hipsparse.hipsparseConstDnMatGetValues(dnMatDescr, values)#

Get the value pointer from a dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

values (ListOfPointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseConstDnMatGetValues(hipsparseConstDnMatDescr_t dnMatDescr, const void ** values)
rocm.bindings.hipsparse.hipsparseDnMatSetValues(dnMatDescr, values)#

Set the value pointer of a dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

values (Pointer/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnMatSetValues(hipsparseDnMatDescr_t dnMatDescr, void * values)
rocm.bindings.hipsparse.hipsparseDnMatGetStridedBatch(dnMatDescr, batchCount, batchStride)#

Get the batch count and batch stride of the dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

batchCount (PointerToInt/object):

(undocumented)

batchStride (PointerToInt64/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseConstDnMatDescr_t dnMatDescr, int * batchCount, int64_t * batchStride)
rocm.bindings.hipsparse.hipsparseDnMatSetStridedBatch(dnMatDescr, batchCount, batchStride)#

Set the batch count and batch stride of the dense matrix.

Args:
dnMatDescr (Pointer/object):

(undocumented)

batchCount (int):

(undocumented)

batchStride (int):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDnMatSetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride)
rocm.bindings.hipsparse.hipsparseAxpby(handle, alpha, vecX, beta, vecY)#

Scale a sparse vector and add it to a scaled dense vector.

hipsparseAxpby multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\) that is multiplied with scalar \(\beta\), such that

\[y := \alpha \cdot x + \beta \cdot y\]
for(i = 0; i < size; ++i)
{
    y[i] = beta * y[i]
}
for(i = 0; i < nnz; ++i)
{
    y[xInd[i]] += alpha * xVal[i]
}
Par:

<table> <caption id=”axpby_uniform”>Uniform Precisions</caption> <tr><th>X / Y / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Par:

<table> <caption id=”axpby_mixed”>Mixed Precisions</caption> <tr><th>X / Y <th>compute_type <tr><td>HIP_R_16F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_32F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

vecX (Pointer/object) – IN:

sparse vector descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

vecY (Pointer/object) – INOUT:

dense vector descriptor.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseAxpby(hipsparseHandle_t handle, const void * alpha, hipsparseConstSpVecDescr_t vecX, const void * beta, hipsparseDnVecDescr_t vecY)
rocm.bindings.hipsparse.hipsparseDenseToSparse_bufferSize(handle, matA, matB, alg, pBufferSizeInBytes)#

hipsparseDenseToSparse_bufferSize computes the required user-allocated buffer size needed when converting a dense matrix to a sparse matrix.

This routine currently accepts the sparse matrix descriptor matB in CSR, CSC, or COO format. This routine is used to determine the size of the buffer needed in hipsparseDenseToSparse_analysis and hipsparseDenseToSparse_convert .

hipsparseDenseToSparse_bufferSize supports different data types for the dense and sparse matrices. See hipsparseDenseToSparse_convert for a complete listing of all the data types available.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

matA (Pointer/object) – IN:

dense matrix descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

alg (hipsparseDenseToSparseAlg_t) – IN:

algorithm for the dense to sparse computation.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDenseToSparse_bufferSize(hipsparseHandle_t handle, hipsparseConstDnMatDescr_t matA, hipsparseSpMatDescr_t matB, hipsparseDenseToSparseAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseDenseToSparse_analysis(handle, matA, matB, alg, externalBuffer)#

hipsparseDenseToSparse_analysis performs analysis that is later used in hipsparseDenseToSparse_convert when converting a dense matrix to sparse matrix.

This routine currently accepts the sparse matrix descriptor matB in CSR, CSC, or COO format. This routine takes a user-allocated buffer with a size that must first be computed using hipsparseDenseToSparse_bufferSize .

hipsparseDenseToSparse_analysis supports different data types for the dense and sparse matrices. See hipsparseDenseToSparse_convert for a complete listing of all the data types available.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

matA (Pointer/object) – IN:

dense matrix descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

alg (hipsparseDenseToSparseAlg_t) – IN:

algorithm for the dense to sparse computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDenseToSparse_analysis(hipsparseHandle_t handle, hipsparseConstDnMatDescr_t matA, hipsparseSpMatDescr_t matB, hipsparseDenseToSparseAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseDenseToSparse_convert(handle, matA, matB, alg, externalBuffer)#

Dense matrix to sparse matrix conversion.

hipsparseDenseToSparse_convert converts a dense matrix to a sparse matrix. This routine currently accepts the sparse matrix descriptor matB in CSR, CSC, or COO format. This routine requires a user-allocated buffer with a size that must first be determined by calling hipsparseDenseToSparse_bufferSize .

The conversion of a dense matrix into a sparse one involves three steps. First, the user creates the dense and sparse matrix descriptors. Because the number of non-zeros that will exist in the sparse matrix is not known beforehand, when creating the sparse matrix descriptor, the user simply sets the arrays to NULL and the non-zero count to zero. For example, in the case of a CSR sparse matrix, this would look like:

hipsparseCreateCsr(&matB,
                   m,
                   n,
                   0,
                   dcsrRowPtrB, // This array can be allocated as its size (i.e. m + 1) is known
                   NULL,        // Column indices array size is not yet known, pass NULL for now
                   NULL,        // Values array size is not yet known, pass NULL for now
                   rowIdxTypeB,
                   colIdxTypeB,
                   idxBaseB,
                   dataTypeB);

In the case of a COO sparse matrix, this would look like:

hipsparseCreateCoo(&matB,
                   m,
                   n,
                   0,
                   NULL,  // Row indices array size is not yet known, pass NULL for now
                   NULL,  // Column indices array size is not yet known, pass NULL for now
                   NULL,  // Values array size is not yet known, pass NULL for now
                   rowIdxTypeB,
                   colIdxTypeB,
                   idxBaseB,
                   dataTypeB);

After the descriptors have been created, the user calls hipsparseDenseToSparse_bufferSize . This routine will determine the size of the required temporary storage buffer. The user then allocates this buffer and passes it to hipsparseDenseToSparse_analysis , which will perform analysis on the dense matrix to determine the number of non-zeros that will exist in the sparse matrix. After the hipsparseDenseToSparse_analysis routine has been called, the non-zero count is stored in the sparse matrix descriptor matB. To allocate the remaining sparse matrix arrays, query the sparse matrix descriptor matB for this non-zero count:

// Grab the non-zero count from the B matrix decriptor
int64_t rows;
int64_t cols;
int64_t nnz;
hipsparseSpMatGetSize(matB, &rows, &cols, &nnz);
Par:

<table> <caption id=”dense2sparse_uniform”>Uniform Precisions</caption> <tr><th>A / B <tr><td>HIP_R_16F <tr><td>HIP_R_16BF <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Note:

Currently only the sparse matrix formats CSR, CSC, and COO are supported when converting a dense matrix to a sparse matrix.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

matA (Pointer/object) – IN:

dense matrix descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

alg (hipsparseDenseToSparseAlg_t) – IN:

algorithm for the dense to sparse computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseDenseToSparse_convert(hipsparseHandle_t handle, hipsparseConstDnMatDescr_t matA, hipsparseSpMatDescr_t matB, hipsparseDenseToSparseAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseGather(handle, vecY, vecX)#

Gather elements from a dense vector and store them in a sparse vector.

hipsparseGather gathers the elements from the dense vector \(y\) and stores them in the sparse vector \(x\).

for(i = 0; i < nnz; ++i)
{
    x_val[i] = y[x_ind[i]];
}
Par:

<table> <caption id=”gather_uniform”>Uniform Precisions</caption> <tr><th>X / Y <tr><td>HIP_R_8I <tr><td>HIP_R_16F <tr><td>HIP_R_16BF <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

vecY (Pointer/object) – IN:

dense vector descriptor \(y\).

vecX (Pointer/object) – OUT:

sparse vector descriptor \(x\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseGather(hipsparseHandle_t handle, hipsparseConstDnVecDescr_t vecY, hipsparseSpVecDescr_t vecX)
rocm.bindings.hipsparse.hipsparseRot(handle, c_coeff, s_coeff, vecX, vecY)#

Apply the Givens rotation to a dense and a sparse vector.

hipsparseRot applies the Givens rotation matrix \(G\) to the sparse vector \(x\) and the dense vector \(y\), where

\[\begin{split}G = \begin{pmatrix} c & s \\ -s & c \end{pmatrix}\end{split}\]
for(i = 0; i < nnz; ++i)
{
    x_tmp = x_val[i];
    y_tmp = y[x_ind[i]];

    x_val[i]    = c * x_tmp + s * y_tmp;
    y[x_ind[i]] = c * y_tmp - s * x_tmp;
}
Par:

<table> <caption id=”rot_uniform”>Uniform Precisions</caption> <tr><th>X / Y / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Deprecated:

This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

c_coeff (Pointer/object) – IN:

pointer to the cosine element of \(G\), which can be on the host or device.

s_coeff (Pointer/object) – IN:

pointer to the sine element of \(G\), which can be on the host or device.

vecX (Pointer/object) – INOUT:

sparse vector descriptor \(x\).

vecY (Pointer/object) – INOUT:

dense vector descriptor \(y\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseRot(hipsparseHandle_t handle, const void * c_coeff, const void * s_coeff, hipsparseSpVecDescr_t vecX, hipsparseDnVecDescr_t vecY)
rocm.bindings.hipsparse.hipsparseScatter(handle, vecX, vecY)#

Scatter elements from a sparse vector into a dense vector.

hipsparseScatter scatters the elements from the sparse vector \(x\) into the dense vector \(y\).

for(i = 0; i < nnz; ++i)
{
    y[x_ind[i]] = x_val[i];
}
Par:

<table> <caption id=”scatter_uniform”>Uniform Precisions</caption> <tr><th>X / Y <tr><td>HIP_R_8I <tr><td>HIP_R_16F <tr><td>HIP_R_16BF <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

vecX (Pointer/object) – IN:

sparse vector descriptor \(x\).

vecY (Pointer/object) – OUT:

dense vector descriptor \(y\).

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseScatter(hipsparseHandle_t handle, hipsparseConstSpVecDescr_t vecX, hipsparseDnVecDescr_t vecY)
rocm.bindings.hipsparse.hipsparseSDDMM_bufferSize(handle, opA, opB, alpha, A, B, beta, C, computeType, alg, pBufferSizeInBytes)#

hipsparseSDDMM_bufferSize returns the size of the buffer required when computing the sampled dense-dense matrix multiplication:

hipsparseSDDMM_bufferSize returns the size of the buffer required when computing the sampled dense-dense matrix multiplication:

\[C := \alpha (op(A) \cdot op(B)) \circ spy(C) + \beta \cdot C,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

dense matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

dense matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

dense matrix \(A\) descriptor.

B (Pointer/object) – IN:

dense matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (hipsparseSpMatDescr_st/object) – INOUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SDDMM computation.

alg (hipsparseSDDMMAlg_t) – IN:

specification of the algorithm to use.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSDDMM_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstDnMatDescr_t A, hipsparseConstDnMatDescr_t B, const void * beta, hipsparseSpMatDescr_t C, hipDataType computeType, hipsparseSDDMMAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSDDMM_preprocess(handle, opA, opB, alpha, A, B, beta, C, computeType, alg, tempBuffer)#

hipsparseSDDMM_preprocess performs the required preprocessing used when computing the sampled dense dense matrix multiplication:

hipsparseSDDMM_preprocess performs the required preprocessing used when computing the sampled dense dense matrix multiplication:

\[C := \alpha (op(A) \cdot op(B)) \circ spy(C) + \beta \cdot C,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

dense matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

dense matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

dense matrix \(A\) descriptor.

B (Pointer/object) – IN:

dense matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (hipsparseSpMatDescr_st/object) – INOUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SDDMM computation.

alg (hipsparseSDDMMAlg_t) – IN:

specification of the algorithm to use.

tempBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size must be greater or equal to the size obtained with hipsparseSDDMM_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSDDMM_preprocess(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstDnMatDescr_t A, hipsparseConstDnMatDescr_t B, const void * beta, hipsparseSpMatDescr_t C, hipDataType computeType, hipsparseSDDMMAlg_t alg, void * tempBuffer)
rocm.bindings.hipsparse.hipsparseSDDMM(handle, opA, opB, alpha, A, B, beta, C, computeType, alg, tempBuffer)#

Sampled dense-dense matrix multiplication.

hipsparseSDDMM multiplies the scalar \(\alpha\) with the dense \(m \times k\) matrix \(op(A)\), the dense \(k \times n\) matrix \(op(B)\), filtered by the sparsity pattern of the \(m \times n\) sparse matrix \(C\), and adds the result to \(C\) scaled by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), such that

\[C := \alpha ( op(A) \cdot op(B) ) \circ spy(C) + \beta C,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if op(A) == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if op(A) == HIPSPARSE_OPERATION_TRANSPOSE} \\ \end{array} \right.\end{split}\]

,

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if op(B) == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if op(B) == HIPSPARSE_OPERATION_TRANSPOSE} \\ \end{array} \right.\end{split}\]

and

\[\begin{split}spy(C)_{ij} = \left* \begin{array}{ll} 1, & \text{ if C_{ij} != 0} \\ 0, & \text{ otherwise} \\ \end{array} \right.\end{split}\]
Par:

<table> <caption id=”sddmm_uniform”>Uniform Precisions</caption> <tr><th>A / B / C / compute_type <tr><td>HIP_R_16F <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Par:

<table> <caption id=”sddmm_mixed”>Mixed Precisions</caption> <tr><th>A / B <th>C <th>compute_type <tr><td>HIP_R_16F <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_16F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_16BF <td>HIP_R_32F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

dense matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

dense matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

A (Pointer/object) – IN:

dense matrix \(A\) descriptor.

B (Pointer/object) – IN:

dense matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

C (hipsparseSpMatDescr_st/object) – INOUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SDDMM computation.

alg (hipsparseSDDMMAlg_t) – IN:

specification of the algorithm to use.

tempBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user. The size must be greater or equal to the size obtained with hipsparseSDDMM_bufferSize .

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSDDMM(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstDnMatDescr_t A, hipsparseConstDnMatDescr_t B, const void * beta, hipsparseSpMatDescr_t C, hipDataType computeType, hipsparseSDDMMAlg_t alg, void * tempBuffer)
rocm.bindings.hipsparse.hipsparseSparseToDense_bufferSize(handle, matA, matB, alg, pBufferSizeInBytes)#

hipsparseSparseToDense_bufferSize computes the required user-allocated buffer size needed when converting a sparse matrix to a dense matrix.

This routine currently accepts the sparse matrix descriptor matA in CSR, CSC, or COO format. This routine is used to determine the size of the buffer needed in hipsparseSparseToDense .

hipsparseSparseToDense_bufferSize supports different data types for the sparse and dense matrices. See hipsparseSparseToDense for a complete listing of all the data types available.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

alg (hipsparseSparseToDenseAlg_t) – IN:

algorithm for the sparse to dense computation.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSparseToDense_bufferSize(hipsparseHandle_t handle, hipsparseConstSpMatDescr_t matA, hipsparseDnMatDescr_t matB, hipsparseSparseToDenseAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSparseToDense(handle, matA, matB, alg, externalBuffer)#

Sparse matrix to dense matrix conversion

hipsparseSparseToDense converts a sparse matrix to a dense matrix. This routine accepts the sparse matrix descriptor matA in CSR, CSC, or COO format. It takes a user-allocated buffer with a size that must first be computed by calling hipsparseSparseToDense_bufferSize .

The conversion of a sparse matrix into a dense one involves two steps. First, the user creates the sparse and dense matrix descriptors and calls hipsparseSparseToDense_bufferSize to determine the size of the required temporary storage buffer. The user then allocates this buffer and passes it to hipsparseSparseToDense to complete the conversion. After the conversion is complete, the user is free to deallocate the storage buffer. See the full example below for details.

hipsparseSparseToDense supports the following uniform precision data types for the sparse and dense matrices \(A\) and \(B\):

Par:

<table> <caption id=”sparse2dense_uniform”>Uniform Precisions</caption> <tr><th>A / B <tr><td>HIP_R_16F <tr><td>HIP_R_16BF <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Note:

Currently only the sparse matrix formats CSR, CSC, and COO are supported when converting a sparse matrix to a dense matrix.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

alg (hipsparseSparseToDenseAlg_t) – IN:

algorithm for the sparse to dense computation.

externalBuffer (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSparseToDense(hipsparseHandle_t handle, hipsparseConstSpMatDescr_t matA, hipsparseDnMatDescr_t matB, hipsparseSparseToDenseAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpGEMM_createDescr()#

hipsparseSpGEMM_createDescr creates a sparse matrix sparse matrix product descriptor.

It should be destroyed at the end using hipsparseSpGEMM_destroyDescr ().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMM_createDescr(hipsparseSpGEMMDescr_t * descr)
rocm.bindings.hipsparse.hipsparseSpGEMM_destroyDescr(descr)#

hipsparseSpGEMM_destroyDescr destroys a sparse matrix sparse matrix product descriptor and releases all resources used by the descriptor.

Args:
descr (hipsparseSpGEMMDescr/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMM_destroyDescr(hipsparseSpGEMMDescr_t descr)
rocm.bindings.hipsparse.hipsparseSpGEMM_workEstimation(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, spgemmDescr, bufferSize1, externalBuffer1)#

Work estimation step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

hipsparseSpGEMM_workEstimation is called twice. First, call it to compute the size of the first required user-allocated buffer. After this buffer size is determined, allocate the buffer and call hipsparseSpGEMM_workEstimation a second time with the newly allocated buffer passed in. This second call inspects the matrices \(A\) and \(B\) to determine the number of intermediate products that will result from multiplying \(A\) and \(B\) together.

hipsparseSpGEMM_workEstimation supports multiple combinations of data types and compute types. See hipsparseSpGEMM_copy for a complete listing of all the data type and compute type combinations available.

Par:

void*  dBuffer1  = NULL;
size_t bufferSize1 = 0;

hipsparseSpGEMMDescr_t spgemmDesc;
hipsparseSpGEMM_createDescr(&spgemmDesc);

size_t bufferSize1 = 0;
hipsparseSpGEMM_workEstimation(handle, opA, opB,
                              &alpha, matA, matB, &beta, matC,
                              computeType, HIPSPARSE_SPGEMM_DEFAULT,
                              spgemmDesc, &bufferSize1, NULL);
hipMalloc((void**) &dBuffer1, bufferSize1);

// Determine number of intermediate product when computing A * B
hipsparseSpGEMM_workEstimation(handle, opA, opB,
                                &alpha, matA, matB, &beta, matC,
                                computeType, HIPSPARSE_SPGEMM_DEFAULT,
                                spgemmDesc, &bufferSize1, dBuffer1);
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpGEMM computation.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

bufferSize1 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

externalBuffer1 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMM_workEstimation(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, const void * beta, hipsparseSpMatDescr_t matC, hipDataType computeType, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr, size_t * bufferSize1, void * externalBuffer1)
rocm.bindings.hipsparse.hipsparseSpGEMM_compute(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, spgemmDescr, bufferSize2, externalBuffer2)#

Compute step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

hipsparseSpGEMM_compute is called twice, first to compute the size of the second required user-allocated buffer. After this buffer size is determined, the user allocates it and calls hipsparseSpGEMM_compute a second time with the newly allocated buffer passed in. This second call performs the actual computation of \(C' = \alpha \cdot A \cdot B\) (the result is stored in the temporary buffers).

hipsparseSpGEMM_compute supports multiple combinations of data types and compute types. See hipsparseSpGEMM_copy for a complete listing of all the data type and compute type combinations available.

Par:

void*  dBuffer2  = NULL;
size_t bufferSize2 = 0;

size_t bufferSize2 = 0;
hipsparseSpGEMM_compute(handle, opA, opB,
                        &alpha, matA, matB, &beta, matC,
                        computeType, HIPSPARSE_SPGEMM_DEFAULT,
                        spgemmDesc, &bufferSize2, NULL);
hipMalloc((void**) &dBuffer2, bufferSize2);

// compute the intermediate product of A * B
hipsparseSpGEMM_compute(handle, opA, opB,
                        &alpha, matA, matB, &beta, matC,
                        computeType, HIPSPARSE_SPGEMM_DEFAULT,
                        spgemmDesc, &bufferSize2, dBuffer2);
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpGEMM computation.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

bufferSize2 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

externalBuffer2 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMM_compute(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, const void * beta, hipsparseSpMatDescr_t matC, hipDataType computeType, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr, size_t * bufferSize2, void * externalBuffer2)
rocm.bindings.hipsparse.hipsparseSpGEMM_copy(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, spgemmDescr)#

Copy step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

hipsparseSpGEMM_copy is called once to copy the results (that are currently stored in the temporary arrays) to the output sparse matrix. If \(\beta != 0\), then the \(beta \cdot C\) portion of the computation: \(C' = \alpha \cdot A \cdot B + \beta * C\) is handled. This is possible because \(C'\) and \(C\) must have the same sparsity pattern.

hipsparseSpGEMM_copy supports multiple combinations of data types and compute types. The tables below indicate the currently supported different data types that can be used for the sparse matrices \(op(A)\), \(op(B)\), \(C\), and \(C'\) and the compute type for \(\alpha\) and \(\beta\). The advantage of using different data types is to save on memory bandwidth and storage when a user application supports it, while performing the actual computation in a higher precision.

Par:

<table> <caption id=”spgemm_copy_uniform”>Uniform Precisions</caption> <tr><th>A / B / C / C’ / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

hipsparseSpGEMM_copy supports HIPSPARSE_INDEX_32I and HIPSPARSE_INDEX_64I index precisions for storing the row pointer and row/column indices arrays of the sparse matrices.

Note:

The two user allocated temporary buffers can only be freed after the call to hipsparseSpGEMM_copy

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpGEMM computation.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMM_copy(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, const void * beta, hipsparseSpMatDescr_t matC, hipDataType computeType, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr)
rocm.bindings.hipsparse.hipsparseSpGEMMreuse_workEstimation(handle, opA, opB, matA, matB, matC, alg, spgemmDescr, bufferSize1, externalBuffer1)#

Work estimation step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

hipsparseSpGEMMreuse_workEstimation is called twice. First, call it to compute the size of the first required user-allocated buffer. After the buffer size is determined, allocate it and call hipsparseSpGEMMreuse_workEstimation a second time with the newly allocated buffer passed in. This second call inspects the matrices \(A\) and \(B\) to determine the number of intermediate products that will result from multiplying \(A\) and \(B\) together.

Par:

void*  dBuffer1  = NULL;
size_t bufferSize1 = 0;

hipsparseSpGEMMDescr_t spgemmDesc;
hipsparseSpGEMM_createDescr(&spgemmDesc);

size_t bufferSize1 = 0;
hipsparseSpGEMMreuse_workEstimation(handle, opA, opB, matA, matB, matC,
                                    HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                                    &bufferSize1, NULL);
hipMalloc((void**) &dBuffer1, bufferSize1);

// Determine number of intermediate product when computing A * B
hipsparseSpGEMMreuse_workEstimation(handle, opA, opB, matA, matB, matC,
                                    HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                                    &bufferSize1, dBuffer1);
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

bufferSize1 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

externalBuffer1 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMMreuse_workEstimation(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, hipsparseSpMatDescr_t matC, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr, size_t * bufferSize1, void * externalBuffer1)
rocm.bindings.hipsparse.hipsparseSpGEMMreuse_nnz(handle, opA, opB, matA, matB, matC, alg, spgemmDescr, bufferSize2, externalBuffer2, bufferSize3, externalBuffer3, bufferSize4, externalBuffer4)#

Nnz calculation step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

Par:

// Determine size of second, third, and fourth user allocated buffer
hipsparseSpGEMMreuse_nnz(handle, opA, opB, matA, matB,
                            matC, HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                            &bufferSize2, NULL, &bufferSize3, NULL,
                            &bufferSize4, NULL);

hipMalloc((void**) &dBuffer2, bufferSize2);
hipMalloc((void**) &dBuffer3, bufferSize3);
hipMalloc((void**) &dBuffer4, bufferSize4);

// COmpute sparsity pattern of C matrix and store in temporary buffers
hipsparseSpGEMMreuse_nnz(handle, opA, opB, matA, matB,
                            matC, HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                            &bufferSize2, dBuffer2, &bufferSize3, dBuffer3,
                            &bufferSize4, dBuffer4);

// We can now free buffer 1 and 2
hipFree(dBuffer1);
hipFree(dBuffer2);
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

bufferSize2 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage externalBuffer2.

externalBuffer2 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

bufferSize3 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage externalBuffer3.

externalBuffer3 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

bufferSize4 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage externalBuffer4.

externalBuffer4 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMMreuse_nnz(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, hipsparseSpMatDescr_t matC, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr, size_t * bufferSize2, void * externalBuffer2, size_t * bufferSize3, void * externalBuffer3, size_t * bufferSize4, void * externalBuffer4)
rocm.bindings.hipsparse.hipsparseSpGEMMreuse_copy(handle, opA, opB, matA, matB, matC, alg, spgemmDescr, bufferSize5, externalBuffer5)#

Copy step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

Par:

// Get matrix C non-zero entries nnzC
int64_t rowsC, colsC, nnzC;
hipsparseSpMatGetSize(matC, &rowsC, &colsC, &nnzC);

// Allocate matrix C
hipMalloc((void**) &dcsrColIndC, sizeof(int) * nnzC);
hipMalloc((void**) &dcsrValC,  sizeof(float) * nnzC);

// Update matC with the new pointers. The C values array can be filled with data here
// which is used if beta != 0.
hipsparseCsrSetPointers(matC, dcsrRowPtrC, dcsrColIndC, dcsrValC);

// Determine size of fifth user allocated buffer
hipsparseSpGEMMreuse_copy(handle, opA, opB, matA, matB, matC,
                             HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                             &bufferSize5, NULL);

hipMalloc((void**) &dBuffer5, bufferSize5);

// Copy data from temporary buffers to the newly allocated C matrix
hipsparseSpGEMMreuse_copy(handle, opA, opB, matA, matB, matC,
                             HIPSPARSE_SPGEMM_DEFAULT, spgemmDesc,
                             &bufferSize5, dBuffer5);

// We can now free buffer 3
hipFree(dBuffer3);
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

bufferSize5 (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage externalBuffer5.

externalBuffer5 (Pointer/object) – IN:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMMreuse_copy(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, hipsparseSpMatDescr_t matC, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr, size_t * bufferSize5, void * externalBuffer5)
rocm.bindings.hipsparse.hipsparseSpGEMMreuse_compute(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, spgemmDescr)#

Copy step of the sparse matrix sparse matrix product:

\[C' := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

sparse matrix \(A\) operation type.

opB (hipsparseOperation_t) – IN:

sparse matrix \(B\) operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(A\) descriptor.

matB (hipsparseSpMatDescr_st/object) – IN:

sparse matrix \(B\) descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (hipsparseSpMatDescr_st/object) – OUT:

sparse matrix \(C\) descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpGEMM computation.

alg (hipsparseSpGEMMAlg_t) – IN:

SpGEMM algorithm for the SpGEMM computation.

spgemmDescr (hipsparseSpGEMMDescr/object) – IN:

SpGEMM descriptor.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpGEMMreuse_compute(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstSpMatDescr_t matB, const void * beta, hipsparseSpMatDescr_t matC, hipDataType computeType, hipsparseSpGEMMAlg_t alg, hipsparseSpGEMMDescr_t spgemmDescr)
rocm.bindings.hipsparse.hipsparseSpMM_bufferSize(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, pBufferSizeInBytes)#

hipsparseSpMM_bufferSize computes the required user-allocated buffer size needed when computing the sparse matrix multiplication with a dense matrix:

hipsparseSpMM_bufferSize computes the required user-allocated buffer size needed when computing the sparse matrix multiplication with a dense matrix:

\[C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

opB (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (Pointer/object) – IN:

dense matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpMM computation.

alg (hipsparseSpMMAlg_t) – IN:

SpMM algorithm for the SpMM computation.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMM_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const void * beta, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpMMAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpMM_preprocess(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, externalBuffer)#

hipsparseSpMM_preprocess performs the required preprocessing used when computing the sparse matrix multiplication with a dense matrix:

hipsparseSpMM_preprocess performs the required preprocessing used when computing the sparse matrix multiplication with a dense matrix:

\[C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

opB (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

matB (Pointer/object) – IN:

matrix descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (Pointer/object) – IN:

matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpMM computation.

alg (hipsparseSpMMAlg_t) – IN:

SpMM algorithm for the SpMM computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMM_preprocess(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const void * beta, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpMMAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpMM(handle, opA, opB, alpha, matA, matB, beta, matC, computeType, alg, externalBuffer)#

Compute the sparse matrix multiplication with a dense matrix.

hipsparseSpMM multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(op(A)\), defined in CSR, CSC, COO, BSR, or Blocked ELL storage format, and the dense \(k \times n\) matrix \(op(B)\) and adds the result to the dense \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if trans_A == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans_A == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans_A == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if trans_B == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if trans_B == HIPSPARSE_OPERATION_TRANSPOSE} \\ B^H, & \text{if trans_B == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
Par:

<table> <caption id=”spmm_uniform”>Uniform Precisions</caption> <tr><th>A / B / C / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Par:

<table> <caption id=”spmm_mixed”>Mixed Precisions</caption> <tr><th>A / B <th>C <th>compute_type <tr><td>HIP_R_8I <td>HIP_R_32I <td>HIP_R_32I <tr><td>HIP_R_8I <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_16F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_16BF <td>HIP_R_32F </table>

hipsparseSpMM supports HIPSPARSE_INDEX_32I and HIPSPARSE_INDEX_64I index precisions for storing the row pointer and column indices arrays of the sparse matrices.

hipsparseSpMM also supports batched computation for CSR, CSC, COO and Blocked ELL matrices. There are three supported batch modes:

\[\begin{split}C_i = A \times B_i \\ C_i = A_i \times B \\ C_i = A_i \times B_i\end{split}\]

The batch mode is determined by the batch count and stride passed for each matrix. For example, to use the first batch mode (\(C_i = A \times B_i\)) with 100 batches for non-transposed \(A\), \(B\), and \(C\), pass the following:

\[\begin{split}batchCountA=1 \\ batchCountB=100 \\ batchCountC=100 \\ offsetsBatchStrideA=0 \\ columnsValuesBatchStrideA=0 \\ batchStrideB=k*n \\ batchStrideC=m*n\end{split}\]

To use the second batch mode (\(C_i = A_i \times B\)), use these settings:

\[\begin{split}batchCountA=100 \\ batchCountB=1 \\ batchCountC=100 \\ offsetsBatchStrideA=m+1 \\ columnsValuesBatchStrideA=nnz \\ batchStrideB=0 \\ batchStrideC=m*n\end{split}\]

And to use the third batch mode (\(C_i = A_i \times B_i\)), pass these values:

\[\begin{split}batchCountA=100 \\ batchCountB=100 \\ batchCountC=100 \\ offsetsBatchStrideA=m+1 \\ columnsValuesBatchStrideA=nnz \\ batchStrideB=k*n \\ batchStrideC=m*n\end{split}\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

opB (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

matB (Pointer/object) – IN:

matrix descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

matC (Pointer/object) – IN:

matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpMM computation.

alg (hipsparseSpMMAlg_t) – IN:

SpMM algorithm for the SpMM computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMM(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const void * beta, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpMMAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpMV_bufferSize(handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg, pBufferSizeInBytes)#

hipsparseSpMV_bufferSize computes the user-allocated buffer size required when computing the sparse matrix multiplication with a dense vector:

hipsparseSpMV_bufferSize computes the user-allocated buffer size required when computing the sparse matrix multiplication with a dense vector:

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

vecX (Pointer/object) – IN:

dense vector descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

vecY (Pointer/object) – INOUT:

dense vector descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpMV computation.

alg (hipsparseSpMVAlg_t) – IN:

SpMV algorithm for the SpMV computation.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMV_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t vecX, const void * beta, const hipsparseDnVecDescr_t vecY, hipDataType computeType, hipsparseSpMVAlg_t alg, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpMV_preprocess(handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg, externalBuffer)#

hipsparseSpMV_preprocess performs analysis on the sparse matrix \(op(A)\) when computing the sparse matrix multiplication with a dense vector:

hipsparseSpMV_preprocess performs analysis on the sparse matrix \(op(A)\) when computing the sparse matrix multiplication with a dense vector:

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

vecX (Pointer/object) – IN:

vector descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

vecY (Pointer/object) – INOUT:

vector descriptor.

computeType (hipDataType) – IN:

floating-point precision for the SpMV computation.

alg (hipsparseSpMVAlg_t) – IN:

SpMV algorithm for the SpMV computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMV_preprocess(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t vecX, const void * beta, const hipsparseDnVecDescr_t vecY, hipDataType computeType, hipsparseSpMVAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpMV(handle, opA, alpha, matA, vecX, beta, vecY, computeType, alg, externalBuffer)#

Compute the sparse matrix multiplication with a dense vector.

hipsparseSpMV multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix \(op(A)\), defined in CSR, CSC, COO, COO (AoS), BSR, or SELL format, with the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[y := \alpha \cdot op(A) \cdot x + \beta \cdot y,\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if trans == HIPSPARSE_OPERATION_TRANSPOSE} \\ A^H, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right.\end{split}\]
Par:

<table> <caption id=”spmv_uniform”>Uniform Precisions</caption> <tr><th>A / X / Y / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Par:

<table> <caption id=”spmv_mixed”>Mixed Precisions</caption> <tr><th>A / X <th>Y <th>compute_type <tr><td>HIP_R_8I <td>HIP_R_32I <td>HIP_R_32I <tr><td>HIP_R_8I <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_16F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_32F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_16BF <td>HIP_R_32F </table>

Par:

<table> <caption id=”spmv_mixed_regular_real”>Mixed-regular real precisions</caption> <tr><th>A <th>X / Y / compute_type <tr><td>HIP_R_32F <td>HIP_R_64F <tr><td>HIP_C_32F <td>HIP_C_64F </table>

Par:

<table> <caption id=”spmv_mixed_regular_complex”>Mixed-regular Complex precisions</caption> <tr><th>A <th>X / Y / compute_type <tr><td>HIP_R_32F <td>HIP_C_32F <tr><td>HIP_R_64F <td>HIP_C_64F </table>

hipsparseSpMV supports HIPSPARSE_INDEX_32I and HIPSPARSE_INDEX_64I index precisions for storing the row pointer and row/column indices arrays of the sparse matrices.

Note:

None of the algorithms above are deterministic when \(A\) is transposed.

Note:

The sparse matrix formats currently supported are: HIPSPARSE_FORMAT_COO , HIPSPARSE_FORMAT_COO_AOS , HIPSPARSE_FORMAT_CSR , HIPSPARSE_FORMAT_CSC , HIPSPARSE_FORMAT_BSR , and HIPSPARSE_FORMAT_SLICED_ELL .

Note:

Only the hipsparseSpMV_bufferSize and hipsparseSpMV routines are non-blocking and executed asynchronously with respect to the host. They can return before the actual computation has finished. The hipsparseSpMV_preprocess routine is blocking with respect to the host.

Note:

Only the hipsparseSpMV_bufferSize and the hipsparseSpMV routines support execution in a hipGraph context. The hipsparseSpMV_preprocess stage does not support hipGraph.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

vecX (Pointer/object) – IN:

vector descriptor.

beta (Pointer/object) – IN:

scalar \(\beta\).

vecY (Pointer/object) – INOUT:

vector descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpMV computation.

alg (hipsparseSpMVAlg_t) – IN:

SpMV algorithm for the SpMV computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpMV(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t vecX, const void * beta, const hipsparseDnVecDescr_t vecY, hipDataType computeType, hipsparseSpMVAlg_t alg, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpSM_createDescr()#

hipsparseSpSM_createDescr creates a sparse matrix triangular solve (with multiple rhs) descriptor.

It should be destroyed at the end using hipsparseSpSM_destroyDescr ().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_createDescr(hipsparseSpSMDescr_t * descr)
rocm.bindings.hipsparse.hipsparseSpSM_destroyDescr(descr)#

hipsparseSpSM_destroyDescr destroys a sparse matrix triangular solve (with multiple rhs) descriptor and releases all resources used by the descriptor.

Args:
descr (hipsparseSpSMDescr/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_destroyDescr(hipsparseSpSMDescr_t descr)
rocm.bindings.hipsparse.hipsparseSpSM_bufferSize(handle, opA, opB, alpha, matA, matB, matC, computeType, alg, spsmDescr, pBufferSizeInBytes)#

hipsparseSpSM_bufferSize computes the size of the required user-allocated buffer needed when solving the triangular linear system:

hipsparseSpSM_bufferSize computes the size of the required user-allocated buffer needed when solving the triangular linear system:

\[op(A) \cdot C := \alpha \cdot op(B),\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type for the sparse matrix \(A\).

opB (hipsparseOperation_t) – IN:

matrix operation type for the dense matrix \(B\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

matC (Pointer/object) – INOUT:

dense matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSM computation.

alg (hipsparseSpSMAlg_t) – IN:

SpSM algorithm for the SpSM computation.

spsmDescr (hipsparseSpSMDescr/object) – IN:

SpSM descriptor.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpSMAlg_t alg, hipsparseSpSMDescr_t spsmDescr, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpSM_analysis(handle, opA, opB, alpha, matA, matB, matC, computeType, alg, spsmDescr, externalBuffer)#

hipsparseSpSM_analysis performs the required analysis needed when solving the triangular linear system:

hipsparseSpSM_analysis performs the required analysis needed when solving the triangular linear system:

\[op(A) \cdot C := \alpha \cdot op(B),\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type for the sparse matrix \(A\).

opB (hipsparseOperation_t) – IN:

matrix operation type for the dense matrix \(B\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

matC (Pointer/object) – INOUT:

dense matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSM computation.

alg (hipsparseSpSMAlg_t) – IN:

SpSM algorithm for the SpSM computation.

spsmDescr (hipsparseSpSMDescr/object) – IN:

SpSM descriptor.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_analysis(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpSMAlg_t alg, hipsparseSpSMDescr_t spsmDescr, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpSM_solve(handle, opA, opB, alpha, matA, matB, matC, computeType, alg, spsmDescr, externalBuffer)#

Sparse triangular system solve

hipsparseSpSM_solve solves a triangular linear system of equations defined by a sparse \(m \times m\) square matrix \(op(A)\), given in CSR or COO storage format, such that

\[op(A) \cdot C = \alpha \cdot op(B),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if opA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if opB == HIPSPARSE_OPERATION_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if opA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if opB == HIPSPARSE_OPERATION_TRANSPOSE} \end{array} \right.\end{split}\]
Par:

<table> <caption id=”spsm_uniform”>Uniform Precisions</caption> <tr><th>A / B / C / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Note:

This routine does not correctly match the parameter list of the corresponding cuSPARSE API, cusparseSpSM_solve, which does not take the external buffer parameter. hipSPARSE provides the alternate routine hipsparseSpSM_solve_ex , which correctly matches the parameter list of cusparseSpSM_solve.

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type for the sparse matrix \(A\).

opB (hipsparseOperation_t) – IN:

matrix operation type for the dense matrix \(B\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

matC (Pointer/object) – INOUT:

dense matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSM computation.

alg (hipsparseSpSMAlg_t) – IN:

SpSM algorithm for the SpSM computation.

spsmDescr (hipsparseSpSMDescr/object) – IN:

SpSM descriptor.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_solve(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpSMAlg_t alg, hipsparseSpSMDescr_t spsmDescr, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpSM_solve_ex(handle, opA, opB, alpha, matA, matB, matC, computeType, alg, spsmDescr)#

Sparse triangular system solve

hipsparseSpSM_solve_ex solves a triangular linear system of equations defined by a sparse \(m \times m\) square matrix \(op(A)\), given in CSR or COO storage format, such that

\[op(A) \cdot C = \alpha \cdot op(B),\]

with

\[\begin{split}op(A) = \left* \begin{array}{ll} A, & \text{if opA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ A^T, & \text{if opB == HIPSPARSE_OPERATION_TRANSPOSE} \end{array} \right.\end{split}\]

and

\[\begin{split}op(B) = \left* \begin{array}{ll} B, & \text{if opA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ B^T, & \text{if opB == HIPSPARSE_OPERATION_TRANSPOSE} \end{array} \right.\end{split}\]
Par:

<table> <caption id=”spsm_ex_uniform”>Uniform Precisions</caption> <tr><th>A / B / C / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Note:

This routine correctly matches the parameter list of the corresponding cuSPARSE API cusparseSpSM_solve. The routine hipsparseSpSM_solve incorrectly passed the external buffer as the last parameter. Users looking for an exact match in the parameters should use hipsparseSpSM_solve_ex instead of hipsparseSpSM_solve .

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type for the sparse matrix \(A\).

opB (hipsparseOperation_t) – IN:

matrix operation type for the dense matrix \(B\).

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

matB (Pointer/object) – IN:

dense matrix descriptor.

matC (Pointer/object) – INOUT:

dense matrix descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSM computation.

alg (hipsparseSpSMAlg_t) – IN:

SpSM algorithm for the SpSM computation.

spsmDescr (hipsparseSpSMDescr/object) – IN:

SpSM descriptor.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSM_solve_ex(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnMatDescr_t matB, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpSMAlg_t alg, hipsparseSpSMDescr_t spsmDescr)
rocm.bindings.hipsparse.hipsparseSpSV_createDescr()#

hipsparseSpSV_createDescr creates a sparse matrix triangular solve descriptor.

It should be destroyed at the end using hipsparseSpSV_destroyDescr ().

Returns:

A tuple of size 2 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSV_createDescr(hipsparseSpSVDescr_t * descr)
rocm.bindings.hipsparse.hipsparseSpSV_destroyDescr(descr)#

hipsparseSpSV_destroyDescr destroys a sparse matrix triangular solve descriptor and releases all resources used by the descriptor.

Args:
descr (hipsparseSpSVDescr/object):

(undocumented)

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSV_destroyDescr(hipsparseSpSVDescr_t descr)
rocm.bindings.hipsparse.hipsparseSpSV_bufferSize(handle, opA, alpha, matA, x, y, computeType, alg, spsvDescr, pBufferSizeInBytes)#

hipsparseSpSV_bufferSize computes the size of the user-allocated buffer required when solving the triangular linear system:

hipsparseSpSV_bufferSize computes the size of the user-allocated buffer required when solving the triangular linear system:

\[op(A) \cdot y := \alpha \cdot x,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

sparse matrix descriptor.

x (Pointer/object) – IN:

dense vector descriptor.

y (Pointer/object) – INOUT:

dense vector descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSV computation.

alg (hipsparseSpSVAlg_t) – IN:

SpSV algorithm for the SpSV computation.

spsvDescr (hipsparseSpSVDescr/object) – IN:

SpSV descriptor.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSV_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t x, const hipsparseDnVecDescr_t y, hipDataType computeType, hipsparseSpSVAlg_t alg, hipsparseSpSVDescr_t spsvDescr, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpSV_analysis(handle, opA, alpha, matA, x, y, computeType, alg, spsvDescr, externalBuffer)#

hipsparseSpSV_analysis performs the required analysis needed when solving the triangular linear system:

hipsparseSpSV_analysis performs the required analysis needed when solving the triangular linear system:

\[op(A) \cdot y := \alpha \cdot x,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

x (Pointer/object) – IN:

vector descriptor.

y (Pointer/object) – INOUT:

vector descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSV computation.

alg (hipsparseSpSVAlg_t) – IN:

SpSV algorithm for the SpSV computation.

spsvDescr (hipsparseSpSVDescr/object) – IN:

SpSV descriptor.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSV_analysis(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t x, const hipsparseDnVecDescr_t y, hipDataType computeType, hipsparseSpSVAlg_t alg, hipsparseSpSVDescr_t spsvDescr, void * externalBuffer)
rocm.bindings.hipsparse.hipsparseSpSV_solve(handle, opA, alpha, matA, x, y, computeType, alg, spsvDescr)#

Sparse triangular solve.

hipsparseSpSV_solve solves a triangular linear system of equations defined by a sparse \(m \times m\) square matrix \(op(A)\), given in CSR or COO storage format, such that

\[op(A) \cdot y = \alpha \cdot x,\]

with

\[\begin{split}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.\end{split}\]
Par:

<table> <caption id=”spsv_uniform”>Uniform Precisions</caption> <tr><th>A / X / Y / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opA (hipsparseOperation_t) – IN:

matrix operation type.

alpha (Pointer/object) – IN:

scalar \(\alpha\).

matA (hipsparseSpMatDescr_st/object) – IN:

matrix descriptor.

x (Pointer/object) – IN:

vector descriptor.

y (Pointer/object) – INOUT:

vector descriptor.

computeType (hipDataType) – IN:

floating point precision for the SpSV computation.

alg (hipsparseSpSVAlg_t) – IN:

SpSV algorithm for the SpSV computation.

spsvDescr (hipsparseSpSVDescr/object) – IN:

SpSV descriptor.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpSV_solve(hipsparseHandle_t handle, hipsparseOperation_t opA, const void * alpha, hipsparseConstSpMatDescr_t matA, hipsparseConstDnVecDescr_t x, const hipsparseDnVecDescr_t y, hipDataType computeType, hipsparseSpSVAlg_t alg, hipsparseSpSVDescr_t spsvDescr)
rocm.bindings.hipsparse.hipsparseSpVV_bufferSize(handle, opX, vecX, vecY, result, computeType, pBufferSizeInBytes)#

hipsparseSpVV_bufferSize computes the required user-allocated buffer size needed when computing the inner dot product of a sparse vector with a dense vector:

hipsparseSpVV_bufferSize computes the required user-allocated buffer size needed when computing the inner dot product of a sparse vector with a dense vector:

\[\text{result} := op(x) \cdot y,\]
Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opX (hipsparseOperation_t) – IN:

sparse vector operation type.

vecX (Pointer/object) – IN:

sparse vector descriptor.

vecY (Pointer/object) – IN:

dense vector descriptor.

result (Pointer/object) – OUT:

pointer to the result, which can be in host or device memory.

computeType (hipDataType) – IN:

floating point precision for the SpVV computation.

pBufferSizeInBytes (PointerToUInt64/object) – OUT:

number of bytes of the temporary storage buffer.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVV_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opX, hipsparseConstSpVecDescr_t vecX, hipsparseConstDnVecDescr_t vecY, void * result, hipDataType computeType, size_t * pBufferSizeInBytes)
rocm.bindings.hipsparse.hipsparseSpVV(handle, opX, vecX, vecY, result, computeType, externalBuffer)#

Compute the inner dot product of a sparse vector with a dense vector.

hipsparseSpVV computes the inner dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[\text{result} := op(x) \cdot y,\]

with

\[\begin{split}op(x) = \left* \begin{array}{ll} x, & \text{if trans == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\ \bar{x}, & \text{if trans == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \\ \end{array} \right.\end{split}\]
result = 0;
for(i = 0; i < nnz; ++i)
{
    result += x_val[i] * y[x_ind[i]];
}
Par:

<table> <caption id=”spvv_uniform”>Uniform Precisions</caption> <tr><th>X / Y / compute_type <tr><td>HIP_R_32F <tr><td>HIP_R_64F <tr><td>HIP_C_32F <tr><td>HIP_C_64F </table>

Par:

<table> <caption id=”spvv_mixed”>Mixed Precisions</caption> <tr><th>X / Y <th>compute_type <tr><td>HIP_R_8I <td>HIP_R_32I <tr><td>HIP_R_8I <td>HIP_R_32F <tr><td>HIP_R_16F <td>HIP_R_32F <tr><td>HIP_R_16BF <td>HIP_R_32F </table>

Args:
handle (Pointer/object) – IN:

handle to the hipSPARSE library context queue.

opX (hipsparseOperation_t) – IN:

sparse vector operation type.

vecX (Pointer/object) – IN:

sparse vector descriptor.

vecY (Pointer/object) – IN:

dense vector descriptor.

result (Pointer/object) – OUT:

pointer to the result, which can be host or device memory.

computeType (hipDataType) – IN:

floating point precision for the SpVV computation.

externalBuffer (Pointer/object) – OUT:

temporary storage buffer allocated by the user.

Returns:

A tuple of size 1 that contains (in that order):

C signature

hipsparseStatus_t hipsparseSpVV(hipsparseHandle_t handle, hipsparseOperation_t opX, hipsparseConstSpVecDescr_t vecX, hipsparseConstDnVecDescr_t vecY, void * result, hipDataType computeType, void * externalBuffer)