Skip to main content

cusparseXcscsort

Function cusparseXcscsort 

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

This function sorts CSC 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 cscsort() requires buffer size returned by cscsort_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 cscVal, P must be set as 0:1:(nnz-1) before cscsort(), and after cscsort(), new sorted value array satisfies cscVal_sorted = cscVal(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.