code: public static int cusparseSnnz_compress(
          cusparseHandle handle, 
          int m, 
          cusparseMatDescr descr, 
          Pointer csrSortedValA, 
          Pointer csrSortedRowPtrA, 
          Pointer nnzPerRow, 
          Pointer nnzC, 
          float tol)
      {
          return checkResult(cusparseSnnz_compressNative(handle, m, descr, csrSortedValA, csrSortedRowPtrA, nnzPerRow, nnzC, tol));
      }
docs: Description: This routine finds the total number of non-zero elements and
  the number of non-zero elements per row in a noncompressed csr matrix A.