Sparse Reordering Functions#

This module holds all sparse reordering routines.

hipsparseXcsrcolor()#

hipsparseStatus_t hipsparseScsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const float *csrValA, const int *csrRowPtrA, const int *csrColIndA, const float *fractionToColor, int *ncolors, int *coloring, int *reordering, hipsparseColorInfo_t info)#
hipsparseStatus_t hipsparseDcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const double *csrValA, const int *csrRowPtrA, const int *csrColIndA, const double *fractionToColor, int *ncolors, int *coloring, int *reordering, hipsparseColorInfo_t info)#
hipsparseStatus_t hipsparseCcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipComplex *csrValA, const int *csrRowPtrA, const int *csrColIndA, const float *fractionToColor, int *ncolors, int *coloring, int *reordering, hipsparseColorInfo_t info)#
hipsparseStatus_t hipsparseZcsrcolor(hipsparseHandle_t handle, int m, int nnz, const hipsparseMatDescr_t descrA, const hipDoubleComplex *csrValA, const int *csrRowPtrA, const int *csrColIndA, const double *fractionToColor, int *ncolors, int *coloring, int *reordering, hipsparseColorInfo_t info)#

Coloring of the adjacency graph of the matrix A stored in the CSR format.

hipsparseXcsrcolor performs the coloring of the undirected graph represented by the (symmetric) sparsity pattern of the matrix A stored in CSR format. Graph coloring is a way of coloring the nodes of a graph such that no two adjacent nodes are of the same color. The fractionToColor is a parameter to only color a given percentage of the graph nodes, the remaining uncolored nodes receive distinct new colors. The optional reordering array is a permutation array such that unknowns of the same color are grouped. The matrix A must be stored as a general matrix with a symmetric sparsity pattern, and if the matrix A is non-symmetric then the user is responsible to provide the symmetric part A+AT2.

Parameters:
  • handle[in] handle to the hipsparse library context queue.

  • m[in] number of rows of sparse matrix A.

  • nnz[in] number of non-zero entries of sparse matrix A.

  • descrA[in] sparse matrix descriptor.

  • csrValA[in] array of nnz elements of the sparse CSR matrix.

  • csrRowPtrA[in] array of m+1 elements that point to the start of every row of the sparse CSR matrix.

  • csrColIndA[in] array of nnz elements containing the column indices of the sparse CSR matrix.

  • fractionToColor[in] fraction of nodes to be colored, which should be in the interval [0.0,1.0], for example 0.8 implies that 80 percent of nodes will be colored.

  • ncolors[out] resulting number of distinct colors.

  • coloring[out] resulting mapping of colors.

  • reordering[out] optional resulting reordering permutation if reordering is a non-null pointer.

  • info[inout] structure that holds the information collected during the coloring algorithm.

Return values:
  • HIPSPARSE_STATUS_SUCCESS – the operation completed successfully.

  • HIPSPARSE_STATUS_INVALID_VALUEhandle, m, nnz, descrA, csrValA, csrRowPtrA, csrColIndA, fractionToColor, ncolors, coloring or info pointer is invalid.