Skip to main content

cusparseXcsrsort

Function cusparseXcsrsort 

Source
pub unsafe extern "C" fn cusparseXcsrsort(
    handle: cusparseHandle_t,
    m: c_int,
    n: c_int,
    nnz: c_int,
    descrA: cusparseMatDescr_t,
    csrRowPtrA: *const c_int,
    csrColIndA: *mut c_int,
    P: *mut c_int,
    pBuffer: *mut c_void,
) -> cusparseStatus_t
Expand description

This function sorts CSR format. The stable sorting is in-place.

The matrix type is regarded as cusparseMatrixType_t::CUSPARSE_MATRIX_TYPE_GENERAL implicitly. In other words, any symmetric property is ignored.

This function csrsort() requires buffer size returned by csrsort_bufferSizeExt(). The address of pBuffer must be multiple of 128 bytes. If not, cusparseStatus_t::CUSPARSE_STATUS_INVALID_VALUE is returned.

The parameter P is both input and output. If the user wants to compute sorted csrVal, P must be set as 0:1:(nnz-1) before csrsort(), and after csrsort(), new sorted value array satisfies csrVal_sorted = csrVal(P).

The general procedure is as follows:

  • The routine requires no extra storage if pBuffer != NULL
  • 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.