Skip to main content

cusparseZcsrcolor

Function cusparseZcsrcolor 

Source
pub unsafe extern "C" fn cusparseZcsrcolor(
    handle: cusparseHandle_t,
    m: c_int,
    nnz: c_int,
    descrA: cusparseMatDescr_t,
    csrSortedValA: *const cuDoubleComplex,
    csrSortedRowPtrA: *const c_int,
    csrSortedColIndA: *const c_int,
    fractionToColor: *const f64,
    ncolors: *mut c_int,
    coloring: *mut c_int,
    reordering: *mut c_int,
    info: cusparseColorInfo_t,
) -> cusparseStatus_t
Expand description

This function performs the coloring of the adjacency graph associated with the matrix A stored in CSR format. The coloring is an assignment of colors (integer numbers) to nodes, such that neighboring nodes have distinct colors. An approximate coloring algorithm is used in this routine, and is stopped when a certain percentage of nodes has been colored. The rest of the nodes are assigned distinct colors (an increasing sequence of integers numbers, starting from the last integer used previously). The last two auxiliary routines can be used to extract the resulting number of colors, their assignment and the associated reordering. The reordering is such that nodes that have been assigned the same color are reordered to be next to each other.

The matrix A passed to this routine, must be stored as a general matrix and have a symmetric sparsity pattern. If the matrix is nonsymmetric the user should pass A+A^T as a parameter to this routine.

  • This function requires temporary extra storage that is allocated internally.
  • 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.