rocm.bindings.hipsparse#
2026-09-24
853 min read time
Advanced Micro Devices, Inc.
Attributes#
Classes#
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
Indicates whether the pointer is a device pointer or host pointer. |
|
Specify where the operation is performed. |
|
Specify the matrix type. |
|
Specify the matrix fill mode. |
|
Indicates if the diagonal entries are unity. |
|
Specify the matrix index base. |
|
Specify whether the matrix is to be transposed or not. |
|
HYB matrix partitioning type. |
|
Specify policy in triangular solvers and factorizations. |
|
(No short description) |
|
Specify the matrix direction. |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
|
(No short description) |
Functions#
|
|
Create a hipSPARSE handle. |
|
|
Destroy a hipSPARSE handle. |
|
Return the string representation of a hipSPARSE status's matching backend status enum name |
|
Return the hipSPARSE status's matching backend status description as a string |
|
Get the hipSPARSE version. |
|
Get the hipSPARSE git revision. |
|
Specify the user-defined HIP stream. |
|
Get the current stream from the library context. |
|
Specify the pointer mode. |
|
Get the current pointer mode from the library context. |
Create a matrix descriptor. |
|
|
Destroy a matrix descriptor. |
|
Copy a matrix descriptor. |
|
Specify the matrix type of a matrix descriptor. |
|
Get the matrix type of a matrix descriptor. |
|
Specify the matrix fill mode of a matrix descriptor. |
|
Get the matrix fill mode of a matrix descriptor. |
|
Specify the matrix diagonal type of a matrix descriptor. |
|
Get the matrix diagonal type of a matrix descriptor. |
|
Specify the index base of a matrix descriptor. |
|
Get the index base of a matrix descriptor. |
Create a |
|
|
Destroy a |
Create a bsrsv2 info structure. |
|
Destroy a bsrsv2 info structure. |
|
Create a bsrsm2 info structure. |
|
Destroy a bsrsm2 info structure. |
|
Create a bsrilu02 info structure. |
|
Destroy a bsrilu02 info structure |
|
Create a bsric02 info structure. |
|
Destroy a bsric02 info structure. |
|
Create a csrsv2 info structure. |
|
Destroy a csrsv2 info structure. |
|
Create a csrsm2 info structure. |
|
Destroy a csrsm2 info structure. |
|
Create a csrilu02 info structure. |
|
Destroy a csrilu02 info structure. |
|
Create a csric02 info structure. |
|
Destroy a csric02 info structure. |
|
Create a csru2csr info structure. |
|
Destroy a csru2csr info structure. |
|
Create a color info structure. |
|
Destroy a color info structure. |
|
Create a csrgemm2 info structure. |
|
Destroy a csrgemm2 info structure. |
|
Create a prune info structure. |
|
Destroy a prune info structure |
|
|
Scale a sparse vector and add it to a dense vector. |
|
Scale a sparse vector and add it to a dense vector. |
|
Scale a sparse vector and add it to a dense vector. |
|
Scale a sparse vector and add it to a dense vector. |
|
Compute the dot product of a complex conjugate sparse vector with a dense |
|
Compute the dot product of a complex conjugate sparse vector with a dense |
|
Compute the dot product of a sparse vector with a dense vector. |
|
Compute the dot product of a sparse vector with a dense vector. |
|
Compute the dot product of a sparse vector with a dense vector. |
|
Compute the dot product of a sparse vector with a dense vector. |
|
Gather elements from a dense vector and store them in a sparse vector. |
|
Gather elements from a dense vector and store them in a sparse vector. |
|
Gather elements from a dense vector and store them in a sparse vector. |
|
Gather elements from a dense vector and store them in a sparse vector. |
|
Gather and zero out elements from a dense vector and store them in a sparse |
|
Gather and zero out elements from a dense vector and store them in a sparse |
|
Gather and zero out elements from a dense vector and store them in a sparse |
|
Gather and zero out elements from a dense vector and store them in a sparse |
|
Apply the Givens rotation to a dense and a sparse vector. |
|
Apply the Givens rotation to a dense and a sparse vector. |
|
Scatter elements from a dense vector across a sparse vector. |
|
Scatter elements from a dense vector across a sparse vector. |
|
Scatter elements from a dense vector across a sparse vector. |
|
Scatter elements from a dense vector across a sparse vector. |
|
Sparse matrix vector multiplication using the BSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sparse triangular solve using the BSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix vector multiplication with mask operation using the BSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix vector multiplication using the CSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sparse triangular solve using the CSR storage format |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
Dense matrix sparse vector multiplication |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix vector multiplication using the HYB storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix dense matrix multiplication using the BSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
|
|
Sparse triangular system solve using the BSR storage format. |
|
Sparse triangular system solve using the BSR storage format. |
|
Sparse triangular system solve using the BSR storage format. |
|
Sparse triangular system solve using the BSR storage format. |
|
Sparse triangular system solve using the BSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix dense matrix multiplication using the CSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Sparse matrix dense matrix multiplication using the CSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sparse triangular system solve using the CSR storage format |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
Dense matrix sparse matrix multiplication using the CSC storage format. |
|
Dense matrix sparse matrix multiplication using the CSC storage format. |
|
Dense matrix sparse matrix multiplication using the CSC storage format. |
|
Dense matrix sparse matrix multiplication using the CSC storage format. |
|
|
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
|
|
|
|
|
|
|
|
|
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
Sparse matrix sparse matrix addition using the CSR storage format. |
|
|
|
Sparse matrix and sparse matrix multiplication using the CSR storage format. |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
(No short description, might be part of a group.) |
|
|
|
|
|
|
|
|
|
|
|
Sparse matrix and sparse matrix multiplication using CSR storage format |
|
Sparse matrix and sparse matrix multiplication using CSR storage format |
|
Sparse matrix and sparse matrix multiplication using CSR storage format |
|
Sparse matrix and sparse matrix multiplication using CSR storage format |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR |
|
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR |
|
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR |
|
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the BSR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Incomplete LU factorization with 0 fill-ins and no pivoting using the BSR storage |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Incomplete Cholesky factorization with 0 fill-ins and no pivoting using the CSR |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Incomplete LU factorization with 0 fill-ins and no pivoting using the CSR |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
matrix A values are updated inplace to be the preconditioner M values |
|
|
|
|
|
|
|
|
|
Interleaved batch pentadiagonal solver |
|
Interleaved batch pentadiagonal solver |
|
Interleaved batch pentadiagonal solver |
|
Interleaved batch pentadiagonal solver |
|
|
|
|
|
|
|
|
|
Tridiagonal solver with pivoting |
|
Tridiagonal solver with pivoting |
|
Tridiagonal solver with pivoting |
|
Tridiagonal solver with pivoting |
|
|
|
|
|
|
|
|
|
Interleaved batch tridiagonal solver. |
|
Interleaved batch tridiagonal solver. |
|
Interleaved batch tridiagonal solver. |
|
Interleaved batch tridiagonal solver. |
|
|
|
|
|
|
|
|
|
Tridiagonal solver (no pivoting) |
|
Tridiagonal solver (no pivoting) |
|
Tridiagonal solver (no pivoting) |
|
Tridiagonal solver (no pivoting) |
|
|
|
|
|
|
|
|
|
Strided batch tridiagonal solver (no pivoting). |
|
Strided batch tridiagonal solver (no pivoting). |
|
Strided batch tridiagonal solver (no pivoting). |
|
Strided batch tridiagonal solver (no pivoting). |
|
Convert a sparse BSR matrix into a sparse CSR matrix. |
|
Convert a sparse BSR matrix into a sparse CSR matrix. |
|
Convert a sparse BSR matrix into a sparse CSR matrix. |
|
Convert a sparse BSR matrix into a sparse CSR matrix. |
|
Convert a sparse COO matrix into a sparse CSR matrix. |
|
Sort a sparse COO matrix. |
|
Sort a sparse COO matrix by row. |
|
Sort a sparse COO matrix by column. |
|
Create the identity map. |
|
|
|
|
|
|
|
|
|
Sort a sparse CSC matrix. |
|
Sort a sparse CSC matrix |
|
This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse |
|
Convert a sparse CSR matrix into a sparse BSR matrix. |
|
Convert a sparse CSR matrix into a sparse BSR matrix. |
|
Convert a sparse CSR matrix into a sparse BSR matrix. |
|
Convert a sparse CSR matrix into a sparse BSR matrix. |
|
Convert a sparse CSR matrix into a sparse COO matrix. |
|
Convert a sparse CSR matrix into a sparse CSC matrix. |
|
Convert a sparse CSR matrix into a sparse CSC matrix. |
|
Convert a sparse CSR matrix into a sparse CSC matrix. |
|
Convert a sparse CSR matrix into a sparse CSC matrix. |
|
This function computes the size of the user-allocated temporary storage buffer used |
|
Convert a sparse CSR matrix into a sparse CSC matrix. |
|
Convert a sparse CSR matrix into a compressed sparse CSR matrix. |
|
Convert a sparse CSR matrix into a compressed sparse CSR matrix. |
|
Convert a sparse CSR matrix into a compressed sparse CSR matrix. |
|
Convert a sparse CSR matrix into a compressed sparse CSR matrix. |
|
This function converts the sorted CSR format to the unsorted CSR format. The required |
|
This function converts the sorted CSR format to the unsorted CSR format. The required |
|
This function converts the sorted CSR format to the unsorted CSR format. The required |
|
This function converts the sorted CSR format to the unsorted CSR format. The required |
|
|
|
|
|
|
|
|
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
This function computes the number of non-zero block columns per row and the total number of non-zero blocks in a sparse |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse GEBSR matrix. |
|
Convert a sparse CSR matrix into a sparse HYB matrix. |
|
Convert a sparse CSR matrix into a sparse HYB matrix. |
|
Convert a sparse CSR matrix into a sparse HYB matrix. |
|
Convert a sparse CSR matrix into a sparse HYB matrix. |
|
Sort a sparse CSR matrix. |
|
Sort a sparse CSR matrix. |
|
This function calculates the amount of temporary storage in bytes required for |
|
This function calculates the amount of temporary storage in bytes required for |
|
This function calculates the amount of temporary storage in bytes required for |
|
This function calculates the amount of temporary storage in bytes required for |
|
This function converts the unsorted CSR format to the sorted CSR format. The required |
|
This function converts the unsorted CSR format to the sorted CSR format. The required |
|
This function converts the unsorted CSR format to the sorted CSR format. The required |
|
This function converts the unsorted CSR format to the sorted CSR format. The required |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convert a sparse GEBSR matrix into a sparse CSR matrix. |
|
Convert a sparse GEBSR matrix into a sparse CSR matrix. |
|
Convert a sparse GEBSR matrix into a sparse CSR matrix. |
|
Convert a sparse GEBSR matrix into a sparse CSR matrix. |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix. |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix. |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix. |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix. |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix |
|
Convert a sparse GEBSR matrix into a sparse GEBSC matrix |
|
This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse |
|
This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse |
|
This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse |
|
This function computes the the size of the user-allocated temporary storage buffer used when converting a sparse |
|
This function is used when converting a GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). |
|
This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). |
|
This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). |
|
This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). |
|
This function converts the GEBSR sparse matrix \(A\) to another GEBSR sparse matrix \(C\). |
|
Convert a sparse HYB matrix into a sparse CSR matrix. |
|
Convert a sparse HYB matrix into a sparse CSR matrix. |
|
Convert a sparse HYB matrix into a sparse CSR matrix. |
|
Convert a sparse HYB matrix into a sparse CSR matrix. |
|
|
|
|
|
|
|
|
|
This function is used as the first step in converting a CSR matrix to a compressed CSR matrix. |
|
This function is used as the first step in converting a CSR matrix to a compressed CSR matrix. |
|
This function is used as the first step in converting a CSR matrix to a compressed CSR matrix. |
|
This function is used as the first step in converting a CSR matrix to a compressed CSR matrix. |
|
Convert and prune a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune sparse a CSR matrix into a sparse CSR matrix. |
|
Convert and prune sparse a CSR matrix into a sparse CSR matrix. |
|
Convert and prune sparse a CSR matrix into a sparse CSR matrix. |
|
Convert and prune sparse a CSR matrix into a sparse CSR matrix. |
|
Convert and prune a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
Convert and prune by percentage a sparse CSR matrix into a sparse CSR matrix. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function computes the size of the user-allocated temporary storage buffer used |
|
This function computes the size of the user-allocated temporary storage buffer used |
|
|
This function computes the number of non-zero elements per row and the total number of |
|
This function computes the number of non-zero elements per row and the total number of |
|
This function computes the number of non-zero elements per row and the total number of |
|
This function computes the number of non-zero elements per row and the total number of |
|
Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format. |
|
Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format. |
|
Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format. |
|
Coloring of the adjacency graph of the matrix \(A\) stored in the CSR format. |
|
Create a sparse vector. |
|
Create a const sparse vector. |
|
Destroy a sparse vector. |
|
Get the fields of the sparse vector descriptor. |
|
Get the fields of the const sparse vector descriptor. |
|
Get the index base of a sparse vector. |
|
Get the pointer to a sparse vector data array. |
|
Get the pointer to a sparse vector data array. |
|
Set the pointer of a sparse vector data array. |
|
Create a sparse COO matrix descriptor. |
|
Create a sparse COO matrix descriptor. |
|
Create a sparse COO (AoS) matrix descriptor. |
|
Create a sparse CSR matrix descriptor. |
|
Create a sparse CSR matrix descriptor. |
|
Create a sparse CSC matrix descriptor. |
|
Create a sparse CSC matrix descriptor. |
|
Create a sparse Blocked ELL matrix descriptor. |
|
Create a sparse Blocked ELL matrix descriptor. |
|
Create a sparse Sliced ELL matrix descriptor. |
|
Create a sparse Sliced ELL matrix descriptor. |
|
Create a sparse BSR matrix descriptor. |
|
Create a sparse BSR matrix descriptor. |
|
Destroy a sparse matrix descriptor. |
|
Get the pointers of a sparse COO matrix. |
|
Get the pointers of a sparse COO matrix. |
|
Get the pointers of a sparse COO (AoS) matrix. |
|
Get the pointers of a sparse CSR matrix. |
|
Get the pointers of a sparse CSR matrix. |
|
Get the pointers of a sparse CSC matrix. |
|
Get the pointers of a sparse CSC matrix. |
|
Get the pointers of a sparse blocked ELL matrix. |
|
Get the pointers of a sparse blocked ELL matrix. |
|
Set the pointers of a sparse CSR matrix. |
|
Set the pointers of a sparse CSC matrix. |
|
Set the pointers of a sparse COO matrix. |
|
Set the pointers of a sparse blocked ELL matrix. |
|
Get the sizes of a sparse matrix. |
|
Get the format of a sparse matrix. |
|
Get the index base of a sparse matrix. |
|
Get the pointer of the values array of a sparse matrix. |
|
Get the pointer of the values array of a sparse matrix. |
|
Set the pointer of the values array of a sparse matrix. |
|
Get the batch count of the sparse matrix. |
|
Set the batch count of the sparse matrix. |
|
Set the batch count and stride of the sparse COO matrix. |
|
Set the batch count and stride of the sparse CSR matrix. |
|
Get an attribute from a sparse matrix descriptor. |
|
Set an attribute in a sparse matrix descriptor. |
|
Create a dense vector. |
|
Create a dense vector. |
|
Destroy a dense vector. |
|
Get the fields from a dense vector. |
|
Get the fields from a dense vector. |
|
Get the value pointer from a dense vector. |
|
Get the value pointer from a dense vector. |
|
Set the value pointer of a dense vector. |
|
Create a dense matrix. |
|
Create a dense matrix. |
|
Destroy a dense matrix. |
|
Get fields from a dense matrix. |
|
Get fields from a dense matrix. |
|
Get the value pointer from a dense matrix. |
|
Get the value pointer from a dense matrix. |
|
Set the value pointer of a dense matrix. |
|
Get the batch count and batch stride of the dense matrix. |
|
Set the batch count and batch stride of the dense matrix. |
|
Scale a sparse vector and add it to a scaled dense vector. |
|
|
|
|
|
Dense matrix to sparse matrix conversion. |
|
Gather elements from a dense vector and store them in a sparse vector. |
|
Apply the Givens rotation to a dense and a sparse vector. |
|
Scatter elements from a sparse vector into a dense vector. |
|
|
|
|
|
Sampled dense-dense matrix multiplication. |
|
|
|
Sparse matrix to dense matrix conversion |
|
|
|
|
|
Work estimation step of the sparse matrix sparse matrix product: |
|
Compute step of the sparse matrix sparse matrix product: |
|
Copy step of the sparse matrix sparse matrix product: |
|
Work estimation step of the sparse matrix sparse matrix product: |
|
Nnz calculation step of the sparse matrix sparse matrix product: |
|
Copy step of the sparse matrix sparse matrix product: |
|
Copy step of the sparse matrix sparse matrix product: |
|
|
|
|
|
Compute the sparse matrix multiplication with a dense matrix. |
|
|
|
|
|
Compute the sparse matrix multiplication with a dense vector. |
|
|
|
|
|
|
|
|
|
Sparse triangular system solve |
|
Sparse triangular system solve |
|
|
|
|
|
|
|
|
|
Sparse triangular solve. |
|
|
|
Compute the inner dot product of a sparse vector with a dense vector. |
Module Contents#
- class rocm.bindings.hipsparse.hipsparseBfloat16(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- data: Any#
- static fromObj(pyobj) Any#
- as_c_void_p() Any#
- class rocm.bindings.hipsparse.hipsparseFloat16(*args, **kwargs)#
Bases:
rocm.bindings.util.types.Pointer(No short description)
- data: Any#
- static fromObj(pyobj) Any#
- 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)
- class rocm.bindings.hipsparse.hipsparsePointerMode_t#
Bases:
enum.IntEnumIndicates whether the pointer is a device pointer or host pointer.
The
hipsparsePointerMode_tindicates whether scalar values are passed by reference on the host or device. ThehipsparsePointerMode_tcan be changed by hipsparseSetPointerMode(). The current pointer mode can be obtained by hipsparseGetPointerMode().
- class rocm.bindings.hipsparse.hipsparseAction_t#
Bases:
enum.IntEnumSpecify where the operation is performed.
The
hipsparseAction_tindicates whether the operation is performed on the full matrix or only on the sparsity pattern of the matrix.
- class rocm.bindings.hipsparse.hipsparseMatrixType_t#
Bases:
enum.IntEnumSpecify the matrix type.
The
hipsparseMatrixType_tindices the type of a matrix. For a givenhipsparseMatDescr_t, thehipsparseMatrixType_tcan be set using hipsparseSetMatType(). The currenthipsparseMatrixType_tof a matrix can be obtained by hipsparseGetMatType().
- class rocm.bindings.hipsparse.hipsparseFillMode_t#
Bases:
enum.IntEnumSpecify the matrix fill mode.
The
hipsparseFillMode_tindicates whether the lower or the upper part is stored in a sparse triangular matrix. For a givenhipsparseMatDescr_t, thehipsparseFillMode_tcan be set using hipsparseSetMatFillMode(). The currenthipsparseFillMode_tof a matrix can be obtained by hipsparseGetMatFillMode().
- class rocm.bindings.hipsparse.hipsparseDiagType_t#
Bases:
enum.IntEnumIndicates if the diagonal entries are unity.
The
hipsparseDiagType_tindicates whether the diagonal entries of a matrix are unity or not. IfHIPSPARSE_DIAG_TYPE_UNITis specified, all present diagonal values will be ignored. For a givenhipsparseMatDescr_t, thehipsparseDiagType_tcan be set using hipsparseSetMatDiagType(). The currenthipsparseDiagType_tof a matrix can be obtained by hipsparseGetMatDiagType().
- class rocm.bindings.hipsparse.hipsparseIndexBase_t#
Bases:
enum.IntEnumSpecify the matrix index base.
The
hipsparseIndexBase_tindicates the index base of the indices. For a givenhipsparseMatDescr_t, thehipsparseIndexBase_tcan be set using hipsparseSetMatIndexBase(). The currenthipsparseIndexBase_tof a matrix can be obtained by hipsparseGetMatIndexBase().
- class rocm.bindings.hipsparse.hipsparseOperation_t#
Bases:
enum.IntEnumSpecify whether the matrix is to be transposed or not.
The
hipsparseOperation_tindicates the operation performed with the given matrix.
- class rocm.bindings.hipsparse.hipsparseHybPartition_t#
Bases:
enum.IntEnumHYB matrix partitioning type.
The
hipsparseHybPartition_ttype indicates how the hybrid format partitioning between COO and ELL storage formats is performed.
- class rocm.bindings.hipsparse.hipsparseSolvePolicy_t#
Bases:
enum.IntEnumSpecify policy in triangular solvers and factorizations.
The
hipsparseSolvePolicy_ttype indicates the solve policy for the triangular solve.
- class rocm.bindings.hipsparse.hipsparseSideMode_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseDirection_t#
Bases:
enum.IntEnumSpecify the matrix direction.
The
hipsparseDirection_tindicates whether a dense matrix should be parsed by rows or by columns, assuming column-major storage.
- class rocm.bindings.hipsparse.hipsparseCsr2CscAlg_t#
Bases:
enum.IntEnum(No short description)
- rocm.bindings.hipsparse.hipsparseCreate()#
Create a hipSPARSE handle.
hipsparseCreatecreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseCreate(hipsparseHandle_t * handle)
- rocm.bindings.hipsparse.hipsparseDestroy(handle)#
Destroy a hipSPARSE handle.
hipsparseDestroydestroys the hipSPARSE library context and releases all resources used by the hipSPARSE library.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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
hipsparseGetErrorNametakes a hipSPARSE status as input and first converts it to the matching backend status (eitherrocsparse_statusorcusparseStatus_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 returnrocsparse_status_success.On a system with a cuSPARSE backend this function would returnCUSPARSE_STATUS_SUCCESS.- Args:
- status (
hipsparseStatus_t): (undocumented)
- status (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
bytes: (undocumented)
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
hipsparseGetErrorStringtakes a hipSPARSE status as input and first converts it to the matching backend status (eitherrocsparse_statusorcusparseStatus_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)
- status (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
bytes: (undocumented)
C signature
const char * hipsparseGetErrorString(hipsparseStatus_t status)
- rocm.bindings.hipsparse.hipsparseGetVersion(handle, version)#
Get the hipSPARSE version.
hipsparseGetVersiongets the hipSPARSE library version number. - patch = version % 100 - minor = version / 100 % 1000 - major = version / 100000- Args:
- handle (
Pointer/object): (undocumented)
- version (
PointerToInt/object): (undocumented)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseGetVersion(hipsparseHandle_t handle, int * version)
- rocm.bindings.hipsparse.hipsparseGetGitRevision(handle, rev)#
Get the hipSPARSE git revision.
hipsparseGetGitRevisiongets the hipSPARSE library git commit revision (SHA-1).- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseGetGitRevision(hipsparseHandle_t handle, char * rev)
- rocm.bindings.hipsparse.hipsparseSetStream(handle, streamId)#
Specify the user-defined HIP stream.
hipsparseSetStreamspecifies the stream to be used by the hipSPARSE library context and all subsequent function calls.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseSetStream(hipsparseHandle_t handle, hipStream_t streamId)
- rocm.bindings.hipsparse.hipsparseGetStream(handle)#
Get the current stream from the library context.
hipsparseGetStreamgets the hipSPARSE library context stream which is currently used for all subsequent function calls.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- streamId (
ihipStream_t): (undocumented)
- streamId (
C signature
hipsparseStatus_t hipsparseGetStream(hipsparseHandle_t handle, hipStream_t * streamId)
- rocm.bindings.hipsparse.hipsparseSetPointerMode(handle, mode)#
Specify the pointer mode.
hipsparseSetPointerModespecifies 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 areHIPSPARSE_POINTER_MODE_HOSTorHIPSPARSE_POINTER_MODE_DEVICE.- Args:
- handle (
Pointer/object): (undocumented)
- mode (
hipsparsePointerMode_t): (undocumented)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseGetPointerModegets the hipSPARSE library context pointer mode which is currently used for all subsequent function calls.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseGetPointerMode(hipsparseHandle_t handle, hipsparsePointerMode_t * mode)
- rocm.bindings.hipsparse.hipsparseCreateMatDescr()#
Create a matrix descriptor.
hipsparseCreateMatDescrcreates a matrix descriptor. It initializeshipsparseMatrixType_ttoHIPSPARSE_MATRIX_TYPE_GENERALandhipsparseIndexBase_ttoHIPSPARSE_INDEX_BASE_ZERO. It should be destroyed at the end using hipsparseDestroyMatDescr().- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseCreateMatDescr(hipsparseMatDescr_t * descrA)
- rocm.bindings.hipsparse.hipsparseDestroyMatDescr(descrA)#
Destroy a matrix descriptor.
hipsparseDestroyMatDescrdestroys a matrix descriptor and releases all resources used by the descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyMatDescr(hipsparseMatDescr_t descrA)
- rocm.bindings.hipsparse.hipsparseCopyMatDescr(dest, src)#
Copy a matrix descriptor.
hipsparseCopyMatDescrcopies a matrix descriptor. Both source and destination matrix descriptors must be initialized prior to callinghipsparseCopyMatDescr.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseSetMatTypesets the matrix type of a matrix descriptor. Valid matrix types areHIPSPARSE_MATRIX_TYPE_GENERAL,HIPSPARSE_MATRIX_TYPE_SYMMETRIC,HIPSPARSE_MATRIX_TYPE_HERMITIAN, orHIPSPARSE_MATRIX_TYPE_TRIANGULAR.- Args:
- descrA (
Pointer/object): (undocumented)
- type (
hipsparseMatrixType_t): (undocumented)
- descrA (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseSetMatType(hipsparseMatDescr_t descrA, hipsparseMatrixType_t type)
- rocm.bindings.hipsparse.hipsparseGetMatType(descrA)#
Get the matrix type of a matrix descriptor.
hipsparseGetMatTypereturns the matrix type of a matrix descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
hipsparseMatrixType_t: (undocumented)
C signature
hipsparseMatrixType_t hipsparseGetMatType(const hipsparseMatDescr_t descrA)
- rocm.bindings.hipsparse.hipsparseSetMatFillMode(descrA, fillMode)#
Specify the matrix fill mode of a matrix descriptor.
hipsparseSetMatFillModesets the matrix fill mode of a matrix descriptor. Valid fill modes areHIPSPARSE_FILL_MODE_LOWERorHIPSPARSE_FILL_MODE_UPPER.- Args:
- descrA (
Pointer/object): (undocumented)
- fillMode (
hipsparseFillMode_t): (undocumented)
- descrA (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseGetMatFillModereturns the matrix fill mode of a matrix descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
hipsparseFillMode_t: (undocumented)
C signature
hipsparseFillMode_t hipsparseGetMatFillMode(const hipsparseMatDescr_t descrA)
- rocm.bindings.hipsparse.hipsparseSetMatDiagType(descrA, diagType)#
Specify the matrix diagonal type of a matrix descriptor.
hipsparseSetMatDiagTypesets the matrix diagonal type of a matrix descriptor. Valid diagonal types areHIPSPARSE_DIAG_TYPE_UNITorHIPSPARSE_DIAG_TYPE_NON_UNIT.- Args:
- descrA (
Pointer/object): (undocumented)
- diagType (
hipsparseDiagType_t): (undocumented)
- descrA (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseGetMatDiagTypereturns the matrix diagonal type of a matrix descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
hipsparseDiagType_t: (undocumented)
C signature
hipsparseDiagType_t hipsparseGetMatDiagType(const hipsparseMatDescr_t descrA)
- rocm.bindings.hipsparse.hipsparseSetMatIndexBase(descrA, base)#
Specify the index base of a matrix descriptor.
hipsparseSetMatIndexBasesets the index base of a matrix descriptor. Valid options areHIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- Args:
- descrA (
Pointer/object): (undocumented)
- base (
hipsparseIndexBase_t): (undocumented)
- descrA (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseSetMatIndexBase(hipsparseMatDescr_t descrA, hipsparseIndexBase_t base)
- rocm.bindings.hipsparse.hipsparseGetMatIndexBase(descrA)#
Get the index base of a matrix descriptor.
hipsparseGetMatIndexBasereturns the index base of a matrix descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t:Always returns
HIPSPARSE_STATUS_SUCCESS.
hipsparseIndexBase_t: (undocumented)
C signature
hipsparseIndexBase_t hipsparseGetMatIndexBase(const hipsparseMatDescr_t descrA)
- rocm.bindings.hipsparse.hipsparseCreateHybMat()#
Create a
HYBmatrix structure.hipsparseCreateHybMatcreates a structure that holds the matrix inHYBstorage format. It should be destroyed at the end using hipsparseDestroyHybMat().- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseCreateHybMat(hipsparseHybMat_t * hybA)
- rocm.bindings.hipsparse.hipsparseDestroyHybMat(hybA)#
Destroy a
HYBmatrix structure.hipsparseDestroyHybMatdestroys aHYBstructure.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyHybMat(hipsparseHybMat_t hybA)
- rocm.bindings.hipsparse.hipsparseCreateBsrsv2Info()#
Create a bsrsv2 info structure.
hipsparseCreateBsrsv2Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
bsrsv2Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateBsrsv2Info(bsrsv2Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyBsrsv2Info(info)#
Destroy a bsrsv2 info structure.
hipsparseDestroyBsrsv2Infodestroys a bsrsv2 info structure.- Args:
- info (
bsrsv2Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyBsrsv2Info(bsrsv2Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateBsrsm2Info()#
Create a bsrsm2 info structure.
hipsparseCreateBsrsm2Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
bsrsm2Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateBsrsm2Info(bsrsm2Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyBsrsm2Info(info)#
Destroy a bsrsm2 info structure.
hipsparseDestroyBsrsm2Infodestroys a bsrsm2 info structure.- Args:
- info (
bsrsm2Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyBsrsm2Info(bsrsm2Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateBsrilu02Info()#
Create a bsrilu02 info structure.
hipsparseCreateBsrilu02Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
bsrilu02Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateBsrilu02Info(bsrilu02Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyBsrilu02Info(info)#
Destroy a bsrilu02 info structure
hipsparseDestroyBsrilu02Infodestroys a bsrilu02 info structure.- Args:
- info (
bsrilu02Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyBsrilu02Info(bsrilu02Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateBsric02Info()#
Create a bsric02 info structure.
hipsparseCreateBsric02Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
bsric02Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateBsric02Info(bsric02Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyBsric02Info(info)#
Destroy a bsric02 info structure.
hipsparseDestroyBsric02Infodestroys a bsric02 info structure.- Args:
- info (
bsric02Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyBsric02Info(bsric02Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsrsv2Info()#
Create a csrsv2 info structure.
hipsparseCreateCsrsv2Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csrsv2Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsrsv2Info(csrsv2Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsrsv2Info(info)#
Destroy a csrsv2 info structure.
hipsparseDestroyCsrsv2Infodestroys a csrsv2 info structure.- Args:
- info (
csrsv2Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsrsv2Info(csrsv2Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsrsm2Info()#
Create a csrsm2 info structure.
hipsparseCreateCsrsm2Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csrsm2Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsrsm2Info(csrsm2Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsrsm2Info(info)#
Destroy a csrsm2 info structure.
hipsparseDestroyCsrsm2Infodestroys a csrsm2 info structure.- Args:
- info (
csrsm2Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsrsm2Info(csrsm2Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsrilu02Info()#
Create a csrilu02 info structure.
hipsparseCreateCsrilu02Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csrilu02Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsrilu02Info(csrilu02Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsrilu02Info(info)#
Destroy a csrilu02 info structure.
hipsparseDestroyCsrilu02Infodestroys a csrilu02 info structure.- Args:
- info (
csrilu02Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsrilu02Info(csrilu02Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsric02Info()#
Create a csric02 info structure.
hipsparseCreateCsric02Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csric02Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsric02Info(csric02Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsric02Info(info)#
Destroy a csric02 info structure.
hipsparseDestroyCsric02Infodestroys a csric02 info structure.- Args:
- info (
csric02Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsric02Info(csric02Info_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsru2csrInfo()#
Create a csru2csr info structure.
hipsparseCreateCsru2csrInfocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csru2csrInfo): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsru2csrInfo(csru2csrInfo_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsru2csrInfo(info)#
Destroy a csru2csr info structure.
hipsparseDestroyCsru2csrInfodestroys a csru2csr info structure.- Args:
- info (
csru2csrInfo/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsru2csrInfo(csru2csrInfo_t info)
- rocm.bindings.hipsparse.hipsparseCreateColorInfo()#
Create a color info structure.
hipsparseCreateColorInfocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseCreateColorInfo(hipsparseColorInfo_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyColorInfo(info)#
Destroy a color info structure.
hipsparseDestroyColorInfodestroys a color info structure.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyColorInfo(hipsparseColorInfo_t info)
- rocm.bindings.hipsparse.hipsparseCreateCsrgemm2Info()#
Create a csrgemm2 info structure.
hipsparseCreateCsrgemm2Infocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
csrgemm2Info): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreateCsrgemm2Info(csrgemm2Info_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyCsrgemm2Info(info)#
Destroy a csrgemm2 info structure.
hipsparseDestroyCsrgemm2Infodestroys a csrgemm2 info structure.- Args:
- info (
csrgemm2Info/object): (undocumented)
- info (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyCsrgemm2Info(csrgemm2Info_t info)
- rocm.bindings.hipsparse.hipsparseCreatePruneInfo()#
Create a prune info structure.
hipsparseCreatePruneInfocreates 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
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- info (
pruneInfo): (undocumented)
- info (
C signature
hipsparseStatus_t hipsparseCreatePruneInfo(pruneInfo_t * info)
- rocm.bindings.hipsparse.hipsparseDestroyPruneInfo(info)#
Destroy a prune info structure
hipsparseDestroyPruneInfodestroys a prune info structure.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXaxpyimultiplies 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the corresponding values being added multiple times to the same location iny.- 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
nnzelements containing the values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,alpha,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXaxpyimultiplies 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the corresponding values being added multiple times to the same location iny.- 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
nnzelements containing the values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,alpha,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXaxpyimultiplies 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the corresponding values being added multiple times to the same location iny.- 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
nnzelements containing the values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,alpha,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXaxpyimultiplies 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the corresponding values being added multiple times to the same location iny.- 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
nnzelements containing the values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,alpha,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXdotcicomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXdotcicomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXdoticomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXdoticomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXdoticomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXdoticomputes 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
nnzis zero, the function returns successfully withresultset 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
nnzvalues containing the elements of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorresultis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the dot product reduction could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXgthrgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxVal.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxVal.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxVal.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxVal.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrzgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrzgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrzgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXgthrzgathers the elements that are listed inxIndfrom 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements that will contain the gathered values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the non-zero values of \(x\).- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,y,xVal,orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXrotiapplies 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,c,orsis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXrotiapplies 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
nnzis zero, the function returns successfully without modifyingxValory.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,c,orsis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXsctrscatters the elements that are listed inxIndfrom the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed inxIndremain 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the last value being written toy.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXsctrscatters the elements that are listed inxIndfrom the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed inxIndremain 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the last value being written toy.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXsctrscatters the elements that are listed inxIndfrom the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed inxIndremain 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the last value being written toy.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXsctrscatters the elements that are listed inxIndfrom the sparse vector \(x\) into the dense vector \(y\). Indices of \(y\) that are not listed inxIndremain 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
nnzis zero, the function returns successfully without modifyingy.Duplicate indices inxIndwill result in the last value being written toy.- 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
nnzelements containing the non-zero values of \(x\).- xInd (
PointerToInt/object) – IN: array of
nnzelements 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_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,nnzis negative,xVal,xInd,oryis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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.
hipsparseXbsrmvmultiplies 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_TRANSPOSEis 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_GENERALis supported.- bsrSortedValA (
Pointer/object) – IN: array of
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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*blockDimelements (\(op(A) = A\)) ormb*blockDimelements (\(op(A) = A^T\) or \(op(A) = A^H\)).- beta (
Pointer/object) – IN: scalar \(\beta\).
- y (
Pointer/object) – INOUT: array of
mb*blockDimelements (\(op(A) = A\)) ornb*blockDimelements (\(op(A) = A^T\) or \(op(A) = A^H\)).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,alpha,orbetais nullptr,mb,nb,ornnzbis negative,blockDimis less than or equal to zero, orbsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,x,oryis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:transAis notHIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrsv2_analysis“hipsparseXbsrsv2_analysis()” or `` […]hipsparseXbsrsv2_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrsv2_analysis“hipsparseXbsrsv2_analysis()” orhipsparseSbsrsv2_solvecomputation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the BSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXbsrsv2_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsv2_analysisandhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_analysisandhipsparseSbsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descr,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsv2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_solvesolves 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_TRANSPOSEandtransA==HIPSPARSE_OPERATION_TRANSPOSEis 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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzcontaining 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
melements, holding the right-hand side.- x (
Pointer/object) – OUT: array of
melements, holding the solution.- policy (
hipsparseSolvePolicy_t) – IN: HIPSPARSE_SOLVE_POLICY_NO_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,alpha,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,f,orxis invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXbsrxmvmultiplies the scalar \(\alpha\) with a sparsemath:
(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_TRANSPOSEis supported, andblockDim== 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 thanmb.- 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_GENERALis supported.- bsrVal (
Pointer/object) – IN: array of
nnzbblocks of the sparse BSR matrix.- bsrMaskPtr (
PointerToInt/object) – IN: array of
sizeOfMaskelements that give the indices of the updated block rows.- bsrRowPtr (
PointerToInt/object) – IN: array of
mbelements that point to the start of every block row of the sparse BSR matrix.- bsrEndPtr (
PointerToInt/object) – IN: array of
mbelements that point to the end of every block row of the sparse BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzbelements 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*blockDimelements (\(op(A) = A\)) ormb*blockDimelements (\(op(A) = A^T\) or \(op(A) = A^H\)).- beta (
Pointer/object) – IN: scalar \(\beta\).
- y (
Pointer/object) – INOUT: array of
mb*blockDimelements (\(op(A) = A\)) ornb*blockDimelements (\(op(A) = A^T\) or \(op(A) = A^H\)).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,alpha,orbetais nullptr,mb,nb,nnzb,orsizeOfMaskis negative,sizeOfMaskis greater thanmb,blockDimis less than or equal to 1, orbsrVal,bsrMaskPtr,bsrRowPtr,bsrEndPtr,bsrColInd,x,oryis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:transis notHIPSPARSE_OPERATION_NON_TRANSPOSE, orhipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXcsrmvmultiplies 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_TRANSPOSEis 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array of
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- x (
Pointer/object) – IN: array of
nelements (\(op(A) == A\)) ormelements (\(op(A) == A^T\) or \(op(A) == A^H\)).- beta (
Pointer/object) – IN: scalar \(\beta\).
- y (
Pointer/object) – INOUT: array of
melements (\(op(A) == A\)) ornelements (\(op(A) == A^T\) or \(op(A) == A^H\)).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,alpha,orbetais nullptr,m,n,ornnzis negative, orcsrSortedValA,csrSortedRowPtrA,csrSortedColIndA,x,oryis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found during hipsparseScsrsv2_solve(), hipsparseDcsrsv2_solve(), hipsparseCcsrs […]hipsparseXcsrsv2_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif 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 inposition,using same index base as the CSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXcsrsv2_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsv2_analysisandhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrsv2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descr,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descr,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descr,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsv2_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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descr,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_solvesolves 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_TRANSPOSEandtransA==HIPSPARSE_OPERATION_TRANSPOSEis 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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
melements, holding the right-hand side.- x (
Pointer/object) – OUT: array of
melements, holding the solution.- policy (
hipsparseSolvePolicy_t) – IN: HIPSPARSE_SOLVE_POLICY_NO_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,alpha,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,f,orxis invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_bufferSizereturns the size of the temporary storage buffer in bytes required byhipsparseSgemvi.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes required byhipsparseSgemvi.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes required byhipsparseSgemvi.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes required byhipsparseSgemvi.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXgemvimultiplies 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_TRANSPOSEis 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
nnzelements containing the values of the sparse vector.- xInd (
PointerToInt/object) – IN: array of
nnzelements containing the indices of the sparse vector.- beta (
Pointer/object) – IN: scalar \(\beta\).
- y (
Pointer/object) – INOUT: array of
melements (\(op(A) == A\)) ornelements (\(op(A) == A^T\) or \(op(A) == A^H\)).- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- pBuffer (
Pointer/object) – IN: temporary storage buffer.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,nnz,alpha,A,x,xInd,beta,y,orpBufferis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXhybmvmultiplies 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_TRANSPOSEis 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_GENERALis supported.- hybA (
Pointer/object) – IN: matrix in HYB storage format.
- x (
Pointer/object) – IN: array of
nelements (\(op(A) == A\)) ormelements (\(op(A) == A^T\) or \(op(A) == A^H\)).- beta (
Pointer/object) – IN: scalar \(\beta\).
- y (
Pointer/object) – INOUT: array of
melements (\(op(A) == A\)) ornelements (\(op(A) == A^T\) or \(op(A) == A^H\)).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,alpha,beta,orhybAis nullptr, orxoryis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transAis notHIPSPARSE_OPERATION_NON_TRANSPOSEorhipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXbsrmmmultiplies 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_TRANSPOSEis 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_ROWorHIPSPARSE_DIRECTION_COLUMN.- transA (
hipsparseOperation_t) – IN: matrix \(A\) operation type. Currently, only
HIPSPARSE_OPERATION_NON_TRANSPOSEis supported.- transB (
hipsparseOperation_t) – IN: matrix \(B\) operation type. Currently, only
HIPSPARSE_OPERATION_NON_TRANSPOSEandHIPSPARSE_OPERATION_TRANSPOSEare 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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*blockDim*blockDimelements of the sparse BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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*kotherwise.- 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)}\) wherek=blockDim*kbotherwise.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,alpha,orbetais nullptr,mb,n,kb,ornnzbis negative,ldborldcis invalid,blockDimis less than or equal to zero, orbsrValA,bsrRowPtrA,bsrColIndA,B,orCis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:transAis notHIPSPARSE_OPERATION_NON_TRANSPOSE,transBisHIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrsm2_analysisorhipsparseSbsrsm2_solvecomp […]hipsparseXbsrsm2_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrsm2_analysisorhipsparseSbsrsm2_solvecomputation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the BSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXbsrsm2_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_sizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsm2_analysisandhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_analysisandhipsparseSbsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_sizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsm2_analysisandhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_analysisandhipsparseSbsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_sizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsm2_analysisandhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_analysisandhipsparseSbsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_sizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrsm2_analysisandhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_analysisandhipsparseSbsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix \(A\).- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix \(A\).- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix \(A\).- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix \(A\).- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix \(A\).- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix \(A\).- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrsm2_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
nnzbblocks of the sparse BSR matrix \(A\).- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix \(A\).- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_solvesolves 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
transXparameter 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_solverequires a user-allocated temporary buffer. Its size is returned byhipsparseSbsrsm2_bufferSize. The size of the required buffer is larger whentransAequalsHIPSPARSE_OPERATION_TRANSPOSEorHIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEand whentransXisHIPSPARSE_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_TRANSPOSEandtransX!=HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEis 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
nnzbblocks of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbcontaining 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nrhs,nnzb,blockDim,alpha,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,B,Xinfo,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transX==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEorhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXcsrmmmultiplies 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array of
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of dimension
ldb*n(\(op(B) == B\)),ldb*kotherwise.- 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,alpha,orbetais nullptr,m,n,k,ornnzis negative,ldborldcis invalid, orcsrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,orCis nullptr.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXcsrmm2multiplies 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array of
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of dimension
ldb*n(\(op(B) == B\)),ldb*kotherwise.- 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnz,ldb,ldc,descrA,alpha,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,beta,orCis invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseScsrsm2_analysis“hipsparseXcsrsm2_analysis()” or `` […]hipsparseXcsrsm2_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseScsrsm2_analysis“hipsparseXcsrsm2_analysis()” orhipsparseScsrsm2_solvecomputation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the CSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXcsrsm2_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsm2_analysisandhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseScsrsm2_analysisandhipsparseScsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsm2_analysisandhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseScsrsm2_analysisandhipsparseScsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsm2_analysisandhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseScsrsm2_analysisandhipsparseScsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrsm2_analysisandhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseScsrsm2_analysisandhipsparseScsrsm2_solve.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsrsm2_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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – IN: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_solvesolves 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 oftransB\[\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_solverequires a user-allocated temporary buffer. Its size is returned byhipsparseScsrsm2_bufferSizeExt. The size of the required buffer is larger whentransAequalsHIPSPARSE_OPERATION_TRANSPOSEorHIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEand whentransBisHIPSPARSE_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_TRANSPOSEandtransB!=HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEis 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
nnzelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix \(A\).- B (
Pointer/object) – INOUT: array of
m\(\times\)nrhselements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nrhs,nnz,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,B,info,orpBufferis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:transA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE,transB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseXgemmimultiplies 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
nnzelements of the sparse CSC matrix \(B\).- cscColPtrB (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix \(B\).- cscRowIndB (
PointerToInt/object) – IN: array of
nnzelements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alphaorbetais nullptr,m,n,k,ornnzis negative,ldaorldcis invalid, orA,cscValB,cscColPtrB,cscRowIndB,orCis nullptr.
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.
hipsparseXgemmimultiplies 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
nnzelements of the sparse CSC matrix \(B\).- cscColPtrB (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix \(B\).- cscRowIndB (
PointerToInt/object) – IN: array of
nnzelements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alphaorbetais nullptr,m,n,k,ornnzis negative,ldaorldcis invalid, orA,cscValB,cscColPtrB,cscRowIndB,orCis nullptr.
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.
hipsparseXgemmimultiplies 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
nnzelements of the sparse CSC matrix \(B\).- cscColPtrB (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix \(B\).- cscRowIndB (
PointerToInt/object) – IN: array of
nnzelements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alphaorbetais nullptr,m,n,k,ornnzis negative,ldaorldcis invalid, orA,cscValB,cscColPtrB,cscRowIndB,orCis nullptr.
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.
hipsparseXgemmimultiplies 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
nnzelements of the sparse CSC matrix \(B\).- cscColPtrB (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix \(B\).- cscRowIndB (
PointerToInt/object) – IN: array of
nnzelements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alphaorbetais nullptr,m,n,k,ornnzis negative,ldaorldcis invalid, orA,cscValB,cscColPtrB,cscRowIndB,orCis nullptr.
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)#
hipsparseXcsrgeamNnzcomputes 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
csrRowPtrChas been allocated with sizem+1.The desired index base in the output CSR matrix is set in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().For a full code example, see
hipsparseScsrgeam().- Note:
As indicated,
nnzTotalDevHostPtrcan point to either host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_GENERALis 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_GENERALis 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+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis 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+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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\).
nnzTotalDevHostPtrcan be a host or device pointer.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrB,ordescrCis nullptr,m,n,nnzA,ornnzBis negative, orcsrRowPtrA,csrColIndA,csrRowPtrB,csrColIndB,csrRowPtrC,ornnzTotalDevHostPtris nullptr.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeammultiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrValA,csrRowPtrA,csrColIndA,beta,descrB,csrValB,csrRowPtrB,csrColIndB,descrC,csrValC,csrRowPtrC,orcsrColIndCis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeammultiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrValA,csrRowPtrA,csrColIndA,beta,descrB,csrValB,csrRowPtrB,csrColIndB,descrC,csrValC,csrRowPtrC,orcsrColIndCis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeammultiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrValA,csrRowPtrA,csrColIndA,beta,descrB,csrValB,csrRowPtrB,csrColIndB,descrC,csrValC,csrRowPtrC,orcsrColIndCis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeammultiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrValA,csrRowPtrA,csrColIndA,beta,descrB,csrValB,csrRowPtrB,csrColIndB,descrC,csrValC,csrRowPtrC,orcsrColIndCis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgeam2Nnz() andhipsparseScsrgeam2“hipsparseXcsrgeam2()”.The temporary storage buffer must be allocated by the user.
- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgeam2Nnz() andhipsparseScsrgeam2“hipsparseXcsrgeam2()”.The temporary storage buffer must be allocated by the user.
- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgeam2Nnz() andhipsparseScsrgeam2“hipsparseXcsrgeam2()”.The temporary storage buffer must be allocated by the user.
- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgeam2Nnz() andhipsparseScsrgeam2“hipsparseXcsrgeam2()”.The temporary storage buffer must be allocated by the user.
- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)#
hipsparseXcsrgeam2Nnzcomputes 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
csrRowPtrChas been allocated with sizem+1.The required buffer size can be obtained byhipsparseScsrgeam2_bufferSizeExt. The desired index base in the output CSR matrix \(C\) is set in thehipsparseMatDescr_tdescrC.SeehipsparseSetMatIndexBase().- Note:
As indicated,
nnzTotalDevHostPtrcan point to either host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
nnzTotalDevHostPtrcan be a host or device pointer.- workspace (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,descrA,csrSortedRowPtrA,csrSortedColIndA,descrB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedRowPtrC,ornnzTotalDevHostPtris invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeam2multiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeam2multiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeam2multiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgeam2multiplies 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrSortedValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(A\).- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrSortedValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrSortedRowPtrB (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(B\).- csrSortedColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrSortedValC (
Pointer/object) – OUT: array of elements of the sparse CSR matrix \(C\).
- csrSortedRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,nnzB,alpha,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,beta,descrB,csrSortedValB,csrSortedRowPtrB,csrSortedColIndB,descrC,csrSortedValC,csrSortedRowPtrC,csrSortedColIndC,orpBufferis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)#
hipsparseXcsrgemmNnzcomputes 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
csrRowPtrChas been allocated with sizem+1.The desired index base in the output CSR matrix \(C\) is set in thehipsparseMatDescr_tdescrC.SeehipsparseSetMatIndexBase().- Note:
As indicated,
nnzTotalDevHostPtrcan point to either host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_TRANSPOSEis supported.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis 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+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis 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+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements 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\).
nnzTotalDevHostPtrcan be a host or device pointer.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrB,ordescrCis nullptr,m,n,k,nnzA,ornnzBis negative, orcsrRowPtrA,csrColIndA,csrRowPtrB,csrColIndB,csrRowPtrC,ornnzTotalDevHostPtris nullptr.HIPSPARSE_STATUS_NOT_SUPPORTED:transAis notHIPSPARSE_OPERATION_NON_TRANSPOSE,transBis notHIPSPARSE_OPERATION_NON_TRANSPOSE, orhipsparseMatrixType_tis notHIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsrgemmmultiplies 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_TRANSPOSEis supported.- Note:
Currently, only
transB==HIPSPARSE_OPERATION_NON_TRANSPOSEis supported.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the sparse CSR matrix \(C\).- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(C\).- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements containing the column indices of the sparse CSR matrix \(C\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,descrA,csrValA,csrRowPtrA,csrColIndA,descrB,csrValB,csrRowPtrB,csrColIndB,descrC,csrValC,csrRowPtrC,orcsrColIndCis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:transA!=HIPSPARSE_OPERATION_NON_TRANSPOSE,transB!=HIPSPARSE_OPERATION_NON_TRANSPOSE, orhipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgemm2Nnz() andhipsparseScsrgemm2“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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnz_D,alpha,beta,descrA,csrRowPtrA,csrColIndA,descrB,csrRowPtrB,csrColIndB,descrD,csrRowPtrD,csrColIndD,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgemm2Nnz() andhipsparseScsrgemm2“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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnz_D,alpha,beta,descrA,csrRowPtrA,csrColIndA,descrB,csrRowPtrB,csrColIndB,descrD,csrRowPtrD,csrColIndD,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgemm2Nnz() andhipsparseScsrgemm2“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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnz_D,alpha,beta,descrA,csrRowPtrA,csrColIndA,descrB,csrRowPtrB,csrColIndB,descrD,csrRowPtrD,csrColIndD,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseXcsrgemm2Nnz() andhipsparseScsrgemm2“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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnz_D,alpha,beta,descrA,csrRowPtrA,csrColIndA,descrB,csrRowPtrB,csrColIndB,descrD,csrRowPtrD,csrColIndD,info,orpBufferSizeInBytesis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)#
hipsparseXcsrgemm2Nnzcomputes 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
csrRowPtrChas been allocated with sizem+1.The required buffer size can be obtained byhipsparseScsrgemm2_bufferSizeExt. The desired index base in the output CSR matrix \(C\) is set in thehipsparseMatDescr_tdescrC.SeehipsparseSetMatIndexBase().- Note:
As indicated,
nnzTotalDevHostPtrcan point to either host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnzD,descrA,csrRowPtrA,csrColIndA,descrB,csrRowPtrB,csrColIndB,descrD,csrRowPtrD,csrColIndD,descrC,csrRowPtrC,nnzTotalDevHostPtr,info,orpBufferis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXcsrgemm2multiplies 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 == 0is invalid.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrValD (
Pointer/object) – IN: array of
nnzDelements of the sparse CSR matrix \(D\).- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the sparse CSR matrix \(C\).- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(C\).- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnzD,alpha,beta,descrA,csrValA,csrRowPtrA,csrColIndA,descrB,csrValB,csrRowPtrB,csrColIndB,descrD,csrValD,csrRowPtrD,csrColIndD,csrValC,csrRowPtrC,csrColIndC,info,orpBufferis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXcsrgemm2multiplies 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 == 0is invalid.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrValD (
Pointer/object) – IN: array of
nnzDelements of the sparse CSR matrix \(D\).- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the sparse CSR matrix \(C\).- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(C\).- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnzD,alpha,beta,descrA,csrValA,csrRowPtrA,csrColIndA,descrB,csrValB,csrRowPtrB,csrColIndB,descrD,csrValD,csrRowPtrD,csrColIndD,csrValC,csrRowPtrC,csrColIndC,info,orpBufferis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXcsrgemm2multiplies 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 == 0is invalid.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrValD (
Pointer/object) – IN: array of
nnzDelements of the sparse CSR matrix \(D\).- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the sparse CSR matrix \(C\).- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(C\).- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnzD,alpha,beta,descrA,csrValA,csrRowPtrA,csrColIndA,descrB,csrValB,csrRowPtrB,csrColIndB,descrD,csrValD,csrRowPtrD,csrColIndD,csrValC,csrRowPtrC,csrColIndC,info,orpBufferis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXcsrgemm2multiplies 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 == 0is invalid.- Note:
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis 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_GENERALis supported.- nnzA (
int) – IN: number of non-zero entries of the sparse CSR matrix \(A\).
- csrValA (
Pointer/object) – IN: array of
nnzAelements of the sparse CSR matrix \(A\).- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements (\(op(A) == A\),k+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\).- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- nnzB (
int) – IN: number of non-zero entries of the sparse CSR matrix \(B\).
- csrValB (
Pointer/object) – IN: array of
nnzBelements of the sparse CSR matrix \(B\).- csrRowPtrB (
PointerToInt/object) – IN: array of
k+1elements (\(op(B) == B\),m+1otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\).- csrColIndB (
PointerToInt/object) – IN: array of
nnzBelements 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_GENERALis supported.- nnzD (
int) – IN: number of non-zero entries of the sparse CSR matrix \(D\).
- csrValD (
Pointer/object) – IN: array of
nnzDelements of the sparse CSR matrix \(D\).- csrRowPtrD (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(D\).- csrColIndD (
PointerToInt/object) – IN: array of
nnzDelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the sparse CSR matrix \(C\).- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix \(C\).- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,k,nnzA,nnzB,nnzD,alpha,beta,descrA,csrValA,csrRowPtrA,csrColIndA,descrB,csrValB,csrRowPtrB,csrColIndB,descrD,csrValD,csrRowPtrD,csrColIndD,csrValC,csrRowPtrC,csrColIndC,info,orpBufferis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsric02_analysis“hipsparseXbsric02_analysis()” or […]hipsparseXbsric02_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsric02_analysis“hipsparseXbsric02_analysis()” orhipsparseSbsric02computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the BSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
If a zero pivot is found,
position=jmeans that either the diagonal blockA(j,j)is missing (structural zero) or the diagonal blockA(j,j)is not positive definite (numerical zero).- Note:
hipsparseXbsric02_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsric02_analysisandhipsparseSbsric02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferSizeInBytesis nullptr,mb,ornnzbis negative, orblockDimis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsric02_analysisandhipsparseSbsric02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferSizeInBytesis nullptr,mb,ornnzbis negative, orblockDimis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsric02_analysisandhipsparseSbsric02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferSizeInBytesis nullptr,mb,ornnzbis negative, orblockDimis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsric02_analysisandhipsparseSbsric02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferSizeInBytesis nullptr,mb,ornnzbis negative, orblockDimis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsric02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsric02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsric02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsric02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,bsrColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXbsric02computes 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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,orbsrColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXbsric02computes 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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,orbsrColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXbsric02computes 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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,orbsrColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXbsric02computes 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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrValA,bsrRowPtrA,orbsrColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrilu02_analysis“hipsparseXbsrilu02_analysis()” […]hipsparseXbsrilu02_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseSbsrilu02_analysis“hipsparseXbsrilu02_analysis()” orhipsparseSbsrilu02computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the BSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis 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_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrilu02_analysisandhipsparseSbsrilu02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrilu02_analysisandhipsparseSbsrilu02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrilu02_analysisandhipsparseSbsrilu02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseSbsrilu02_analysisandhipsparseSbsrilu02.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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrilu02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrilu02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrilu02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseSbsrilu02“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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA,bsrSortedRowPtrA,bsrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXbsrilu02computes 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_ROWor byHIPSPARSE_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*blockDimcontaining the values of the sparse BSR matrix.- bsrSortedRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrSortedColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nnzb,blockDim,descrA,bsrSortedValA_valM,bsrSortedRowPtrA,orbsrSortedColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseScsric02_analysis“hipsparseXcsric02_analysis()” or […]hipsparseXcsric02_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseScsric02_analysis“hipsparseXcsric02_analysis()” orhipsparseScsric02computation. The first zero pivot \(j\) at \(A_{j,j}\) is stored inposition,using the same index base as the CSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXcsric02_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsric02_analysisandhipsparseScsric02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsric02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsric02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsric02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsric02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_analysisperforms the analysis step forhipsparseScsric02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsric02computes 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 tohipsparseScsric02_analysis. This will perform analysis on the sparsity pattern of the matrix. Finally, the user callshipsparseScsric02,hipsparseDcsric02,hipsparseCcsric02,orhipsparseZcsric02to 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 tohipsparseScsric02are 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() afterhipsparseScsric02_analysisand/or the presence of a structural or numerical zero by callinghipsparseXcsric02_zeroPivot() afterhipsparseScsric02: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\) usinghipsparseSetMatDiagType(), which will interpret the matrix \(A\) as having ones on its diagonal (even if no non-zero exists in the sparsity pattern).hipsparseXcsric02computes the Cholesky factorization inplace meaning that the values arraycsrSortedValA_valMof 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA_valM,csrSortedRowPtrA,orcsrSortedColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_zeroPivotreturnsHIPSPARSE_STATUS_ZERO_PIVOTif either a structural or numerical zero has been found duringhipsparseScsrilu02computation.The first zero pivot \(j\) at \(A_{j,j}\) is stored in
position,using the same index base as the CSR matrix.positioncan be in host or device memory. If no zero pivot has been found,positionis set to -1 andHIPSPARSE_STATUS_SUCCESSis returned instead.- Note:
hipsparseXcsrilu02_zeroPivotis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,orpositionis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_ZERO_PIVOT: zero pivot has been found.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_numericBoostenables the user to replace a numerical value in an incomplete LU factorization.tolis used to determine whether a numerical value is replaced byboost_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_boostto 1 or disabled by settingenable_boostto 0.- Note:
tolandboost_valcan 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,info,tol,orboost_valis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseScsrilu02_analysisandhipsparseScsrilu02.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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_analysisandhipsparseScsrilu02.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_analysisperforms the analysis step forhipsparseScsrilu02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_analysisperforms the analysis step forhipsparseScsrilu02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_analysisperforms the analysis step forhipsparseScsrilu02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_analysisperforms the analysis step forhipsparseScsrilu02“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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA,csrSortedRowPtrA,csrSortedColIndA,info,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcsrilu02computes 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 tohipsparseScsrilu02_analysis. This will perform analysis on the sparsity pattern of the matrix. Finally, the user callshipsparseScsrilu02,hipsparseDcsrilu02,hipsparseCcsrilu02,orhipsparseZcsrilu02to 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 tohipsparseScsrilu02are 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() afterhipsparseScsrilu02_analysisand/or the presence of a structural or numerical zero by callinghipsparseXcsrilu02_zeroPivot() afterhipsparseScsrilu02. 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\) usinghipsparseSetMatDiagType(), which will interpret the matrix \(A\) as having ones on its diagonal (even if no nonzero exists in the sparsity pattern).hipsparseXcsrilu02computes the \(LU\) factorization inplace, meaning that the values arraycsrSortedValA_valMof 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_LEVELorHIPSPARSE_SOLVE_POLICY_USE_LEVEL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,nnz,descrA,csrSortedValA_valM,csrSortedRowPtrA,orcsrSortedColIndApointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: Number of bytes of the temporary storage buffer required.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: Number of bytes of the temporary storage buffer required.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: Number of bytes of the temporary storage buffer required.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: Number of bytes of the temporary storage buffer required.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgpsvInterleavedBatchsolves 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:dsfor the lowest diagonals,dlfor the lower diagonals,dfor the main diagonals,dufor the upper diagonals, anddwfor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgpsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: Temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgpsvInterleavedBatchsolves 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:dsfor the lowest diagonals,dlfor the lower diagonals,dfor the main diagonals,dufor the upper diagonals, anddwfor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgpsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: Temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgpsvInterleavedBatchsolves 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:dsfor the lowest diagonals,dlfor the lower diagonals,dfor the main diagonals,dufor the upper diagonals, anddwfor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgpsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: Temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgpsvInterleavedBatchsolves 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:dsfor the lowest diagonals,dlfor the lower diagonals,dfor the main diagonals,dufor the upper diagonals, anddwfor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgpsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgpsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: Temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,alg,batchCount,ds,dl,d,du,dw,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer that is required byhipsparseSgtsv2.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer that is required byhipsparseSgtsv2.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer that is required byhipsparseSgtsv2.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer that is required byhipsparseSgtsv2.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgtsv2solves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgtsv2solves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgtsv2solves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgtsv2solves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseSgtsvInterleavedBatch.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseSgtsvInterleavedBatch.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseSgtsvInterleavedBatch.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsvInterleavedBatch.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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseSgtsvInterleavedBatch.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXgtsvInterleavedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgtsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsvInterleavedBatch.The user can specify different algorithms for
hipsparseXgtsvInterleavedBatchto 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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXgtsvInterleavedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgtsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsvInterleavedBatch.The user can specify different algorithms for
hipsparseXgtsvInterleavedBatchto 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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXgtsvInterleavedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgtsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsvInterleavedBatch.The user can specify different algorithms for
hipsparseXgtsvInterleavedBatchto 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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXgtsvInterleavedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it tohipsparseSgtsvInterleavedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsvInterleavedBatch.The user can specify different algorithms for
hipsparseXgtsvInterleavedBatchto 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
batchCountbym.- batchCount (
int) – IN: The number of systems to solve.
- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,dl,d,du,B,orpBufferSizeInBytesis nullptr,mis less than 2,nis negative, orldbis invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_nopivotsolves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_nopivotsolves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_nopivotsolves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_nopivotsolves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,ldb,dl,d,du,B,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes that is required byhipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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).
hipsparseXgtsv2StridedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it tohipsparseSgtsv2StridedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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).
hipsparseXgtsv2StridedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it tohipsparseSgtsv2StridedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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).
hipsparseXgtsv2StridedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it tohipsparseSgtsv2StridedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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).
hipsparseXgtsv2StridedBatchsolves 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:dlfor the lower diagonals,dfor the main diagonals, anddufor 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_bufferSizeExtto determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it tohipsparseSgtsv2StridedBatchto perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call tohipsparseSgtsv2StridedBatch.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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,batchCount,batchStride,dl,d,du,x,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXbsr2csrconverts a BSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare allocated. Allocation size forcsrRowPtrCis computed by the number of block rows multiplied by the block dimension plus one. Allocation forcsrValCandcsrColIndis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*blockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrC,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCis nullptr,mbornbis negative, orblockDimis invalid.
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.
hipsparseXbsr2csrconverts a BSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare allocated. Allocation size forcsrRowPtrCis computed by the number of block rows multiplied by the block dimension plus one. Allocation forcsrValCandcsrColIndis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*blockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrC,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCis nullptr,mbornbis negative, orblockDimis invalid.
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.
hipsparseXbsr2csrconverts a BSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare allocated. Allocation size forcsrRowPtrCis computed by the number of block rows multiplied by the block dimension plus one. Allocation forcsrValCandcsrColIndis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*blockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrC,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCis nullptr,mbornbis negative, orblockDimis invalid.
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.
hipsparseXbsr2csrconverts a BSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare allocated. Allocation size forcsrRowPtrCis computed by the number of block rows multiplied by the block dimension plus one. Allocation forcsrValCandcsrColIndis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*blockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*blockDim*blockDimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,descrC,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCis nullptr,mbornbis negative, orblockDimis invalid.
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.
hipsparseXcoo2csrconverts 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 callinghipsparseXcoo2csr.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
hipsparseXcoo2csris:\[\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
nnzelements 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+1elements that point to the start of every row of the sparse CSR matrix.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,mornnzis negative,cooRowIndorcsrRowPtris nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
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_bufferSizeExtreturns the size of the temporary storage buffer in bytes required byhipsparseXcoosortByRow() andhipsparseXcoosortByColumn(). 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
nnzelements containing the row indices of the sparse COO matrix.- cooCols (
PointerToInt/object) – IN: array of
nnzelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,cooRows,cooCols,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcoosortByRowsorts a matrix in COO format by row. The sorted permutation vectorPcan be used to obtain sortedcooValarray. In this case,Pmust be initialized as the identity permutation. SeehipsparseCreateIdentityPermutation(). To apply the permutation vector to the COO values, seehipsparseSgthr.hipsparseXcoosortByRowrequires an extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined byhipsparseXcoosort_bufferSizeExt().- Note:
Pcan beNULLif 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
nnzelements containing the row indices of the sparse COO matrix.- cooCols (
PointerToInt/object) – INOUT: array of
nnzelements containing the column indices of the sparse COO matrix.- P (
PointerToInt/object) – INOUT: array of
nnzintegers containing the unsorted map indices. Can beNULL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseXcoosort_bufferSizeExt().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,cooRows,cooCols,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcoosortByColumnsorts a matrix in COO format by column. The sorted permutation vectorPcan be used to obtain the sortedcooValarray. In this case,Pmust be initialized as the identity permutation. SeehipsparseCreateIdentityPermutation(). To apply the permutation vector to the COO values, seehipsparseSgthr.hipsparseXcoosortByColumnrequires an extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined byhipsparseXcoosort_bufferSizeExt().- Note:
Pcan beNULLif 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
nnzelements containing the row indices of the sparse COO matrix.- cooCols (
PointerToInt/object) – INOUT: array of
nnzelements containing the column indices of the sparse COO matrix.- P (
PointerToInt/object) – INOUT: array of
nnzintegers containing the unsorted map indices. Can beNULL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseXcoosort_bufferSizeExt().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,cooRows,cooCols,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseCreateIdentityPermutationstores the identity map inp,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
nintegers containing the map.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,n,orppointer is invalid.
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)#
hipsparseXcsc2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsc2dense.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}\]hipsparseXcsc2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- cscVal (
Pointer/object) – IN: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) non-zero elements of matrixA.- cscRowInd (
PointerToInt/object) – IN: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – IN: integer array of
n+1elements 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 leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,cscVal,cscColPtr,cscRowInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsc2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsc2dense.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}\]hipsparseXcsc2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- cscVal (
Pointer/object) – IN: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) non-zero elements of matrixA.- cscRowInd (
PointerToInt/object) – IN: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – IN: integer array of
n+1elements 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 leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,cscVal,cscColPtr,cscRowInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsc2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsc2dense.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}\]hipsparseXcsc2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- cscVal (
Pointer/object) – IN: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) non-zero elements of matrixA.- cscRowInd (
PointerToInt/object) – IN: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – IN: integer array of
n+1elements 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 leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,cscVal,cscColPtr,cscRowInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsc2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsc2dense.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}\]hipsparseXcsc2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- cscVal (
Pointer/object) – IN: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) non-zero elements of matrixA.- cscRowInd (
PointerToInt/object) – IN: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – IN: integer array of
n+1elements 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 leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,cscVal,cscColPtr,cscRowInd,orAis nullptr,mornis negative, orldis invalid.
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_bufferSizeExtreturns 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+1elements that point to the start of every column of the sparse CSC matrix.- cscRowInd (
PointerToInt/object) – IN: array of
nnzelements containing the row indices of the sparse CSC matrix.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseXcscsort().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,cscColPtr,cscRowInd,orpBufferSizeInBytespointer is invalid.
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
hipsparseXcscsortsorts a matrix in CSC format. The sorted permutation vectorPcan be used to obtain sortedcscValarray. In this case,Pmust be initialized as the identity permutation. SeehipsparseCreateIdentityPermutation(). To apply the permutation vector to the CSC values, seehipsparseSgthr“hipsparseXgthr()”.hipsparseXcscsortrequires extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined byhipsparseXcscsort_bufferSizeExt().- Note:
Pcan beNULLif 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_GENERALis supported.- cscColPtr (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- cscRowInd (
PointerToInt/object) – INOUT: array of
nnzelements containing the row indices of the sparse CSC matrix.- P (
PointerToInt/object) – INOUT: array of
nnzintegers containing the unsorted map indices. Can beNULL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseXcscsort_bufferSizeExt().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,descrA,cscColPtr,cscRowInd,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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
hipsparseXcsr2bsrNnzhas 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
mxnto a BSR matrix, the resulting BSR matrix will have sizembxnbwherembandnbequal:\[\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
blockDimdoes not divide evenly intomand/orn.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 functionhipsparseXcsr2bsrNnzcomputes 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_ROWor byHIPSPARSE_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_GENERALis supported.- csrRowPtrA (
PointerToInt/object) – IN: integer array containing
m+1elements 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_GENERALis supported.- bsrRowPtrC (
PointerToInt/object) – OUT: integer array containing
mb+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,blockDim,csrRowPtrA,csrColIndA,bsrRowPtrC,orbsrNnzbpointer is invalid.
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.
hipsparseXcsr2bsrcompletes the conversion of a CSR matrix into a BSR matrix. It is assumed thatbsrValC,bsrColIndC,andbsrRowPtrCare allocated. The allocation size forbsrRowPtris computed asmb+1,wherembis 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 usinghipsparseXcsr2bsrNnz(), which also fills thebsrRowPtrCarray. The allocation size forbsrValCis 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
hipsparseXcsr2bsrNnzresults 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
hipsparseXcsr2bsrcompletes 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
dirAparameter 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:
hipsparseXcsr2bsrrequires extra temporary storage that is allocated internally ifblockDim> 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_ROWorHIPSPARSE_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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrC (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndC (
PointerToInt/object) – OUT: array of
nnzbelements containing the block column indices of the sparse BSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,blockDim,bsrValC,bsrRowPtrC,bsrColIndC,csrValA,csrRowPtrA,orcsrColIndApointer is invalid.
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.
hipsparseXcsr2bsrcompletes the conversion of a CSR matrix into a BSR matrix. It is assumed thatbsrValC,bsrColIndC,andbsrRowPtrCare allocated. The allocation size forbsrRowPtris computed asmb+1,wherembis 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 usinghipsparseXcsr2bsrNnz(), which also fills thebsrRowPtrCarray. The allocation size forbsrValCis 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
hipsparseXcsr2bsrNnzresults 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
hipsparseXcsr2bsrcompletes 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
dirAparameter 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:
hipsparseXcsr2bsrrequires extra temporary storage that is allocated internally ifblockDim> 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_ROWorHIPSPARSE_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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrC (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndC (
PointerToInt/object) – OUT: array of
nnzbelements containing the block column indices of the sparse BSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,blockDim,bsrValC,bsrRowPtrC,bsrColIndC,csrValA,csrRowPtrA,orcsrColIndApointer is invalid.
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.
hipsparseXcsr2bsrcompletes the conversion of a CSR matrix into a BSR matrix. It is assumed thatbsrValC,bsrColIndC,andbsrRowPtrCare allocated. The allocation size forbsrRowPtris computed asmb+1,wherembis 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 usinghipsparseXcsr2bsrNnz(), which also fills thebsrRowPtrCarray. The allocation size forbsrValCis 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
hipsparseXcsr2bsrNnzresults 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
hipsparseXcsr2bsrcompletes 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
dirAparameter 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:
hipsparseXcsr2bsrrequires extra temporary storage that is allocated internally ifblockDim> 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_ROWorHIPSPARSE_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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrC (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndC (
PointerToInt/object) – OUT: array of
nnzbelements containing the block column indices of the sparse BSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,blockDim,bsrValC,bsrRowPtrC,bsrColIndC,csrValA,csrRowPtrA,orcsrColIndApointer is invalid.
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.
hipsparseXcsr2bsrcompletes the conversion of a CSR matrix into a BSR matrix. It is assumed thatbsrValC,bsrColIndC,andbsrRowPtrCare allocated. The allocation size forbsrRowPtris computed asmb+1,wherembis 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 usinghipsparseXcsr2bsrNnz(), which also fills thebsrRowPtrCarray. The allocation size forbsrValCis 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
hipsparseXcsr2bsrNnzresults 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
hipsparseXcsr2bsrcompletes 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
dirAparameter 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:
hipsparseXcsr2bsrrequires extra temporary storage that is allocated internally ifblockDim> 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_ROWorHIPSPARSE_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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrValC (
Pointer/object) – OUT: array of
nnzb*blockDim*blockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrC (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndC (
PointerToInt/object) – OUT: array of
nnzbelements containing the block column indices of the sparse BSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,blockDim,bsrValC,bsrRowPtrC,bsrColIndC,csrValA,csrRowPtrA,orcsrColIndApointer is invalid.
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.
hipsparseXcsr2cooconverts 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 callinghipsparseXcsr2coo.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
hipsparseXcsr2cooresults 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+1elements 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
nnzelements containing the row indices of the sparse COO matrix.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,mor,nnzis negative,csrRowPtrorcooRowIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.
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.
hipsparseXcsr2cscconverts a CSR matrix into a CSC matrix.hipsparseXcsr2csccan also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscSortedValis 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscSortedVal (
Pointer/object) – OUT: array of
nnzelements of the sparse CSC matrix.- cscSortedRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse CSC matrix.- cscSortedColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,m,n,ornnzis negative,csrSortedVal,csrSortedRowPtr,csrSortedColInd,cscSortedVal,cscSortedRowInd,orcscSortedColPtris nullptr whennnzis greater than zero,copyValuesis neitherHIPSPARSE_ACTION_SYMBOLICnorHIPSPARSE_ACTION_NUMERIC, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcsr2cscconverts a CSR matrix into a CSC matrix.hipsparseXcsr2csccan also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscSortedValis 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscSortedVal (
Pointer/object) – OUT: array of
nnzelements of the sparse CSC matrix.- cscSortedRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse CSC matrix.- cscSortedColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,m,n,ornnzis negative,csrSortedVal,csrSortedRowPtr,csrSortedColInd,cscSortedVal,cscSortedRowInd,orcscSortedColPtris nullptr whennnzis greater than zero,copyValuesis neitherHIPSPARSE_ACTION_SYMBOLICnorHIPSPARSE_ACTION_NUMERIC, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcsr2cscconverts a CSR matrix into a CSC matrix.hipsparseXcsr2csccan also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscSortedValis 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscSortedVal (
Pointer/object) – OUT: array of
nnzelements of the sparse CSC matrix.- cscSortedRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse CSC matrix.- cscSortedColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,m,n,ornnzis negative,csrSortedVal,csrSortedRowPtr,csrSortedColInd,cscSortedVal,cscSortedRowInd,orcscSortedColPtris nullptr whennnzis greater than zero,copyValuesis neitherHIPSPARSE_ACTION_SYMBOLICnorHIPSPARSE_ACTION_NUMERIC, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXcsr2cscconverts a CSR matrix into a CSC matrix.hipsparseXcsr2csccan also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscSortedValis 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
nnzelements of the sparse CSR matrix.- csrSortedRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrSortedColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscSortedVal (
Pointer/object) – OUT: array of
nnzelements of the sparse CSC matrix.- cscSortedRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse CSC matrix.- cscSortedColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: index base.
HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleis nullptr,m,n,ornnzis negative,csrSortedVal,csrSortedRowPtr,csrSortedColInd,cscSortedVal,cscSortedRowInd,orcscSortedColPtris nullptr whennnzis greater than zero,copyValuesis neitherHIPSPARSE_ACTION_SYMBOLICnorHIPSPARSE_ACTION_NUMERIC, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizecalculates the required user allocated temporary buffer needed byhipsparseCsr2cscEx2to convert a CSR matrix into a CSC matrix.hipsparseCsr2cscEx2can also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscValis 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
nnzelements of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscVal (
Pointer/object) – IN: array of
nnzelements of the sparse CSC matrix.- cscColPtr (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- cscRowInd (
PointerToInt/object) – IN: array of
nnzelements containing the row indices of the sparse CSC matrix.- valType (
hipDataType) – IN: The data type of the values arrays
csrValandcscVal.Can be HIP_R_32F, HIP_R_64F, HIP_C_32F, or HIP_C_64F.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseCsr2cscEx2converts a CSR matrix into a CSC matrix.hipsparseCsr2cscEx2can also be used to convert a CSC matrix into a CSR matrix.copyValuesdecides whethercscValis 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
nnzelements of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- cscVal (
Pointer/object) – IN: array of
nnzelements of the sparse CSC matrix.- cscColPtr (
PointerToInt/object) – IN: array of
n+1elements that point to the start of every column of the sparse CSC matrix.- cscRowInd (
PointerToInt/object) – IN: array of
nnzelements containing the row indices of the sparse CSC matrix.- valType (
hipDataType) – IN: The data type of the values arrays
csrValandcscVal.Can be HIP_R_32F, HIP_R_64F, HIP_C_32F, or HIP_C_64F.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_compressconverts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative thresholdtol:\[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
tolis 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
nnzAelements of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the uncompressed sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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
mcontaining the number of entries that will be kept per row in the final compressed CSR matrix.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the compressed sparse CSC matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements containing the row indices of the compressed sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,tol,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,ornnzPerRowpointer is invalid.
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_compressconverts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative thresholdtol:\[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
tolis 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
nnzAelements of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the uncompressed sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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
mcontaining the number of entries that will be kept per row in the final compressed CSR matrix.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the compressed sparse CSC matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements containing the row indices of the compressed sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,tol,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,ornnzPerRowpointer is invalid.
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_compressconverts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative thresholdtol:\[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
tolis 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
nnzAelements of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the uncompressed sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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
mcontaining the number of entries that will be kept per row in the final compressed CSR matrix.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the compressed sparse CSC matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements containing the row indices of the compressed sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,tol,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,ornnzPerRowpointer is invalid.
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_compressconverts a CSR matrix into a compressed CSR matrix by removing entries in the input CSR matrix that are below a non-negative thresholdtol:\[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
tolis 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
nnzAelements of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the uncompressed sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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
mcontaining the number of entries that will be kept per row in the final compressed CSR matrix.- csrValC (
Pointer/object) – OUT: array of
nnzCelements of the compressed sparse CSC matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements containing the row indices of the compressed sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,tol,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,ornnzPerRowpointer is invalid.
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)#
hipsparseXcsr2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsr2dense.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}\]hipsparseXcsr2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- A (
Pointer/object) – OUT: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,csrVal,csrRowPtr,csrColInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsr2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsr2dense.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}\]hipsparseXcsr2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- A (
Pointer/object) – OUT: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,csrVal,csrRowPtr,csrColInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsr2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsr2dense.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}\]hipsparseXcsr2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- A (
Pointer/object) – OUT: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,csrVal,csrRowPtr,csrColInd,orAis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXcsr2densefunctions 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 arrayAsuch thatAhas leading dimensionldand is column ordered. This means thatAhas sizeldxnwhereld>=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 thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase() prior to callinghipsparseXcsr2dense.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}\]hipsparseXcsr2denseis 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
Aarray 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- A (
Pointer/object) – OUT: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,csrVal,csrRowPtr,csrColInd,orAis nullptr,mornis negative, orldis invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr. After the temporary buffer size has been determined, it must be allocated by the user prior to callinghipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr.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_ROWor byHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: integer array containing
m+1elements 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() andhipsparseScsr2gebsr.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,csrVal,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr. After the temporary buffer size has been determined, it must be allocated by the user prior to callinghipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr.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_ROWor byHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: integer array containing
m+1elements 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() andhipsparseScsr2gebsr.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,csrVal,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr. After the temporary buffer size has been determined, it must be allocated by the user prior to callinghipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr.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_ROWor byHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: integer array containing
m+1elements 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() andhipsparseScsr2gebsr.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,csrVal,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr. After the temporary buffer size has been determined, it must be allocated by the user prior to callinghipsparseXcsr2gebsrNnzandhipsparseScsr2gebsr.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_ROWor byHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: integer array containing
m+1elements 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() andhipsparseScsr2gebsr.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,csrVal,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.
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_bufferSizeto determine the size of the required temporary storage buffer. The user then allocates this buffer as well as thebsrRowPtrarray ( sizemb+1) and passes both tohipsparseXcsr2gebsrNnz().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
mxnto a GEBSR matrix, the resulting GEBSR matrix will have sizembxnb,wherembandnbequal:\[\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
bsrRowPtrarray 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,
bsrNnzDevhostcan point either to host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().
It might be the case that
rowBlockDimdoes not divide evenly intomand/or thatcolBlockDimdoes not divide evenly inton.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 withrowBlockDim=2andcolBlockDim=3,the functionhipsparseXcsr2gebsrNnzcomputes 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_ROWor byHIPSPARSE_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_GENERALis supported.- csrRowPtr (
PointerToInt/object) – IN: integer array containing
m+1elements 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_GENERALis supported.- bsrRowPtr (
PointerToInt/object) – OUT: integer array containing
mb+1elements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,csrRowPtr,csrColInd,bsrRowPtr,orbsrNnzDevhostpointer is invalid.
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.
hipsparseXcsr2gebsrconverts a CSR matrix into a GEBSR matrix. It is assumed thatbsrVal,bsrColInd,andbsrRowPtrare allocated. Allocation size forbsrRowPtris computed asmb+1,wherembis the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed usinghipsparseXcsr2gebsrNnz, which also fills inbsrRowPtr.In more detail,
hipsparseXcsr2gebsris 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 usinghipsparseScsr2gebsr_bufferSize. The user then allocates this buffer as well as the row pointer arraybsrRowPtrwith sizemb+1,wherembis the number of block rows in the GEBSR matrix andnbis 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 arraybsrRowPtrand 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 arraybsrColIndwith sizebsrNnzDevhostas well as the GEBSR values arraybsrValwith sizebsrNnzDevhost*rowBlockDim*colBlockDim.Finally, with all arrays allocated, the conversion is completed by callinghipsparseXcsr2gebsr.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=3andcolBlockDim=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
bsrValarrays 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
rowBlockDimdoes not divide evenly intomand/or thatcolBlockDimdoes not divide evenly inton.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 withrowBlockDim=2andcolBlockDim=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_ROWorHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrVal (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtr (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColInd (
PointerToInt/object) – OUT: array of
nnzbelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,bsrVal,bsrRowPtr,bsrColInd,csrVal,csrRowPtr,orcsrColIndpointer is invalid.
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.
hipsparseXcsr2gebsrconverts a CSR matrix into a GEBSR matrix. It is assumed thatbsrVal,bsrColInd,andbsrRowPtrare allocated. Allocation size forbsrRowPtris computed asmb+1,wherembis the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed usinghipsparseXcsr2gebsrNnz, which also fills inbsrRowPtr.In more detail,
hipsparseXcsr2gebsris 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 usinghipsparseScsr2gebsr_bufferSize. The user then allocates this buffer as well as the row pointer arraybsrRowPtrwith sizemb+1,wherembis the number of block rows in the GEBSR matrix andnbis 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 arraybsrRowPtrand 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 arraybsrColIndwith sizebsrNnzDevhostas well as the GEBSR values arraybsrValwith sizebsrNnzDevhost*rowBlockDim*colBlockDim.Finally, with all arrays allocated, the conversion is completed by callinghipsparseXcsr2gebsr.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=3andcolBlockDim=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
bsrValarrays 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
rowBlockDimdoes not divide evenly intomand/or thatcolBlockDimdoes not divide evenly inton.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 withrowBlockDim=2andcolBlockDim=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_ROWorHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrVal (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtr (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColInd (
PointerToInt/object) – OUT: array of
nnzbelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,bsrVal,bsrRowPtr,bsrColInd,csrVal,csrRowPtr,orcsrColIndpointer is invalid.
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.
hipsparseXcsr2gebsrconverts a CSR matrix into a GEBSR matrix. It is assumed thatbsrVal,bsrColInd,andbsrRowPtrare allocated. Allocation size forbsrRowPtris computed asmb+1,wherembis the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed usinghipsparseXcsr2gebsrNnz, which also fills inbsrRowPtr.In more detail,
hipsparseXcsr2gebsris 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 usinghipsparseScsr2gebsr_bufferSize. The user then allocates this buffer as well as the row pointer arraybsrRowPtrwith sizemb+1,wherembis the number of block rows in the GEBSR matrix andnbis 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 arraybsrRowPtrand 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 arraybsrColIndwith sizebsrNnzDevhostas well as the GEBSR values arraybsrValwith sizebsrNnzDevhost*rowBlockDim*colBlockDim.Finally, with all arrays allocated, the conversion is completed by callinghipsparseXcsr2gebsr.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=3andcolBlockDim=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
bsrValarrays 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
rowBlockDimdoes not divide evenly intomand/or thatcolBlockDimdoes not divide evenly inton.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 withrowBlockDim=2andcolBlockDim=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_ROWorHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrVal (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtr (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColInd (
PointerToInt/object) – OUT: array of
nnzbelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,bsrVal,bsrRowPtr,bsrColInd,csrVal,csrRowPtr,orcsrColIndpointer is invalid.
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.
hipsparseXcsr2gebsrconverts a CSR matrix into a GEBSR matrix. It is assumed thatbsrVal,bsrColInd,andbsrRowPtrare allocated. Allocation size forbsrRowPtris computed asmb+1,wherembis the number of block rows in the GEBSR matrix. The number of non-zero blocks in the resulting GEBSR matrix is computed usinghipsparseXcsr2gebsrNnz, which also fills inbsrRowPtr.In more detail,
hipsparseXcsr2gebsris 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 usinghipsparseScsr2gebsr_bufferSize. The user then allocates this buffer as well as the row pointer arraybsrRowPtrwith sizemb+1,wherembis the number of block rows in the GEBSR matrix andnbis 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 arraybsrRowPtrand 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 arraybsrColIndwith sizebsrNnzDevhostas well as the GEBSR values arraybsrValwith sizebsrNnzDevhost*rowBlockDim*colBlockDim.Finally, with all arrays allocated, the conversion is completed by callinghipsparseXcsr2gebsr.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=3andcolBlockDim=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
bsrValarrays 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
rowBlockDimdoes not divide evenly intomand/or thatcolBlockDimdoes not divide evenly inton.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 withrowBlockDim=2andcolBlockDim=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_ROWorHIPSPARSE_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_GENERALis supported.- csrVal (
Pointer/object) – IN: array of
nnzelements containing the values of the sparse CSR matrix.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements 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_GENERALis supported.- bsrVal (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtr (
PointerToInt/object) – OUT: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColInd (
PointerToInt/object) – OUT: array of
nnzbelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,rowBlockDim,colBlockDim,bsrVal,bsrRowPtr,bsrColInd,csrVal,csrRowPtr,orcsrColIndpointer is invalid.
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.
hipsparseXcsr2hybconverts a CSR matrix into a HYB matrix. It is assumed thathybhas been initialized withhipsparseCreateHybMat().- 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array containing the values of the sparse CSR matrix.
- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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, orHIPSPARSE_HYB_PARTITION_MAX.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr,mornis negative, oruserEllWidthorpartitionTypeis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the HYB matrix could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsr2hybconverts a CSR matrix into a HYB matrix. It is assumed thathybhas been initialized withhipsparseCreateHybMat().- 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array containing the values of the sparse CSR matrix.
- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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, orHIPSPARSE_HYB_PARTITION_MAX.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr,mornis negative, oruserEllWidthorpartitionTypeis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the HYB matrix could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsr2hybconverts a CSR matrix into a HYB matrix. It is assumed thathybhas been initialized withhipsparseCreateHybMat().- 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array containing the values of the sparse CSR matrix.
- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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, orHIPSPARSE_HYB_PARTITION_MAX.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr,mornis negative, oruserEllWidthorpartitionTypeis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the HYB matrix could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXcsr2hybconverts a CSR matrix into a HYB matrix. It is assumed thathybhas been initialized withhipsparseCreateHybMat().- 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_GENERALis supported.- csrSortedValA (
Pointer/object) – IN: array containing the values of the sparse CSR matrix.
- csrSortedRowPtrA (
PointerToInt/object) – IN: array of
m+1elements 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, orHIPSPARSE_HYB_PARTITION_MAX.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr,mornis negative, oruserEllWidthorpartitionTypeis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: the buffer for the HYB matrix could not be allocated.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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_bufferSizeExtreturns 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+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – IN: array of
nnzelements containing the column indices of the sparse CSR matrix.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by
hipsparseXcsrsort().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,csrRowPtr,csrColInd,orpBufferSizeInBytespointer is invalid.
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.
hipsparseXcsrsortsorts a matrix in CSR format. The sorted permutation vectorPcan be used to obtain the sortedcsrValarray. In this case,Pmust be initialized as the identity permutation. SeehipsparseCreateIdentityPermutation(). To apply the permutation vector to the CSR values, seehipsparseSgthr“hipsparseXgthr()”.hipsparseXcsrsortrequires extra temporary storage buffer that must be allocated by the user. The storage buffer size can be determined by hipsparseXcsrsort_bufferSizeExt().- Note:
Pcan beNULLif 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_GENERALis supported.- csrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColInd (
PointerToInt/object) – INOUT: array of
nnzelements containing the column indices of the sparse CSR matrix.- P (
PointerToInt/object) – INOUT: array of
nnzintegers containing the unsorted map indices. Can beNULL.- pBuffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseXcsrsort_bufferSizeExt().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnz,descrA,csrRowPtr,csrColInd,orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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()andhipsparseXcsr2csru().- 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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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()andhipsparseXcsr2csru().- 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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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()andhipsparseXcsr2csru().- 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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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()andhipsparseXcsr2csru().- 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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)#
hipsparseXdense2cscfunctions convert the matrixAin dense format into a sparse matrix in CSC format.Given a dense, column-ordered, matrix
Awith leading dimensionld,whereld>=m,hipsparseXdense2cscconverts 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 withhipsparseSnnz. Users can set the desired index base in the output CSC matrix by setting it in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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
Avalues have column ordering with leading dimensionld=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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.- nnzPerColumn (
PointerToInt/object) – IN: array of size
ncontaining the number of non-zero elements per column.- cscVal (
Pointer/object) – OUT: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) nonzero elements of matrixA.- cscRowInd (
PointerToInt/object) – OUT: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – OUT: integer array of
n+1elements that contains the start of every column and the end of the last column plus one.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerColumn,cscVal,cscColPtr,orcscRowIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2cscfunctions convert the matrixAin dense format into a sparse matrix in CSC format.Given a dense, column-ordered, matrix
Awith leading dimensionld,whereld>=m,hipsparseXdense2cscconverts 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 withhipsparseSnnz. Users can set the desired index base in the output CSC matrix by setting it in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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
Avalues have column ordering with leading dimensionld=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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.- nnzPerColumn (
PointerToInt/object) – IN: array of size
ncontaining the number of non-zero elements per column.- cscVal (
Pointer/object) – OUT: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) nonzero elements of matrixA.- cscRowInd (
PointerToInt/object) – OUT: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – OUT: integer array of
n+1elements that contains the start of every column and the end of the last column plus one.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerColumn,cscVal,cscColPtr,orcscRowIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2cscfunctions convert the matrixAin dense format into a sparse matrix in CSC format.Given a dense, column-ordered, matrix
Awith leading dimensionld,whereld>=m,hipsparseXdense2cscconverts 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 withhipsparseSnnz. Users can set the desired index base in the output CSC matrix by setting it in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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
Avalues have column ordering with leading dimensionld=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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.- nnzPerColumn (
PointerToInt/object) – IN: array of size
ncontaining the number of non-zero elements per column.- cscVal (
Pointer/object) – OUT: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) nonzero elements of matrixA.- cscRowInd (
PointerToInt/object) – OUT: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – OUT: integer array of
n+1elements that contains the start of every column and the end of the last column plus one.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerColumn,cscVal,cscColPtr,orcscRowIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2cscfunctions convert the matrixAin dense format into a sparse matrix in CSC format.Given a dense, column-ordered, matrix
Awith leading dimensionld,whereld>=m,hipsparseXdense2cscconverts 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 withhipsparseSnnz. Users can set the desired index base in the output CSC matrix by setting it in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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
Avalues have column ordering with leading dimensionld=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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A.Must be at leastm.- nnzPerColumn (
PointerToInt/object) – IN: array of size
ncontaining the number of non-zero elements per column.- cscVal (
Pointer/object) – OUT: array of nnz ( =
cscColPtr[n]-cscColPtr[0]) nonzero elements of matrixA.- cscRowInd (
PointerToInt/object) – OUT: integer array of nnz ( =
cscColPtr[n]-cscColPtr[0]) column indices of the non-zero elements of matrixA.- cscColPtr (
PointerToInt/object) – OUT: integer array of
n+1elements that contains the start of every column and the end of the last column plus one.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerColumn,cscVal,cscColPtr,orcscRowIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2csrconverts the matrixAin dense format into a sparse matrix in CSR format.Given a dense, column-ordered matrix
Awith leading dimensionldwhereld>=m,hipsparseXdense2csrconverts 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 withhipsparseSnnz. The desired index base in the output CSR matrix is set in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A,which must be at leastm.- nnzPerRow (
PointerToInt/object) – IN: array of size
mcontaining the number of non-zero elements per row.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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 matrixA.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerRow,csrVal,csrRowPtr,orcsrColIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2csrconverts the matrixAin dense format into a sparse matrix in CSR format.Given a dense, column-ordered matrix
Awith leading dimensionldwhereld>=m,hipsparseXdense2csrconverts 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 withhipsparseSnnz. The desired index base in the output CSR matrix is set in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A,which must be at leastm.- nnzPerRow (
PointerToInt/object) – IN: array of size
mcontaining the number of non-zero elements per row.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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 matrixA.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerRow,csrVal,csrRowPtr,orcsrColIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2csrconverts the matrixAin dense format into a sparse matrix in CSR format.Given a dense, column-ordered matrix
Awith leading dimensionldwhereld>=m,hipsparseXdense2csrconverts 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 withhipsparseSnnz. The desired index base in the output CSR matrix is set in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A,which must be at leastm.- nnzPerRow (
PointerToInt/object) – IN: array of size
mcontaining the number of non-zero elements per row.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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 matrixA.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerRow,csrVal,csrRowPtr,orcsrColIndis nullptr,mornis negative, orldis invalid.
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)#
hipsparseXdense2csrconverts the matrixAin dense format into a sparse matrix in CSR format.Given a dense, column-ordered matrix
Awith leading dimensionldwhereld>=m,hipsparseXdense2csrconverts 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 withhipsparseSnnz. The desired index base in the output CSR matrix is set in thehipsparseMatDescr_t. SeehipsparseSetMatIndexBase().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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- A (
Pointer/object) – IN: array of dimensions (
ld,n).- ld (
int) – IN: leading dimension of dense array
A,which must be at leastm.- nnzPerRow (
PointerToInt/object) – IN: array of size
mcontaining the number of non-zero elements per row.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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 matrixA.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descr,A,nnzPerRow,csrVal,csrRowPtr,orcsrColIndis nullptr,mornis negative, orldis invalid.
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.
hipsparseXgebsr2csrconverts a GEBSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare already allocated prior to callinghipsparseXgebsr2csr.Allocation size forcsrRowPtrCequalsm+1where:\[\begin{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]Allocation size for
csrValCandcsrColIndCis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*rowBlockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,block_dim,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCpointer is invalid.
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.
hipsparseXgebsr2csrconverts a GEBSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare already allocated prior to callinghipsparseXgebsr2csr.Allocation size forcsrRowPtrCequalsm+1where:\[\begin{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]Allocation size for
csrValCandcsrColIndCis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*rowBlockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,block_dim,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCpointer is invalid.
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.
hipsparseXgebsr2csrconverts a GEBSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare already allocated prior to callinghipsparseXgebsr2csr.Allocation size forcsrRowPtrCequalsm+1where:\[\begin{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]Allocation size for
csrValCandcsrColIndCis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*rowBlockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,block_dim,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCpointer is invalid.
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.
hipsparseXgebsr2csrconverts a GEBSR matrix into a CSR matrix. It is assumed thatcsrValC,csrColIndC,andcsrRowPtrCare already allocated prior to callinghipsparseXgebsr2csr.Allocation size forcsrRowPtrCequalsm+1where:\[\begin{split}\begin{align} \text{m} &= \text{mb * rowBlockDim} \\ \text{n} &= \text{nb * colBlockDim} \end{align}\end{split}\]Allocation size for
csrValCandcsrColIndCis 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_ROWorHIPSPARSE_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_GENERALis supported.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDim*colBlockDimcontaining the values of the sparse BSR matrix.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse BSR matrix.- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzb*rowBlockDim*colBlockDimelements containing the values of the sparse CSR matrix.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1wherem=mb*rowBlockDimelements that point to the start of every row of the sparse CSR matrix.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzb*block_dim*block_dimelements containing the column indices of the sparse CSR matrix.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,block_dim,bsrValA,bsrRowPtrA,bsrColIndA,csrValC,csrRowPtrC,orcsrColIndCpointer is invalid.
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_bufferSizereturns the size of the temporary storage buffer required byhipsparseSgebsr2gebsc. 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*colBlockDimcontaining the values of the sparse General BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every row of the sparse General BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrRowPtr,bsrColInd,orpBufferSizeInBytespointer is invalid.rocsparse_status_internal_error: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer required byhipsparseSgebsr2gebsc. 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*colBlockDimcontaining the values of the sparse General BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every row of the sparse General BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrRowPtr,bsrColInd,orpBufferSizeInBytespointer is invalid.rocsparse_status_internal_error: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer required byhipsparseSgebsr2gebsc. 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*colBlockDimcontaining the values of the sparse General BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every row of the sparse General BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrRowPtr,bsrColInd,orpBufferSizeInBytespointer is invalid.rocsparse_status_internal_error: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer required byhipsparseSgebsr2gebsc. 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*colBlockDimcontaining the values of the sparse General BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every row of the sparse General BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrRowPtr,bsrColInd,orpBufferSizeInBytespointer is invalid.rocsparse_status_internal_error: an internal error occurred.
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
hipsparseXgebsr2gebscconverts a GEBSR matrix into a GEBSC matrix.hipsparseXgebsr2gebsccan also be used to convert a GEBSC matrix into a GEBSR matrix.copyValuesdecides whetherbscValis being filled during conversion (HIPSPARSE_ACTION_NUMERIC) or not (HIPSPARSE_ACTION_SYMBOLIC).hipsparseXgebsr2gebscrequires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined byhipsparseSgebsr2gebsc_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*colBlockDimelements of the sparse general BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse general BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzelements 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
nnzelements of the sparse BSC matrix.- bscRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse BSC matrix.- bscColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse BSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- temp_buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSgebsr2gebsc_bufferSize.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrVal,bsrRowPtr,bsrColInd,bscVal,bscRowInd,bscColPtr,ortemp_bufferpointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgebsr2gebscconverts a GEBSR matrix into a GEBSC matrix.hipsparseXgebsr2gebsccan also be used to convert a GEBSC matrix into a GEBSR matrix.copyValuesdecides whetherbscValis being filled during conversion (HIPSPARSE_ACTION_NUMERIC) or not (HIPSPARSE_ACTION_SYMBOLIC).hipsparseXgebsr2gebscrequires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined byhipsparseSgebsr2gebsc_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*colBlockDimelements of the sparse general BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse general BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzelements 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
nnzelements of the sparse BSC matrix.- bscRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse BSC matrix.- bscColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse BSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- temp_buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSgebsr2gebsc_bufferSize.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrVal,bsrRowPtr,bsrColInd,bscVal,bscRowInd,bscColPtr,ortemp_bufferpointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgebsr2gebscconverts a GEBSR matrix into a GEBSC matrix.hipsparseXgebsr2gebsccan also be used to convert a GEBSC matrix into a GEBSR matrix.copyValuesdecides whetherbscValis being filled during conversion (HIPSPARSE_ACTION_NUMERIC) or not (HIPSPARSE_ACTION_SYMBOLIC).hipsparseXgebsr2gebscrequires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined byhipsparseSgebsr2gebsc_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*colBlockDimelements of the sparse general BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse general BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzelements 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
nnzelements of the sparse BSC matrix.- bscRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse BSC matrix.- bscColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse BSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- temp_buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSgebsr2gebsc_bufferSize.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrVal,bsrRowPtr,bsrColInd,bscVal,bscRowInd,bscColPtr,ortemp_bufferpointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
hipsparseXgebsr2gebscconverts a GEBSR matrix into a GEBSC matrix.hipsparseXgebsr2gebsccan also be used to convert a GEBSC matrix into a GEBSR matrix.copyValuesdecides whetherbscValis being filled during conversion (HIPSPARSE_ACTION_NUMERIC) or not (HIPSPARSE_ACTION_SYMBOLIC).hipsparseXgebsr2gebscrequires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined byhipsparseSgebsr2gebsc_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*colBlockDimelements of the sparse general BSR matrix.- bsrRowPtr (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse general BSR matrix.- bsrColInd (
PointerToInt/object) – IN: array of
nnzelements 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
nnzelements of the sparse BSC matrix.- bscRowInd (
PointerToInt/object) – OUT: array of
nnzelements containing the row indices of the sparse BSC matrix.- bscColPtr (
PointerToInt/object) – OUT: array of
n+1elements that point to the start of every column of the sparse BSC matrix.- copyValues (
hipsparseAction_t) – IN: HIPSPARSE_ACTION_SYMBOLICorHIPSPARSE_ACTION_NUMERIC.- idxBase (
hipsparseIndexBase_t) – IN: HIPSPARSE_INDEX_BASE_ZEROorHIPSPARSE_INDEX_BASE_ONE.- temp_buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSgebsr2gebsc_bufferSize.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,bsrVal,bsrRowPtr,bsrColInd,bscVal,bscRowInd,bscColPtr,ortemp_bufferpointer is invalid.HIPSPARSE_STATUS_ARCH_MISMATCH: the device is not supported.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary storage buffer that is required byhipsparseXgebsr2gebsrNnz() andhipsparseSgebsr2gebsr. 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_ROWorHIPSPARSE_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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,descrA,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary storage buffer that is required byhipsparseXgebsr2gebsrNnz() andhipsparseSgebsr2gebsr. 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_ROWorHIPSPARSE_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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,descrA,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary storage buffer that is required byhipsparseXgebsr2gebsrNnz() andhipsparseSgebsr2gebsr. 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_ROWorHIPSPARSE_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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,descrA,orpBufferSizeInBytespointer is invalid.
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_bufferSizereturns the size of the temporary storage buffer that is required byhipsparseXgebsr2gebsrNnz() andhipsparseSgebsr2gebsr. 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_ROWorHIPSPARSE_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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,descrA,orpBufferSizeInBytespointer is invalid.
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_ROWorHIPSPARSE_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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements containing the block column indices of the sparse general BSR matrixA.- 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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrRowPtrC (
PointerToInt/object) – IN: array of
mbC+1elements that point to the start of every block row of the sparse general BSR matrix \(C\) wherembC= (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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,bsrRowPtrC,descrA,descrC,bufferpointer is invalid.
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 allocatesmbC+1integers 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 havennzbCelements and space for the values array of \(C\) to havennzbC*rowBlockDimC*colBlockDimCand then callshipsparseXgebsr2gebsrto complete the conversion.It could be the case that
rowBlockDimCdoes not divide evenly intomorcolBlockDimdoes not divide evenly inton.In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (usingrowBlockDimA=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=3andcolBlockDimC=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_ROWorHIPSPARSE_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_GENERALand also any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValC (
Pointer/object) – IN: array of
nnzbC*rowBlockDimC*colBlockDimCcontaining the values of the sparse general BSR matrix \(C\).- bsrRowPtrC (
PointerToInt/object) – IN: array of
mbC+1elements that point to the start of every block row of the sparse general BSR matrix \(C\).- bsrColIndC (
PointerToInt/object) – IN: array of
nnzbCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,bsrValA,bsrRowPtrC,bsrColIndC,bsrValC,descrA,descrC,orbufferpointer is invalid.
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 allocatesmbC+1integers 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 havennzbCelements and space for the values array of \(C\) to havennzbC*rowBlockDimC*colBlockDimCand then callshipsparseXgebsr2gebsrto complete the conversion.It could be the case that
rowBlockDimCdoes not divide evenly intomorcolBlockDimdoes not divide evenly inton.In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (usingrowBlockDimA=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=3andcolBlockDimC=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_ROWorHIPSPARSE_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_GENERALand also any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValC (
Pointer/object) – IN: array of
nnzbC*rowBlockDimC*colBlockDimCcontaining the values of the sparse general BSR matrix \(C\).- bsrRowPtrC (
PointerToInt/object) – IN: array of
mbC+1elements that point to the start of every block row of the sparse general BSR matrix \(C\).- bsrColIndC (
PointerToInt/object) – IN: array of
nnzbCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,bsrValA,bsrRowPtrC,bsrColIndC,bsrValC,descrA,descrC,orbufferpointer is invalid.
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 allocatesmbC+1integers 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 havennzbCelements and space for the values array of \(C\) to havennzbC*rowBlockDimC*colBlockDimCand then callshipsparseXgebsr2gebsrto complete the conversion.It could be the case that
rowBlockDimCdoes not divide evenly intomorcolBlockDimdoes not divide evenly inton.In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (usingrowBlockDimA=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=3andcolBlockDimC=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_ROWorHIPSPARSE_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_GENERALand also any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValC (
Pointer/object) – IN: array of
nnzbC*rowBlockDimC*colBlockDimCcontaining the values of the sparse general BSR matrix \(C\).- bsrRowPtrC (
PointerToInt/object) – IN: array of
mbC+1elements that point to the start of every block row of the sparse general BSR matrix \(C\).- bsrColIndC (
PointerToInt/object) – IN: array of
nnzbCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,bsrValA,bsrRowPtrC,bsrColIndC,bsrValC,descrA,descrC,orbufferpointer is invalid.
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 allocatesmbC+1integers 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 havennzbCelements and space for the values array of \(C\) to havennzbC*rowBlockDimC*colBlockDimCand then callshipsparseXgebsr2gebsrto complete the conversion.It could be the case that
rowBlockDimCdoes not divide evenly intomorcolBlockDimdoes not divide evenly inton.In these cases, the GEBSR matrix is expanded in size to fit full GEBSR blocks. For example, if the original GEBSR matrix A (usingrowBlockDimA=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=3andcolBlockDimC=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_ROWorHIPSPARSE_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_GENERALand also any valid value of thehipsparseIndexBase_t.- bsrValA (
Pointer/object) – IN: array of
nnzb*rowBlockDimA*colBlockDimAcontaining the values of the sparse general BSR matrix \(A\).- bsrRowPtrA (
PointerToInt/object) – IN: array of
mb+1elements that point to the start of every block row of the sparse general BSR matrix \(A\).- bsrColIndA (
PointerToInt/object) – IN: array of
nnzbelements 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_GENERALand any valid value of thehipsparseIndexBase_t.- bsrValC (
Pointer/object) – IN: array of
nnzbC*rowBlockDimC*colBlockDimCcontaining the values of the sparse general BSR matrix \(C\).- bsrRowPtrC (
PointerToInt/object) – IN: array of
mbC+1elements that point to the start of every block row of the sparse general BSR matrix \(C\).- bsrColIndC (
PointerToInt/object) – IN: array of
nnzbCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,mb,nb,nnzb,rowBlockDimA,colBlockDimA,rowBlockDimC,colBlockDimC,bsrRowPtrA,bsrColIndA,bsrValA,bsrRowPtrC,bsrColIndC,bsrValC,descrA,descrC,orbufferpointer is invalid.
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.
hipsparseXhyb2csrconverts 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_GENERALis 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+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXhyb2csrconverts 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_GENERALis 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+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXhyb2csrconverts 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_GENERALis 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+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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.
hipsparseXhyb2csrconverts 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_GENERALis 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+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,hybA,csrSortedValA,csrSortedRowPtrA,orcsrSortedColIndAis nullptr.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.HIPSPARSE_STATUS_NOT_SUPPORTED:hipsparseMatrixType_t!=HIPSPARSE_MATRIX_TYPE_GENERAL.
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)#
hipsparseXnnzcomputes 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_ROWresults 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_COLUMNresults 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,
nnzTotalDevHostPtrcan point either to host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_ROWor byHIPSPARSE_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 leastm.- nnzPerRowColumn (
PointerToInt/object) – OUT: array of size
morncontaining 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,A,nnzPerRowColumn,ornnzTotalDevHostPtris nullptr,mornis negative, orldais invalid.
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)#
hipsparseXnnzcomputes 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_ROWresults 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_COLUMNresults 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,
nnzTotalDevHostPtrcan point either to host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_ROWor byHIPSPARSE_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 leastm.- nnzPerRowColumn (
PointerToInt/object) – OUT: array of size
morncontaining 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,A,nnzPerRowColumn,ornnzTotalDevHostPtris nullptr,mornis negative, orldais invalid.
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)#
hipsparseXnnzcomputes 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_ROWresults 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_COLUMNresults 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,
nnzTotalDevHostPtrcan point either to host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_ROWor byHIPSPARSE_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 leastm.- nnzPerRowColumn (
PointerToInt/object) – OUT: array of size
morncontaining 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,A,nnzPerRowColumn,ornnzTotalDevHostPtris nullptr,mornis negative, orldais invalid.
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)#
hipsparseXnnzcomputes 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_ROWresults 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_COLUMNresults 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,
nnzTotalDevHostPtrcan point either to host or device memory. This is controlled by setting the pointer mode. SeehipsparseSetPointerMode().- 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_ROWor byHIPSPARSE_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 leastm.- nnzPerRowColumn (
PointerToInt/object) – OUT: array of size
morncontaining 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,A,nnzPerRowColumn,ornnzTotalDevHostPtris nullptr,mornis negative, orldais invalid.
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
tolis 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
nnzAelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the uncompressed sparse CSR matrix.- nnzPerRow (
PointerToInt/object) – OUT: array of length
mcontaining 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,tol,csrValA,csrRowPtrA,nnzPerRow,ornnzCpointer is invalid.
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
tolis 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
nnzAelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the uncompressed sparse CSR matrix.- nnzPerRow (
PointerToInt/object) – OUT: array of length
mcontaining 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,tol,csrValA,csrRowPtrA,nnzPerRow,ornnzCpointer is invalid.
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
tolis 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
nnzAelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the uncompressed sparse CSR matrix.- nnzPerRow (
PointerToInt/object) – OUT: array of length
mcontaining 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,tol,csrValA,csrRowPtrA,nnzPerRow,ornnzCpointer is invalid.
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
tolis 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
nnzAelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the uncompressed sparse CSR matrix.- nnzPerRow (
PointerToInt/object) – OUT: array of length
mcontaining 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
tolis 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,tol,csrValA,csrRowPtrA,nnzPerRow,ornnzCpointer is invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXpruneCsr2csrNnzandhipsparseXpruneCsr2csr.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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseXpruneCsr2csrNnzandhipsparseXpruneCsr2csr.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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzandhipsparseSpruneCsr2csr. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzandhipsparseSpruneCsr2csr. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXpruneCsr2csrNnzcomputes 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,threshold,descrA,descrC,csrValA,csrRowPtrA,csrColIndA,csrRowPtrC,nnzTotalDevHostPtr,orbufferpointer is invalid.
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.
hipsparseXpruneCsr2csrNnzcomputes 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,threshold,descrA,descrC,csrValA,csrRowPtrA,csrColIndA,csrRowPtrC,nnzTotalDevHostPtr,orbufferpointer is invalid.
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_bufferSizeto determine the size of the buffer used byhipsparseSpruneCsr2csrNnzandhipsparseXpruneCsr2csr(),which the user then allocates. The user then allocatescsrRowPtrCto havem+1elements and then calls hipsparseXpruneCsr2csrNnz(), which fills in thecsrRowPtrCarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then callshipsparseXpruneCsr2csr()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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,threshold,descrA,descrC,csrValA,csrRowPtrA,csrcolindA,csrvalC,csrrowptrC,csrcolIndC,orbufferpointer is invalid.
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_bufferSizeto determine the size of the buffer used byhipsparseSpruneCsr2csrNnzandhipsparseXpruneCsr2csr(),which the user then allocates. The user then allocatescsrRowPtrCto havem+1elements and then calls hipsparseXpruneCsr2csrNnz(), which fills in thecsrRowPtrCarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then callshipsparseXpruneCsr2csr()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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements 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_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – OUT: array of
nnzCelements 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()”.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,threshold,descrA,descrC,csrValA,csrRowPtrA,csrcolindA,csrvalC,csrrowptrC,csrcolIndC,orbufferpointer is invalid.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzByPercentage. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizereturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzByPercentage. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzByPercentage. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizeExtreturns the size of the temporary buffer that is required byhipsparseSpruneCsr2csrNnzByPercentage. 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – IN: array of
nnzCelements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – IN: array of
nnzCelements 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().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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.
hipsparseXpruneCsr2csrNnzByPercentagecomputes 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,percentage,descrA,descrC,info,csrValA,csrRowPtrA,csrColIndA,csrRowPtrC,nnzTotalDevHostPtr,orbufferpointer is invalid.
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.
hipsparseXpruneCsr2csrNnzByPercentagecomputes 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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrRowPtrC (
PointerToInt/object) – OUT: array of
m+1elements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,percentage,descrA,descrC,info,csrValA,csrRowPtrA,csrColIndA,csrRowPtrC,nnzTotalDevHostPtr,orbufferpointer is invalid.
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_bufferSizeto determine the size of the buffer used byhipsparseSpruneCsr2csrNnzandhipsparseXpruneCsr2csr(),which the user then allocates. The user then allocatescsrRowPtrCto havem+1elements and then callshipsparseSpruneCsr2csrNnzwhich fills in thecsrRowPtrCarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then callshipsparseXpruneCsr2csr()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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnz_Celements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – OUT: array of
nnz_Celements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,percentage,descrA,descrC,info,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,orbufferpointer is invalid.
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_bufferSizeto determine the size of the buffer used byhipsparseSpruneCsr2csrNnzandhipsparseXpruneCsr2csr(),which the user then allocates. The user then allocatescsrRowPtrCto havem+1elements and then callshipsparseSpruneCsr2csrNnzwhich fills in thecsrRowPtrCarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then callshipsparseXpruneCsr2csr()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_GENERALis supported.- csrValA (
Pointer/object) – IN: array of
nnzAelements containing the values of the sparse CSR matrix A.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix A.- csrColIndA (
PointerToInt/object) – IN: array of
nnzAelements containing the column indices of the sparse CSR matrix A.- percentage (
float/int) – IN: percentage>=0andpercentage<=100.- descrC (
Pointer/object) – IN: descriptor of the sparse CSR matrix C. Currently, only
HIPSPARSE_MATRIX_TYPE_GENERALis supported.- csrValC (
Pointer/object) – OUT: array of
nnz_Celements containing the values of the sparse CSR matrix C.- csrRowPtrC (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix C.- csrColIndC (
PointerToInt/object) – OUT: array of
nnz_Celements 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,nnzA,percentage,descrA,descrC,info,csrValA,csrRowPtrA,csrColIndA,csrValC,csrRowPtrC,csrColIndC,orbufferpointer is invalid.
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_bufferSizecomputes 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,wherelda>=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 leastm.- 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytesis nullptr, ormornis negative.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizecomputes 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,wherelda>=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 leastm.- 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytesis nullptr, ormornis negative.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizecomputes 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,wherelda>=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 leastm.- 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytesis nullptr, ormornis negative.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizecomputes 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,wherelda>=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 leastm.- 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnz(), hipsparseDpruneDense2csrNnz(), hipsparseSpruneDense2csr(), and hipsparseDpruneDense2csr().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handleorpBufferSizeInBytesis nullptr, ormornis negative.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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)#
hipsparseXpruneDense2csrNnzcomputes 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 dimensionldawherelda>=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_bufferSizeand then allocate it. Next, the user allocatescsrRowPtrwith sizem+1.Then the function passes both the temporary storage buffer andcsrRowPtrtohipsparseXpruneDense2csrNnzto determine the total number of non-zeros that will exist in the sparse CSR matrix C (after pruning has been performed onA) as well as fill the output CSR row pointer arraycsrRowPtr.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
thresholdvalue 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+1elements 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_bufferSizeorhipsparseSpruneDense2csr_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,A,threshold,descr,csrRowPtr,nnzTotalDevHostPtr,orbufferpointer is invalid.
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)#
hipsparseXpruneDense2csrNnzcomputes 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 dimensionldawherelda>=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_bufferSizeand then allocate it. Next, the user allocatescsrRowPtrwith sizem+1.Then the function passes both the temporary storage buffer andcsrRowPtrtohipsparseXpruneDense2csrNnzto determine the total number of non-zeros that will exist in the sparse CSR matrix C (after pruning has been performed onA) as well as fill the output CSR row pointer arraycsrRowPtr.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
thresholdvalue 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+1elements 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_bufferSizeorhipsparseSpruneDense2csr_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,A,threshold,descr,csrRowPtr,nnzTotalDevHostPtr,orbufferpointer is invalid.
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)#
hipsparseXpruneDense2csrconverts the matrixAin 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 dimensionlda,wherelda>=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_bufferSizeto determine the size of the required user-allocated temporary storage buffer. The user then allocates this buffer. Next, the user allocatescsrRowPtrto havem+1elements and then callshipsparseSpruneDense2csrNnz, which fills in thecsrRowPtrarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then allocatescsrColIndandcsrValto have sizennzTotalDevHostPtrand completes the conversion by callinghipsparseXpruneDense2csr().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
thresholdvalue 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSpruneDense2csr_bufferSizeorhipsparseSpruneDense2csr_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,A,descr,threshold,csrVal,csrRowPtr,csrColInd,orbufferpointer is invalid.
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)#
hipsparseXpruneDense2csrconverts the matrixAin 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 dimensionlda,wherelda>=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_bufferSizeto determine the size of the required user-allocated temporary storage buffer. The user then allocates this buffer. Next, the user allocatescsrRowPtrto havem+1elements and then callshipsparseSpruneDense2csrNnz, which fills in thecsrRowPtrarray and stores the number of elements that are larger than the pruningthresholdinnnzTotalDevHostPtr.The user then allocatescsrColIndandcsrValto have sizennzTotalDevHostPtrand completes the conversion by callinghipsparseXpruneDense2csr().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
thresholdvalue 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 isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSpruneDense2csr_bufferSizeorhipsparseSpruneDense2csr_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,A,descr,threshold,csrVal,csrRowPtr,csrColInd,orbufferpointer is invalid.
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_bufferSizefunctions 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 apercentage.When converting and pruning a dense matrix
Ato a CSR matrix by percentage, the following steps are performed. First, the user callshipsparseXpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (whose size is determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) nonzero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE: thehandleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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_bufferSizefunctions 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 apercentage.When converting and pruning a dense matrix
Ato a CSR matrix by percentage, the following steps are performed. First, the user callshipsparseXpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (whose size is determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) nonzero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE: thehandleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseXpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (whose size is determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE: thehandleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseXpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (whose size is determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – IN: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure.
- pBufferSizeInBytes (
PointerToUInt64/object) – OUT: number of bytes of the temporary storage buffer required by hipsparseSpruneDense2csrNnzByPercentage() and hipsparseDpruneDense2csrNnzByPercentage().
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE: thehandleorpBufferSizeInBytespointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR: an internal error occurred.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseSpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseXpruneDense2csrNnzByPercentage.Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (which have a size determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage“hipsparseXpruneDense2csrByPercentage()”.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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_bufferSizeorhipsparseSpruneDense2csrByPercentage_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,percentage,A,descr,info,csrRowPtr,nnzTotalDevHostPtr,orbufferpointer is invalid.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseSpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseXpruneDense2csrNnzByPercentage.Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (which have a size determined by the value atnnzTotalDevHostPtr)and callinghipsparseSpruneDense2csrByPercentage“hipsparseXpruneDense2csrByPercentage()”.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.- csrRowPtr (
PointerToInt/object) – OUT: integer array of
m+1elements 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_bufferSizeorhipsparseSpruneDense2csrByPercentage_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,percentage,A,descr,info,csrRowPtr,nnzTotalDevHostPtr,orbufferpointer is invalid.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseSpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (which have a size determined by the value atnnzTotalDevHostPtr)and callinghipsparseXpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure
- buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSpruneDense2csrByPercentage_bufferSizeorhipsparseSpruneDense2csrByPercentage_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,percentage,A,descr,info,csrVal,csrRowPtr,csrColInd,orbufferpointer is invalid.
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
percentagea dense matrix to a CSR matrix.When converting and pruning a dense matrix
Ato a CSR matrix bypercentage,the following steps are performed. First, the user callshipsparseSpruneDense2csrByPercentage_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 thecsrRowPtrarray to havem+1elements and callshipsparseSpruneDense2csrNnzByPercentage. Finally, the user finishes the conversion by allocating thecsrColIndandcsrValarrays (which have a size determined by the value atnnzTotalDevHostPtr)and callinghipsparseXpruneDense2csrByPercentage.The pruning by
percentageworks by first sorting the absolute values of the dense matrixA.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>=0andpercentage<=100.- descr (
Pointer/object) – IN: the descriptor of the dense matrix
A.The supported matrix type isHIPSPARSE_MATRIX_TYPE_GENERALand any valid value of thehipsparseIndexBase_t.- csrVal (
Pointer/object) – OUT: array of nnz ( =
csrRowPtr[m]-csrRowPtr[0]) non-zero elements of matrixA.- csrRowPtr (
PointerToInt/object) – IN: integer array of
m+1elements 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 matrixA.- info (
pruneInfo/object) – IN: prune information structure
- buffer (
Pointer/object) – IN: temporary storage buffer allocated by the user. The size is returned by
hipsparseSpruneDense2csrByPercentage_bufferSizeorhipsparseSpruneDense2csrByPercentage_bufferSizeExt.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,m,n,lda,percentage,A,descr,info,csrVal,csrRowPtr,csrColInd,orbufferpointer is invalid.
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.
hipsparseXcsrcolorperforms 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. ThefractionToColoris a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optionalreorderingarray 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
nnzelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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
reorderingis a non-null pointer.- info (
Pointer/object) – INOUT: structure that holds the information collected during the coloring algorithm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,fractionToColor,ncolors,coloring,orinfois nullptr,mornnzis negative, orcsrValA,csrRowPtrA,orcsrColIndAis nullptr whennnzis greater than zero.
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.
hipsparseXcsrcolorperforms 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. ThefractionToColoris a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optionalreorderingarray 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
nnzelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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
reorderingis a non-null pointer.- info (
Pointer/object) – INOUT: structure that holds the information collected during the coloring algorithm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,fractionToColor,ncolors,coloring,orinfois nullptr,mornnzis negative, orcsrValA,csrRowPtrA,orcsrColIndAis nullptr whennnzis greater than zero.
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.
hipsparseXcsrcolorperforms 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. ThefractionToColoris a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optionalreorderingarray 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
nnzelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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
reorderingis a non-null pointer.- info (
Pointer/object) – INOUT: structure that holds the information collected during the coloring algorithm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,fractionToColor,ncolors,coloring,orinfois nullptr,mornnzis negative, orcsrValA,csrRowPtrA,orcsrColIndAis nullptr whennnzis greater than zero.
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.
hipsparseXcsrcolorperforms 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. ThefractionToColoris a parameter to only color a given percentage of the graph nodes. The remaining uncolored nodes receive distinct new colors. The optionalreorderingarray 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
nnzelements of the sparse CSR matrix.- csrRowPtrA (
PointerToInt/object) – IN: array of
m+1elements that point to the start of every row of the sparse CSR matrix.- csrColIndA (
PointerToInt/object) – IN: array of
nnzelements 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
reorderingis a non-null pointer.- info (
Pointer/object) – INOUT: structure that holds the information collected during the coloring algorithm.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,descrA,fractionToColor,ncolors,coloring,orinfois nullptr,mornnzis negative, orcsrValA,csrRowPtrA,orcsrColIndAis nullptr whennnzis greater than zero.
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)
- class rocm.bindings.hipsparse.hipsparseOrder_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseIndexType_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpMVAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpMMAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSparseToDenseAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseDenseToSparseAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSDDMMAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpSVAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpSMAlg_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpMatAttribute_t#
Bases:
enum.IntEnum(No short description)
- class rocm.bindings.hipsparse.hipsparseSpGEMMAlg_t#
Bases:
enum.IntEnum(No short description)
- rocm.bindings.hipsparse.hipsparseCreateSpVec(size, nnz, indices, values, idxType, idxBase, valueType)#
Create a sparse vector.
hipsparseCreateSpVeccreates 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)
- size (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCreateConstSpVeccreates 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)
- spVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseDestroySpVecdestroys a sparse vector descriptor and releases all resources used by the descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseSpVecGetgets the fields of the sparse vector descriptor.- Args:
- Returns:
A
tupleof size 3 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseConstSpVecGetgets 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)
- spVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCreateCoocreates a sparse COO matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstCoocreates a sparse COO matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateCooAoScreates a sparse COO (AoS) matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateCsrcreates a sparse CSR matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstCsrcreates a sparse CSR matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateCsccreates a sparse CSC matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstCsccreates a sparse CSC matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateCsrcreates a sparse Blocked ELL matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstBlockedEllcreates a sparse Blocked ELL matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateSlicedEllcreates a sparse Sliced ELL matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstSlicedEllcreates a sparse Sliced ELL matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateBsrcreates a sparse BSR matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- mb (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseCreateConstBsrcreates a sparse BSR matrix descriptor. It should be destroyed at the end usinghipsparseDestroySpMat.- 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)
- mb (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- spMatDescr (
hipsparseSpMatDescr_st): (undocumented)
- spMatDescr (
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.
hipsparseDestroySpMatdestroys a sparse matrix descriptor and releases all resources used by the descriptor.- Args:
- spMatDescr (
hipsparseSpMatDescr_st/object): (undocumented)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCooGetgets 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)
- spMatDescr (
- Returns:
A
tupleof 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.
hipsparseConstCooGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCooAoSGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 3 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCsrGetgets 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)
- spMatDescr (
- Returns:
A
tupleof 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.
hipsparseConstCsrGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCscGetgets 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)
- spMatDescr (
- Returns:
A
tupleof 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.
hipsparseConstCscGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseBlockedEllGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 3 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseConstBlockedEllGetgets 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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCsrSetPointerssets the fields of the sparse CSR matrix descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCscSetPointerssets the fields of the sparse CSC matrix descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCooSetPointerssets the fields of the sparse COO matrix descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseBlockedEllSetPointerssets the fields of the sparse blocked ELL matrix descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- spMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCreateDnVeccreates a dense vector descriptor. It should be destroyed at the end using hipsparseDestroyDnVec().- Args:
- size (
int): (undocumented)
- values (
Pointer/object): (undocumented)
- valueType (
hipDataType): (undocumented)
- size (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCreateConstDnVeccreates 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)
- dnVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseDestroyDnVecdestroys a dense vector descriptor and releases all resources used by the descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDestroyDnVec(hipsparseConstDnVecDescr_t dnVecDescr)
- rocm.bindings.hipsparse.hipsparseDnVecGet(dnVecDescr, size, valueType)#
Get the fields from a dense vector.
hipsparseDnVecGetgets the fields of the dense vector descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseConstDnVecGetgets the fields of the dense vector descriptor.- Args:
- dnVecDescr (
Pointer/object): (undocumented)
- size (
PointerToInt64/object): (undocumented)
- values (
ListOfPointer/object): (undocumented)
- valueType (
Pointer/object): (undocumented)
- dnVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseDnVecGetValuesgets the fields of the dense vector descriptor.- Args:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseConstDnVecGetValuesgets the fields of the dense vector descriptor.- Args:
- dnVecDescr (
Pointer/object): (undocumented)
- values (
ListOfPointer/object): (undocumented)
- dnVecDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseDnVecSetValuessets the fields of the dense vector descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
C signature
hipsparseStatus_t hipsparseDnVecSetValues(hipsparseDnVecDescr_t dnVecDescr, void * values)
- rocm.bindings.hipsparse.hipsparseCreateDnMat(rows, cols, ld, values, valueType, order)#
Create a dense matrix.
hipsparseCreateDnMatcreates 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)
- rows (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseCreateConstDnMatcreates 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)
- dnMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseDestroyDnMatdestroys a dense matrix descriptor and releases all resources used by the descriptor.- Args:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- dnMatDescr (
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- dnMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- dnMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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)
- dnMatDescr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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.
hipsparseAxpbymultiplies 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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,vecX,beta,orvecYis nullptr, or the vector sizes or data types are incompatible.
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_bufferSizecomputes the required user-allocated buffer size needed when converting a dense matrix to a sparse matrix.This routine currently accepts the sparse matrix descriptor
matBin CSR, CSC, or COO format. This routine is used to determine the size of the buffer needed inhipsparseDenseToSparse_analysisandhipsparseDenseToSparse_convert.hipsparseDenseToSparse_bufferSizesupports different data types for the dense and sparse matrices. SeehipsparseDenseToSparse_convertfor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,orpBufferSizeInBytespointer is invalid.
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_analysisperforms analysis that is later used inhipsparseDenseToSparse_convertwhen converting a dense matrix to sparse matrix.This routine currently accepts the sparse matrix descriptor
matBin CSR, CSC, or COO format. This routine takes a user-allocated buffer with a size that must first be computed usinghipsparseDenseToSparse_bufferSize.hipsparseDenseToSparse_analysissupports different data types for the dense and sparse matrices. SeehipsparseDenseToSparse_convertfor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,orexternalBufferpointer is invalid.
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_convertconverts a dense matrix to a sparse matrix. This routine currently accepts the sparse matrix descriptormatBin CSR, CSC, or COO format. This routine requires a user-allocated buffer with a size that must first be determined by callinghipsparseDenseToSparse_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
NULLand 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 tohipsparseDenseToSparse_analysis, which will perform analysis on the dense matrix to determine the number of non-zeros that will exist in the sparse matrix. After thehipsparseDenseToSparse_analysisroutine has been called, the non-zero count is stored in the sparse matrix descriptormatB.To allocate the remaining sparse matrix arrays, query the sparse matrix descriptormatBfor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,orexternalBufferpointer is invalid.
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.
hipsparseGathergathers 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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,vecX,orvecYis nullptr, or the vector sizes or data types are incompatible.
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.
hipsparseRotapplies 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\).
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,c_coeff,s_coeff,vecX,orvecYis nullptr, or the vector sizes or data types are incompatible.
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.
hipsparseScatterscatters 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:
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,vecX,orvecYis nullptr, or the vector sizes or data types are incompatible.
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_bufferSizereturns the size of the buffer required when computing the sampled dense-dense matrix multiplication:hipsparseSDDMM_bufferSizereturns 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,A,B,CorpBufferSizeInBytesis nullptr, oropAoropBis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEoropB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
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_preprocessperforms the required preprocessing used when computing the sampled dense dense matrix multiplication:hipsparseSDDMM_preprocessperforms 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,A,B,CortempBufferpointer is invalid or the value ofopAoropBis incorrect.HIPSPARSE_STATUS_NOT_SUPPORTED:opA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEoropB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
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.
hipsparseSDDMMmultiplies 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,A,B,CortempBufferpointer is invalid or the value ofopAoropBis incorrect.HIPSPARSE_STATUS_NOT_SUPPORTED:opA==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSEoropB==HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE.
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_bufferSizecomputes the required user-allocated buffer size needed when converting a sparse matrix to a dense matrix.This routine currently accepts the sparse matrix descriptor
matAin CSR, CSC, or COO format. This routine is used to determine the size of the buffer needed inhipsparseSparseToDense.hipsparseSparseToDense_bufferSizesupports different data types for the sparse and dense matrices. SeehipsparseSparseToDensefor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,orpBufferSizeInBytespointer is invalid.
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
hipsparseSparseToDenseconverts a sparse matrix to a dense matrix. This routine accepts the sparse matrix descriptormatAin CSR, CSC, or COO format. It takes a user-allocated buffer with a size that must first be computed by callinghipsparseSparseToDense_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_bufferSizeto determine the size of the required temporary storage buffer. The user then allocates this buffer and passes it tohipsparseSparseToDenseto complete the conversion. After the conversion is complete, the user is free to deallocate the storage buffer. See the full example below for details.hipsparseSparseToDensesupports 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,orexternalBufferpointer is invalid.
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_createDescrcreates a sparse matrix sparse matrix product descriptor.It should be destroyed at the end using
hipsparseSpGEMM_destroyDescr().- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- descr (
hipsparseSpGEMMDescr): (undocumented)
- descr (
C signature
hipsparseStatus_t hipsparseSpGEMM_createDescr(hipsparseSpGEMMDescr_t * descr)
- rocm.bindings.hipsparse.hipsparseSpGEMM_destroyDescr(descr)#
hipsparseSpGEMM_destroyDescrdestroys a sparse matrix sparse matrix product descriptor and releases all resources used by the descriptor.- Args:
- descr (
hipsparseSpGEMMDescr/object): (undocumented)
- descr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_workEstimationis 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 callhipsparseSpGEMM_workEstimationa 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_workEstimationsupports multiple combinations of data types and compute types. SeehipsparseSpGEMM_copyfor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,matA,matB,matC,spgemmDescr,orbufferSize1is nullptr, oropAoropBis invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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_computeis 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 callshipsparseSpGEMM_computea 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_computesupports multiple combinations of data types and compute types. SeehipsparseSpGEMM_copyfor 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,matA,matB,matC,orbufferSize2pointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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_copyis 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_copysupports 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_copysupportsHIPSPARSE_INDEX_32IandHIPSPARSE_INDEX_64Iindex 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,matA,matB,ormatCpointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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_workEstimationis 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 callhipsparseSpGEMMreuse_workEstimationa 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,matC,orbufferSize1pointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,matC,bufferSize2,bufferSize3,orbufferSize4pointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,matA,matB,matC,orbufferSize5pointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,beta,matA,matB,ormatCpointer is invalid.HIPSPARSE_STATUS_ALLOC_FAILED: additional buffer for long rows could not be allocated.HIPSPARSE_STATUS_NOT_SUPPORTED:opA!=HIPSPARSE_OPERATION_NON_TRANSPOSEoropB!=HIPSPARSE_OPERATION_NON_TRANSPOSE.
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_bufferSizecomputes the required user-allocated buffer size needed when computing the sparse matrix multiplication with a dense matrix:hipsparseSpMM_bufferSizecomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,beta,orpBufferSizeInBytesis nullptr, oropAoropBis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_preprocessperforms the required preprocessing used when computing the sparse matrix multiplication with a dense matrix:hipsparseSpMM_preprocessperforms 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,beta,orexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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.
hipsparseSpMMmultiplies 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>
hipsparseSpMMsupportsHIPSPARSE_INDEX_32IandHIPSPARSE_INDEX_64Iindex precisions for storing the row pointer and column indices arrays of the sparse matrices.hipsparseSpMMalso 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,beta,orexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_bufferSizecomputes the user-allocated buffer size required when computing the sparse matrix multiplication with a dense vector:hipsparseSpMV_bufferSizecomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,vecX,beta,vecY,orpBufferSizeInBytesis nullptr,opAis invalid, or the matrix or vector dimensions are incompatible.HIPSPARSE_STATUS_NOT_SUPPORTED:computeTypeoralgis currently not supported.
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_preprocessperforms analysis on the sparse matrix \(op(A)\) when computing the sparse matrix multiplication with a dense vector:hipsparseSpMV_preprocessperforms 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,x,beta,y,orexternalBufferpointer is invalid or ifopA,computeType,oralgis incorrect.HIPSPARSE_STATUS_NOT_SUPPORTED:computeTypeoralgis currently not supported.
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.
hipsparseSpMVmultiplies 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>
hipsparseSpMVsupportsHIPSPARSE_INDEX_32IandHIPSPARSE_INDEX_64Iindex 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, andHIPSPARSE_FORMAT_SLICED_ELL.- Note:
Only the
hipsparseSpMV_bufferSizeandhipsparseSpMVroutines are non-blocking and executed asynchronously with respect to the host. They can return before the actual computation has finished. ThehipsparseSpMV_preprocessroutine is blocking with respect to the host.- Note:
Only the
hipsparseSpMV_bufferSizeand thehipsparseSpMVroutines support execution in a hipGraph context. ThehipsparseSpMV_preprocessstage 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,x,beta,y,orexternalBufferpointer is invalid or ifopA,computeType,algis incorrect.HIPSPARSE_STATUS_NOT_SUPPORTED:computeTypeoralgis currently not supported.
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_createDescrcreates a sparse matrix triangular solve (with multiple rhs) descriptor.It should be destroyed at the end using
hipsparseSpSM_destroyDescr().- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- descr (
hipsparseSpSMDescr): (undocumented)
- descr (
C signature
hipsparseStatus_t hipsparseSpSM_createDescr(hipsparseSpSMDescr_t * descr)
- rocm.bindings.hipsparse.hipsparseSpSM_destroyDescr(descr)#
hipsparseSpSM_destroyDescrdestroys a sparse matrix triangular solve (with multiple rhs) descriptor and releases all resources used by the descriptor.- Args:
- descr (
hipsparseSpSMDescr/object): (undocumented)
- descr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_bufferSizecomputes the size of the required user-allocated buffer needed when solving the triangular linear system:hipsparseSpSM_bufferSizecomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,spsmDescr,orpBufferSizeInBytesis nullptr, oropAoropBis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_analysisperforms the required analysis needed when solving the triangular linear system:hipsparseSpSM_analysisperforms 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,spsmDescrorexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_solvesolves 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 routinehipsparseSpSM_solve_ex, which correctly matches the parameter list ofcusparseSpSM_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,spsmDescr,orexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_exsolves 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 routinehipsparseSpSM_solveincorrectly passed the external buffer as the last parameter. Users looking for an exact match in the parameters should usehipsparseSpSM_solve_exinstead ofhipsparseSpSM_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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,matB,matC,orspsmDescris invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,opB,computeType,oralgis currently not supported.
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_createDescrcreates a sparse matrix triangular solve descriptor.It should be destroyed at the end using
hipsparseSpSV_destroyDescr().- Returns:
A
tupleof size 2 that contains (in that order):hipsparseStatus_t: (undocumented)- descr (
hipsparseSpSVDescr): (undocumented)
- descr (
C signature
hipsparseStatus_t hipsparseSpSV_createDescr(hipsparseSpSVDescr_t * descr)
- rocm.bindings.hipsparse.hipsparseSpSV_destroyDescr(descr)#
hipsparseSpSV_destroyDescrdestroys a sparse matrix triangular solve descriptor and releases all resources used by the descriptor.- Args:
- descr (
hipsparseSpSVDescr/object): (undocumented)
- descr (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: (undocumented)
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_bufferSizecomputes the size of the user-allocated buffer required when solving the triangular linear system:hipsparseSpSV_bufferSizecomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,x,y,spsvDescr,orpBufferSizeInBytesis nullptr, oropAis invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,computeType,oralgis currently not supported.
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_analysisperforms the required analysis needed when solving the triangular linear system:hipsparseSpSV_analysisperforms 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,x,y,spsvDescr,orexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,computeType,oralgis currently not supported.
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_solvesolves 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,alpha,matA,x,y,orspsvDescrpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:opA,computeType,oralgis currently not supported.
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_bufferSizecomputes the required user-allocated buffer size needed when computing the inner dot product of a sparse vector with a dense vector:hipsparseSpVV_bufferSizecomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_NOT_INITIALIZED:handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE:handle,vecX,vecY,result,orpBufferSizeInBytesis nullptr.HIPSPARSE_STATUS_NOT_SUPPORTED:computeTypeis currently not supported.
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.
hipsparseSpVVcomputes 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.
- handle (
- Returns:
A
tupleof size 1 that contains (in that order):hipsparseStatus_t: One of:HIPSPARSE_STATUS_SUCCESS: the operation completed successfully.HIPSPARSE_STATUS_INVALID_VALUE:handle,vecX,vecY,result,orexternalBufferpointer is invalid.HIPSPARSE_STATUS_NOT_SUPPORTED:computeTypeis currently not supported.
C signature
hipsparseStatus_t hipsparseSpVV(hipsparseHandle_t handle, hipsparseOperation_t opX, hipsparseConstSpVecDescr_t vecX, hipsparseConstDnVecDescr_t vecY, void * result, hipDataType computeType, void * externalBuffer)