Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed.
More...
|
| integer(c_int) function | rocsparse_snnz_compress_ (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_snnz_compress_typed (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_snnz_compress_rank_0 (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_snnz_compress_rank_0_devptr (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_snnz_compress_rank_1 (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
| integer(kind(rocsparse_status_success)) function | rocsparse_snnz_compress_rank_1_devptr (handle, m, descr_a, csr_val_a, csr_row_ptr_a, nnz_per_row, nnz_c, tol) |
| |
Given a sparse CSR matrix and a non-negative tolerance, this function computes how many entries would be left in each row of the matrix if elements less than the tolerance were removed.
It also computes the total number of remaining elements in the matrix.
- Note
- This function is blocking with respect to the host.
-
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 of the sparse CSR matrix. |
| [in] | descr_A | - the descriptor of the sparse CSR matrix. |
| [in] | csr_val_A | - array of nnz_A elements of the sparse CSR matrix. |
| [in] | csr_row_ptr_A | - array of m+1 elements that point to the start of every row of the uncompressed sparse CSR matrix. |
| [out] | nnz_per_row | - array of length m containing the number of entries that will be kept per row in the final compressed CSR matrix. |
| [out] | nnz_C | - number of elements in the column indices and values arrays of the compressed sparse CSR matrix. It can be either a host or device pointer. |
| [in] | tol | - the non-negative tolerance used for compression. If tol is complex, then only the magnitude of the real part is used. Entries in the input uncompressed CSR array that are below the tolerance are removed in the output compressed CSR matrix. |
- Return values
-
| rocsparse_status_success | the operation completed successfully. |
| rocsparse_status_invalid_handle | the library context was not initialized. |
| rocsparse_status_invalid_size | m or n is invalid. |
| rocsparse_status_invalid_value | tol is invalid. |
| rocsparse_status_invalid_pointer | csr_val_A, csr_row_ptr_A, nnz_per_row, or nnz_C pointer is invalid. |
- Example
◆ rocsparse_snnz_compress_()
| integer(c_int) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_ |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int), value |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
type(c_ptr), value |
csr_val_a, |
|
|
type(c_ptr), value |
csr_row_ptr_a, |
|
|
type(c_ptr), value |
nnz_per_row, |
|
|
type(c_ptr), value |
nnz_c, |
|
|
real(c_float), value |
tol |
|
) |
| |
◆ rocsparse_snnz_compress_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_rank_0 |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int) |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
real(c_float), target |
csr_val_a, |
|
|
integer(c_int), target |
csr_row_ptr_a, |
|
|
integer(c_int), target |
nnz_per_row, |
|
|
integer(c_int), target |
nnz_c, |
|
|
real(c_float) |
tol |
|
) |
| |
◆ rocsparse_snnz_compress_rank_0_devptr()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_rank_0_devptr |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int) |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
real(c_float), target |
csr_val_a, |
|
|
integer(c_int), target |
csr_row_ptr_a, |
|
|
integer(c_int), target |
nnz_per_row, |
|
|
type(c_ptr), value |
nnz_c, |
|
|
real(c_float) |
tol |
|
) |
| |
◆ rocsparse_snnz_compress_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_rank_1 |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int) |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
real(c_float), dimension(:), target |
csr_val_a, |
|
|
integer(c_int), dimension(:), target |
csr_row_ptr_a, |
|
|
integer(c_int), dimension(:), target |
nnz_per_row, |
|
|
integer(c_int), target |
nnz_c, |
|
|
real(c_float) |
tol |
|
) |
| |
◆ rocsparse_snnz_compress_rank_1_devptr()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_rank_1_devptr |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int) |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
real(c_float), dimension(:), target |
csr_val_a, |
|
|
integer(c_int), dimension(:), target |
csr_row_ptr_a, |
|
|
integer(c_int), dimension(:), target |
nnz_per_row, |
|
|
type(c_ptr), value |
nnz_c, |
|
|
real(c_float) |
tol |
|
) |
| |
◆ rocsparse_snnz_compress_typed()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_snnz_compress::rocsparse_snnz_compress_typed |
( |
type(c_ptr), value |
handle, |
|
|
integer(c_int) |
m, |
|
|
type(c_ptr), value |
descr_a, |
|
|
type(c_ptr) |
csr_val_a, |
|
|
type(c_ptr) |
csr_row_ptr_a, |
|
|
type(c_ptr) |
nnz_per_row, |
|
|
integer(c_int), target |
nnz_c, |
|
|
real(c_float) |
tol |
|
) |
| |
The documentation for this interface was generated from the following file: