Sparse reordering functions#
This module contains 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.
hipsparseXcsrcolorperforms 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. ThefractionToColoris a parameter to only color a given percentage of the graph nodes, the remaining uncolored nodes receive distinct new colors. The optionalreorderingarray 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 \(\frac{A+A^T}{2}\).- Deprecated:
This function is deprecated when using the CUDA backend (CUDA 12.0+) and will be removed in CUDA 13.0. This deprecation does not apply to the ROCm backend.
- Parameters:
handle – [in] handle to the hipsparse library context queue.
m – [in] number of rows of sparse matrix \(A\). Must be non-negative.
nnz – [in] number of non-zero entries of sparse matrix \(A\). Must be non-negative.
descrA – [in] sparse matrix descriptor.
csrValA – [in] array of
nnzelements of the sparse CSR matrix.csrRowPtrA – [in] array of
m+1elements that point to the start of every row of the sparse CSR matrix.csrColIndA – [in] array of
nnzelements 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
reorderingis 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_NOT_INITIALIZED –
handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE –
handle,descrA,fractionToColor,ncolors,coloringorinfois nullptr,mornnzis negative, orcsrValA,csrRowPtrAorcsrColIndAis nullptr whennnzis greater than zero.