|
| integer(c_int) function | hipsparsexcsrgemm2nnz_ (handle, m, n, k, descra, nnza, csrrowptra, csrcolinda, descrb, nnzb, csrrowptrb, csrcolindb, descrd, nnzd, csrrowptrd, csrcolindd, descrc, csrrowptrc, nnztotaldevhostptr, myinfo, pbuffer) |
| |
| integer(kind(hipsparse_status_success)) function | hipsparsexcsrgemm2nnz_typed (handle, m, n, k, descra, nnza, csrrowptra, csrcolinda, descrb, nnzb, csrrowptrb, csrcolindb, descrd, nnzd, csrrowptrd, csrcolindd, descrc, csrrowptrc, nnztotaldevhostptr, myinfo, pbuffer) |
| |
| integer(kind(hipsparse_status_success)) function | hipsparsexcsrgemm2nnz_rank_0 (handle, m, n, k, descra, nnza, csrrowptra, csrcolinda, descrb, nnzb, csrrowptrb, csrcolindb, descrd, nnzd, csrrowptrd, csrcolindd, descrc, csrrowptrc, nnztotaldevhostptr, myinfo, pbuffer) |
| |
| integer(kind(hipsparse_status_success)) function | hipsparsexcsrgemm2nnz_rank_1 (handle, m, n, k, descra, nnza, csrrowptra, csrcolinda, descrb, nnzb, csrrowptrb, csrcolindb, descrd, nnzd, csrrowptrd, csrcolindd, descrc, csrrowptrc, nnztotaldevhostptr, myinfo, pbuffer) |
| |
hipsparseXcsrgemm2Nnz computes the total CSR non-zero elements and the CSR row offsets that point to the start of every row of the sparse CSR matrix of the resulting multiplied matrix \(C\). It is assumed that csrRowPtrC has been allocated with size m+1. The required buffer size can be obtained by hipsparseScsrgemm2_bufferSizeExt "hipsparseXcsrgemm2_bufferSizeExt()". The desired index base in the output CSR matrix \(C\) is set in the hipsparseMatDescr_t descrC. See hipsparseSetMatIndexBase().
- Note
- As indicated,
nnzTotalDevHostPtr can point to either host or device memory. This is controlled by setting the pointer mode. See hipsparseSetPointerMode().
-
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
-
For matrix products with more than 8192 intermediate products per row, an additional temporary storage buffer is allocated by the algorithm.
-
Currently, only
HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
- Parameters
-
| [in] | handle | - handle to the hipSPARSE library context queue. |
| [in] | m | - number of rows of the sparse CSR matrix \(op(A)\) and \(C\). |
| [in] | n | - number of columns of the sparse CSR matrix \(op(B)\) and \(C\). |
| [in] | k | - number of columns of the sparse CSR matrix \(op(A)\) and number of rows of the sparse CSR matrix \(op(B)\). |
| [in] | descrA | - descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported. |
| [in] | nnzA | - number of non-zero entries of the sparse CSR matrix \(A\). |
| [in] | csrRowPtrA | - array of m+1 elements ( \(op(A) == A\), k+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(A)\). |
| [in] | csrColIndA | - array of nnzA elements containing the column indices of the sparse CSR matrix \(A\). |
| [in] | descrB | - descriptor of the sparse CSR matrix \(B\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported. |
| [in] | nnzB | - number of non-zero entries of the sparse CSR matrix \(B\). |
| [in] | csrRowPtrB | - array of k+1 elements ( \(op(B) == B\), m+1 otherwise) that point to the start of every row of the sparse CSR matrix \(op(B)\). |
| [in] | csrColIndB | - array of nnzB elements containing the column indices of the sparse CSR matrix \(B\). |
| [in] | descrD | - descriptor of the sparse CSR matrix \(D\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported. |
| [in] | nnzD | - number of non-zero entries of the sparse CSR matrix \(D\). |
| [in] | csrRowPtrD | - array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\). |
| [in] | csrColIndD | - array of nnzD elements containing the column indices of the sparse CSR matrix \(D\). |
| [in] | descrC | - descriptor of the sparse CSR matrix \(C\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported. |
| [out] | csrRowPtrC | - array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\). |
| [out] | nnzTotalDevHostPtr | - pointer to the number of non-zero entries of the sparse CSR matrix \(C\). |
| [in] | myInfo | - structure that holds meta data for the sparse CSR matrix \(C\). |
| [in] | pBuffer | - temporary storage buffer allocated by the user. The size is returned by hipsparseScsrgemm2_bufferSizeExt(), hipsparseDcsrgemm2_bufferSizeExt(), hipsparseZcsrgemm2_bufferSizeExt(), or hipsparseZcsrgemm2_bufferSizeExt(). |
- Return values
-
| 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, or pBuffer is invalid. |
| HIPSPARSE_STATUS_ALLOC_FAILED | additional buffer for long rows could not be allocated. |
| HIPSPARSE_STATUS_NOT_SUPPORTED | hipsparseMatrixType_t != HIPSPARSE_MATRIX_TYPE_GENERAL. |