|
| integer(c_int) function | rocsparse_csrgemm_nnz_ (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csrgemm_nnz_typed (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csrgemm_nnz_rank_0 (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csrgemm_nnz_rank_0_devptr (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csrgemm_nnz_rank_1 (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_csrgemm_nnz_rank_1_devptr (handle, trans_a, trans_b, m, n, k, descr_a, nnz_a, csr_row_ptr_a, csr_col_ind_a, descr_b, nnz_b, csr_row_ptr_b, csr_col_ind_b, descr_d, nnz_d, csr_row_ptr_d, csr_col_ind_d, descr_c, csr_row_ptr_c, nnz_c, info_c, temp_buffer) |
| |
Sparse matrix sparse matrix multiplication using the CSR storage format.
rocsparse_csrgemm_nnz 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 csr_row_ptr_C has been allocated with size m+1. The required buffer size can be obtained by rocsparse_scsrgemm_buffer_size(), rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), and rocsparse_zcsrgemm_buffer_size(), respectively.
- Note
- Note that for rows of \(C\) whose hash table does not fit in shared memory, the algorithm allocates additional device memory during the call.
rocsparse_status_memory_error is returned if it cannot be allocated.
-
This function supports unsorted CSR matrices as input, while output will be sorted. Note that matrices B and D can only be unsorted up to 8192 intermediate products per row. If this number is exceeded,
rocsparse_status_requires_sorted_storage will be returned.
-
This function is blocking with respect to the host.
-
Currently, only
trans_A == trans_B == rocsparse_operation_none is supported.
-
Currently, only
rocsparse_matrix_type_general is supported.
-
This routine does not support execution in a hipGraph context.
- Parameters
-
| [in] | handle | - handle to the rocSPARSE library context queue. |
| [in] | trans_A | - matrix \(A\) operation type. |
| [in] | trans_B | - matrix \(B\) operation type. |
| [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] | descr_A | - descriptor of the sparse CSR matrix \(A\). Currently, only rocsparse_matrix_type_general is supported. |
| [in] | nnz_A | - number of non-zero entries of the sparse CSR matrix \(A\). |
| [in] | csr_row_ptr_A | - 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] | csr_col_ind_A | - array of nnz_A elements containing the column indices of the sparse CSR matrix \(A\). |
| [in] | descr_B | - descriptor of the sparse CSR matrix \(B\). Currently, only rocsparse_matrix_type_general is supported. |
| [in] | nnz_B | - number of non-zero entries of the sparse CSR matrix \(B\). |
| [in] | csr_row_ptr_B | - 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] | csr_col_ind_B | - array of nnz_B elements containing the column indices of the sparse CSR matrix \(B\). |
| [in] | descr_D | - descriptor of the sparse CSR matrix \(D\). Currently, only rocsparse_matrix_type_general is supported. |
| [in] | nnz_D | - number of non-zero entries of the sparse CSR matrix \(D\). |
| [in] | csr_row_ptr_D | - array of m+1 elements that point to the start of every row of the sparse CSR matrix \(D\). |
| [in] | csr_col_ind_D | - array of nnz_D elements containing the column indices of the sparse CSR matrix \(D\). |
| [in] | descr_C | - descriptor of the sparse CSR matrix \(C\). Currently, only rocsparse_matrix_type_general is supported. |
| [out] | csr_row_ptr_C | - array of m+1 elements that point to the start of every row of the sparse CSR matrix \(C\). |
| [out] | nnz_C | - pointer to the number of non-zero entries of the sparse CSR matrix \(C\). |
| [in] | info_C | - structure that holds meta data for the sparse CSR matrix \(C\). |
| [in] | temp_buffer | - temporary storage buffer allocated by the user, size is returned by rocsparse_scsrgemm_buffer_size(), rocsparse_dcsrgemm_buffer_size(), rocsparse_ccsrgemm_buffer_size(), or rocsparse_zcsrgemm_buffer_size(). |
- Return values
-
| rocsparse_status_success | the operation completed successfully. |
| rocsparse_status_invalid_handle | the library context was not initialized. |
| rocsparse_status_invalid_size | m, n, k, nnz_A, nnz_B, or nnz_D is invalid. |
| rocsparse_status_invalid_pointer | descr_A, csr_row_ptr_A, csr_col_ind_A, descr_B, csr_row_ptr_B, csr_col_ind_B, descr_D, csr_row_ptr_D, csr_col_ind_D, descr_C, csr_row_ptr_C, nnz_C, info_C, or temp_buffer is invalid. |
| rocsparse_status_memory_error | additional buffer for long rows could not be allocated. |
| rocsparse_status_requires_sorted_storage | \(B\) or \(D\) is unsorted and a row of \(C\) has a hash table that does not fit in shared memory. |
| rocsparse_status_not_implemented | trans_A != rocsparse_operation_none, trans_B != rocsparse_operation_none, or rocsparse_matrix_type != rocsparse_matrix_type_general. |