Skip to content

Commit

Permalink
adding C/C__ API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BradReesWork committed Oct 16, 2023
1 parent 63e282e commit ecc2952
Show file tree
Hide file tree
Showing 25 changed files with 385 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ datasets/*
# Jupyter Notebooks
.ipynb_checkpoints

## Doxygen
## Doxygen and Docs
cpp/doxygen/html
docs/cugraph/lib*

# created by Dask tests
python/dask-worker-space
Expand Down
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,34 @@ if hasArg docs || hasArg all; then
${CMAKE_GENERATOR_OPTION} \
${CMAKE_VERBOSE_OPTION}
fi

for PROJECT in libcugraphops libwholegraph; do
XML_DIR="${REPODIR}/docs/cugraph/${PROJECT}"
if [ -d ${XML_DIR} ]; then
echo "removing ${XML_DIR} docs dir"
rm -r ${XML_DIR}
fi
mkdir -p "${XML_DIR}"
export XML_DIR_${PROJECT^^}="$XML_DIR"

echo "downloading xml for ${PROJECT} into ${XML_DIR}. Environment variable XML_DIR_${PROJECT^^} is set to ${XML_DIR}"
curl -O "https://d1664dvumjb44w.cloudfront.net/${PROJECT}/xml_tar/${RAPIDS_VERSION}/xml.tar.gz" && tar -xzf xml.tar.gz -C "${XML_DIR}"
rm "./xml.tar.gz"
done

cd ${LIBCUGRAPH_BUILD_DIR}
cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} --target docs_cugraph ${VERBOSE_FLAG}

if [ -d ${REPODIR}/docs/cugraph/libcugraph ]; then
echo "removing libcugraph docs dir"
rm -r ${REPODIR}/docs/cugraph/libcugraph
fi
echo "making libcugraph doc dir"
mkdir -p ${REPODIR}/docs/cugraph/libcugraph

mv ${REPODIR}/cpp/doxygen/xml ${REPODIR}/docs/cugraph/libcugraph/_xml
mv ${REPODIR}/cpp/doxygen/html ${REPODIR}/docs/cugraph/libcugraph/html

cd ${REPODIR}/docs/cugraph
make html
fi
2 changes: 2 additions & 0 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pushd cpp/doxygen
doxygen Doxyfile
mkdir -p "${RAPIDS_DOCS_DIR}/libcugraph/html"
mv html/* "${RAPIDS_DOCS_DIR}/libcugraph/html"
mkdir -p "${RAPIDS_DOCS_DIR}/libcugraph/_xml"
mv xml/* "${RAPIDS_DOCS_DIR}/libcugraph/_xml"
popd

rapids-logger "Build Python docs"
Expand Down
2 changes: 1 addition & 1 deletion cpp/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = NO
GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand Down
26 changes: 18 additions & 8 deletions cpp/include/cugraph_c/centrality_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include <cugraph_c/resource_handle.h>

/** @defgroup centrality Centrality algorithms
* @ingroup c_api
* @{
*/

#ifdef __cplusplus
Expand All @@ -39,7 +37,8 @@ typedef struct {
} cugraph_centrality_result_t;

/**
* @brief Get the vertex ids from the centrality result
* @ingroup centrality
* @brief Get the vertex ids from the centrality result
*
* @param [in] result The result from a centrality algorithm
* @return type erased array of vertex ids
Expand All @@ -48,7 +47,8 @@ cugraph_type_erased_device_array_view_t* cugraph_centrality_result_get_vertices(
cugraph_centrality_result_t* result);

/**
* @brief Get the centrality values from a centrality algorithm result
* @ingroup centrality
* @brief Get the centrality values from a centrality algorithm result
*
* @param [in] result The result from a centrality algorithm
* @return type erased array view of centrality values
Expand All @@ -57,6 +57,7 @@ cugraph_type_erased_device_array_view_t* cugraph_centrality_result_get_values(
cugraph_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Get the number of iterations executed from the algorithm metadata
*
* @param [in] result The result from a centrality algorithm
Expand All @@ -65,6 +66,7 @@ cugraph_type_erased_device_array_view_t* cugraph_centrality_result_get_values(
size_t cugraph_centrality_result_get_num_iterations(cugraph_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Returns true if the centrality algorithm converged
*
* @param [in] result The result from a centrality algorithm
Expand All @@ -73,6 +75,7 @@ size_t cugraph_centrality_result_get_num_iterations(cugraph_centrality_result_t*
bool_t cugraph_centrality_result_converged(cugraph_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Free centrality result
*
* @param [in] result The result from a centrality algorithm
Expand Down Expand Up @@ -409,6 +412,7 @@ typedef struct {
} cugraph_edge_centrality_result_t;

/**
* @ingroup centrality
* @brief Get the src vertex ids from an edge centrality result
*
* @param [in] result The result from an edge centrality algorithm
Expand All @@ -418,6 +422,7 @@ cugraph_type_erased_device_array_view_t* cugraph_edge_centrality_result_get_src_
cugraph_edge_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Get the dst vertex ids from an edge centrality result
*
* @param [in] result The result from an edge centrality algorithm
Expand All @@ -427,6 +432,7 @@ cugraph_type_erased_device_array_view_t* cugraph_edge_centrality_result_get_dst_
cugraph_edge_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Get the edge ids from an edge centrality result
*
* @param [in] result The result from an edge centrality algorithm
Expand All @@ -436,6 +442,7 @@ cugraph_type_erased_device_array_view_t* cugraph_edge_centrality_result_get_edge
cugraph_edge_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Get the centrality values from an edge centrality algorithm result
*
* @param [in] result The result from an edge centrality algorithm
Expand All @@ -445,6 +452,7 @@ cugraph_type_erased_device_array_view_t* cugraph_edge_centrality_result_get_valu
cugraph_edge_centrality_result_t* result);

/**
* @ingroup centrality
* @brief Free centrality result
*
* @param [in] result The result from a centrality algorithm
Expand Down Expand Up @@ -491,6 +499,7 @@ typedef struct {
} cugraph_hits_result_t;

/**
* @ingroup centrality
* @brief Get the vertex ids from the hits result
*
* @param [in] result The result from hits
Expand All @@ -500,6 +509,7 @@ cugraph_type_erased_device_array_view_t* cugraph_hits_result_get_vertices(
cugraph_hits_result_t* result);

/**
* @ingroup centrality
* @brief Get the hubs values from the hits result
*
* @param [in] result The result from hits
Expand All @@ -509,6 +519,7 @@ cugraph_type_erased_device_array_view_t* cugraph_hits_result_get_hubs(
cugraph_hits_result_t* result);

/**
* @ingroup centrality
* @brief Get the authorities values from the hits result
*
* @param [in] result The result from hits
Expand All @@ -518,6 +529,7 @@ cugraph_type_erased_device_array_view_t* cugraph_hits_result_get_authorities(
cugraph_hits_result_t* result);

/**
* @ingroup centrality
* @brief Get the score differences between the last two iterations
*
* @param [in] result The result from hits
Expand All @@ -526,6 +538,7 @@ cugraph_type_erased_device_array_view_t* cugraph_hits_result_get_authorities(
double cugraph_hits_result_get_hub_score_differences(cugraph_hits_result_t* result);

/**
* @ingroup centrality
* @brief Get the actual number of iterations
*
* @param [in] result The result from hits
Expand All @@ -534,6 +547,7 @@ double cugraph_hits_result_get_hub_score_differences(cugraph_hits_result_t* resu
size_t cugraph_hits_result_get_number_of_iterations(cugraph_hits_result_t* result);

/**
* @ingroup centrality
* @brief Free hits result
*
* @param [in] result The result from hits
Expand Down Expand Up @@ -585,7 +599,3 @@ cugraph_error_code_t cugraph_hits(
#ifdef __cplusplus
}
#endif

/**
* @}
*/
1 change: 0 additions & 1 deletion cpp/include/cugraph_c/community_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <cugraph_c/resource_handle.h>

/** @defgroup community Community algorithms
* @ingroup c_api
* @{
*/

Expand Down
14 changes: 13 additions & 1 deletion cpp/include/cugraph_c/core_algorithms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,9 @@
#include <cugraph_c/graph.h>
#include <cugraph_c/resource_handle.h>

/** @defgroup core Core algorithms
*/

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -40,6 +43,7 @@ typedef struct {
} cugraph_k_core_result_t;

/**
* @ingroup core
* @brief Create a core_number result (in case it was previously extracted)
*
* @param [in] handle Handle for accessing resources
Expand All @@ -58,6 +62,7 @@ cugraph_error_code_t cugraph_core_result_create(
cugraph_error_t** error);

/**
* @ingroup core
* @brief Get the vertex ids from the core result
*
* @param [in] result The result from core number
Expand All @@ -67,6 +72,7 @@ cugraph_type_erased_device_array_view_t* cugraph_core_result_get_vertices(
cugraph_core_result_t* result);

/**
* @ingroup core
* @brief Get the core numbers from the core result
*
* @param [in] result The result from core number
Expand All @@ -76,13 +82,15 @@ cugraph_type_erased_device_array_view_t* cugraph_core_result_get_core_numbers(
cugraph_core_result_t* result);

/**
* @ingroup core
* @brief Free core result
*
* @param [in] result The result from core number
*/
void cugraph_core_result_free(cugraph_core_result_t* result);

/**
* @ingroup core
* @brief Get the src vertex ids from the k-core result
*
* @param [in] result The result from k-core
Expand All @@ -92,6 +100,7 @@ cugraph_type_erased_device_array_view_t* cugraph_k_core_result_get_src_vertices(
cugraph_k_core_result_t* result);

/**
* @ingroup core
* @brief Get the dst vertex ids from the k-core result
*
* @param [in] result The result from k-core
Expand All @@ -101,6 +110,7 @@ cugraph_type_erased_device_array_view_t* cugraph_k_core_result_get_dst_vertices(
cugraph_k_core_result_t* result);

/**
* @ingroup core
* @brief Get the weights from the k-core result
*
* Returns NULL if the graph is unweighted
Expand All @@ -112,13 +122,15 @@ cugraph_type_erased_device_array_view_t* cugraph_k_core_result_get_weights(
cugraph_k_core_result_t* result);

/**
* @ingroup core
* @brief Free k-core result
*
* @param [in] result The result from k-core
*/
void cugraph_k_core_result_free(cugraph_k_core_result_t* result);

/**
* @ingroup core
* @brief Enumeration for computing core number
*/
typedef enum {
Expand Down
11 changes: 4 additions & 7 deletions cpp/include/cugraph_c/labeling_algorithms.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,8 +25,6 @@ extern "C" {
#endif

/** @defgroup labeling Labeling algorithms
* @ingroup c_api
* @{
*/

/**
Expand All @@ -37,6 +35,7 @@ typedef struct {
} cugraph_labeling_result_t;

/**
* @ingroup labeling
* @brief Get the vertex ids from the labeling result
*
* @param [in] result The result from a labeling algorithm
Expand All @@ -46,6 +45,7 @@ cugraph_type_erased_device_array_view_t* cugraph_labeling_result_get_vertices(
cugraph_labeling_result_t* result);

/**
* @ingroup labeling
* @brief Get the label values from the labeling result
*
* @param [in] result The result from a labeling algorithm
Expand All @@ -55,6 +55,7 @@ cugraph_type_erased_device_array_view_t* cugraph_labeling_result_get_labels(
cugraph_labeling_result_t* result);

/**
* @ingroup labeling
* @brief Free labeling result
*
* @param [in] result The result from a labeling algorithm
Expand Down Expand Up @@ -104,7 +105,3 @@ cugraph_error_code_t cugraph_strongly_connected_components(const cugraph_resourc
#ifdef __cplusplus
}
#endif

/**
* @}
*/
3 changes: 1 addition & 2 deletions cpp/include/cugraph_c/sampling_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include <cugraph_c/random.h>
#include <cugraph_c/resource_handle.h>

/** @defgroup sampling Sampling algorithms
* @ingroup c_api
/** @defgroup samplingC Sampling algorithms
* @{
*/

Expand Down
Loading

0 comments on commit ecc2952

Please sign in to comment.