|
| integer(kind(rocsparse_status_success)) function | rocsparse_sprune_csr2csr_nnz_ (handle, m, n, nnz_a, csr_descr_a, csr_val_a, csr_row_ptr_a, csr_col_ind_a, threshold, csr_descr_c, csr_row_ptr_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_sprune_csr2csr_nnz_rank_0 (handle, m, n, nnz_a, csr_descr_a, csr_val_a, csr_row_ptr_a, csr_col_ind_a, threshold, csr_descr_c, csr_row_ptr_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_sprune_csr2csr_nnz_rank_1 (handle, m, n, nnz_a, csr_descr_a, csr_val_a, csr_row_ptr_a, csr_col_ind_a, threshold, csr_descr_c, csr_row_ptr_c, nnz_total_dev_host_ptr, temp_buffer) |
| |
rocsparse_prune_csr2csr_nnz computes the number of non-zero elements per row and the total number of non-zero elements in a sparse CSR matrix after elements less than the threshold are pruned from the matrix.
- Note
- The routine supports asynchronous execution if the pointer mode is set to device.
-
This routine does not support execution in a hipGraph context.
- Parameters
-
| [in] | handle | - handle to the rocSPARSE library context queue. |
| [in] | m | - number of rows in the sparse CSR matrix. |
| [in] | n | - number of columns in the sparse CSR matrix. |
| [in] | nnz_A | - number of non-zeros in the sparse CSR matrix \(A\). |
| [in] | csr_descr_A | - descriptor of the sparse CSR matrix \(A\). Currently, only rocsparse_matrix_type_general is supported. |
| [in] | csr_val_A | - array of nnz_A elements containing the values of the sparse CSR matrix \(A\). |
| [in] | csr_row_ptr_A | - array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\). |
| [in] | csr_col_ind_A | - array of nnz_A elements containing the column indices of the sparse CSR matrix \(A\). |
| [in] | threshold | - pointer to the non-negative pruning threshold which can exist in either host or device memory. |
| [in] | csr_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_total_dev_host_ptr | - total number of non-zero elements in device or host memory. |
| [out] | temp_buffer | - buffer allocated by the user. Its size is determined by calling rocsparse_Xprune_csr2csr_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, or nnz_A is invalid. |
| rocsparse_status_invalid_pointer | threshold, csr_descr_A, csr_descr_C, csr_val_A, csr_row_ptr_A, csr_col_ind_A, csr_row_ptr_C, nnz_total_dev_host_ptr, or temp_buffer pointer is invalid. |