hipsparsesprunecsr2csr Interface Reference

hipsparsesprunecsr2csr Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsesprunecsr2csr Interface Reference
hipfort_hipsparse::hipsparsesprunecsr2csr Interface Reference

Convert and prune a sparse CSR matrix into a sparse CSR matrix. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsesprunecsr2csr_ (handle, m, n, nnza, descra, csrvala, csrrowptra, csrcolinda, threshold, descrc, csrvalc, csrrowptrc, csrcolindc, buffer)
 
integer(kind(hipsparse_status_success)) function hipsparsesprunecsr2csr_rank_0 (handle, m, n, nnza, descra, csrvala, csrrowptra, csrcolinda, threshold, descrc, csrvalc, csrrowptrc, csrcolindc, buffer)
 
integer(kind(hipsparse_status_success)) function hipsparsesprunecsr2csr_rank_1 (handle, m, n, nnza, descra, csrvala, csrrowptra, csrcolinda, threshold, descrc, csrvalc, csrrowptrc, csrcolindc, buffer)
 

Detailed Description

Convert and prune a sparse CSR matrix into a sparse CSR matrix.

This function converts the sparse CSR matrix A into a sparse CSR matrix C by pruning values in A that are less than the threshold. All the parameters are assumed to have been preallocated by the user. The user first calls hipsparseSpruneCsr2csr_bufferSize "hipsparseXpruneCsr2csr_bufferSize()" to determine the size of the buffer used by hipsparseSpruneCsr2csrNnz "hipsparseXpruneCsr2csrNnz()" and hipsparseXpruneCsr2csr(), which the user then allocates. The user then allocates csrRowPtrC to have m+1 elements and then calls hipsparseXpruneCsr2csrNnz(), which fills in the csrRowPtrC array and stores the number of elements that are larger than the pruning threshold in nnzTotalDevHostPtr. The user then calls hipsparseXpruneCsr2csr() to complete the conversion. This function is executed asynchronously with respect to the host and can return control to the application on the host before the entire result is ready.

Parameters
[in]handle- handle to the hipSPARSE library context queue.
[in]m- number of rows in the sparse CSR matrix.
[in]n- number of columns in the sparse CSR matrix.
[in]nnzA- number of non-zeros in the sparse CSR matrix A.
[in]descrA- descriptor of the sparse CSR matrix A. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
[in]csrValA- array of nnzA elements containing the values of the sparse CSR matrix A.
[in]csrRowPtrA- array of m+1 elements that point to the start of every row of the sparse CSR matrix A.
[in]csrColIndA- array of nnzA 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]descrC- descriptor of the sparse CSR matrix C. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
[out]csrValC- array of nnzC elements containing the values of the sparse CSR matrix C.
[in]csrRowPtrC- array of m+1 elements that point to the start of every row of the sparse CSR matrix C.
[out]csrColIndC- array of nnzC elements containing the column indices of the sparse CSR matrix C.
[in]buffer- buffer allocated by the user whose size is determined by calling hipsparseSpruneCsr2csr_bufferSize "hipsparseXpruneCsr2csr_bufferSize()".
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, m, n, nnzA, threshold, descrA, descrC, csrValA, csrRowPtrA, csrcolindA, csrvalC, csrrowptrC, csrcolIndC, or buffer pointer is invalid.

Member Function/Subroutine Documentation

◆ hipsparsesprunecsr2csr_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesprunecsr2csr::hipsparsesprunecsr2csr_ ( type(c_ptr), value  handle,
integer(c_int), value  m,
integer(c_int), value  n,
integer(c_int), value  nnza,
type(c_ptr), value  descra,
type(c_ptr), value  csrvala,
type(c_ptr), value  csrrowptra,
type(c_ptr), value  csrcolinda,
real(c_float)  threshold,
type(c_ptr), value  descrc,
type(c_ptr), value  csrvalc,
type(c_ptr), value  csrrowptrc,
type(c_ptr), value  csrcolindc,
type(c_ptr), value  buffer 
)

◆ hipsparsesprunecsr2csr_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesprunecsr2csr::hipsparsesprunecsr2csr_rank_0 ( type(c_ptr)  handle,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  nnza,
type(c_ptr)  descra,
real(c_float), target  csrvala,
integer(c_int), target  csrrowptra,
integer(c_int), target  csrcolinda,
real(c_float)  threshold,
type(c_ptr)  descrc,
real(c_float), target  csrvalc,
integer(c_int), target  csrrowptrc,
integer(c_int), target  csrcolindc,
type(c_ptr)  buffer 
)

◆ hipsparsesprunecsr2csr_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesprunecsr2csr::hipsparsesprunecsr2csr_rank_1 ( type(c_ptr)  handle,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  nnza,
type(c_ptr)  descra,
real(c_float), dimension(:), target  csrvala,
integer(c_int), dimension(:), target  csrrowptra,
integer(c_int), dimension(:), target  csrcolinda,
real(c_float)  threshold,
type(c_ptr)  descrc,
real(c_float), dimension(:), target  csrvalc,
integer(c_int), dimension(:), target  csrrowptrc,
integer(c_int), dimension(:), target  csrcolindc,
type(c_ptr)  buffer 
)

The documentation for this interface was generated from the following file: