Skip to main content

cusparseDnnz_compress

Function cusparseDnnz_compress 

Source
pub unsafe extern "C" fn cusparseDnnz_compress(
    handle: cusparseHandle_t,
    m: c_int,
    descr: cusparseMatDescr_t,
    csrSortedValA: *const f64,
    csrSortedRowPtrA: *const c_int,
    nnzPerRow: *mut c_int,
    nnzC: *mut c_int,
    tol: f64,
) -> cusparseStatus_t
Expand description

This function is the step one to convert from csr format to compressed csr format.

Given a sparse matrix A and a non-negative value threshold, the function returns nnzPerRow(the number of nonzeros columns per row) and nnzC(the total number of nonzeros) of a sparse matrix C, defined by

A key assumption for the cuComplex and cuDoubleComplex case is that this tolerance is given as the real part. For example tol = 1e-8 + 0*i and we extract cureal, that is the x component of this struct.

  • This function requires temporary extra storage that is allocated internally.
  • The routine supports asynchronous execution if the Stream Ordered Memory Allocator is available.
  • The routine supports CUDA graph capture if the Stream Ordered Memory Allocator is available.