Skip to content

Commit

Permalink
update for C++
Browse files Browse the repository at this point in the history
  • Loading branch information
BradReesWork committed Sep 13, 2023
1 parent 5f54928 commit 8109f7f
Show file tree
Hide file tree
Showing 18 changed files with 252 additions and 73 deletions.
7 changes: 1 addition & 6 deletions cpp/include/cugraph/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <tuple>

/** @ingroup cpp_api
* @{
*/

namespace cugraph {
Expand Down Expand Up @@ -2078,7 +2077,7 @@ rmm::device_uvector<weight_t> sorensen_coefficients(
raft::handle_t const& handle,
graph_view_t<vertex_t, edge_t, false, multi_gpu> const& graph_view,
std::optional<edge_property_view_t<edge_t, weight_t const*>> edge_weight_view,
std::tuple<raft::device_span<vertex_t const>, raft::device_span<vertex_t const>> vertex_pairs,
std::tuple<raft::device_span<vertex_t const>,raft::device_span<vertex_t const>> vertex_pairs,
bool do_expensive_check = false);

/**
Expand Down Expand Up @@ -2162,7 +2161,3 @@ rmm::device_uvector<vertex_t> maximal_independent_set(
raft::random::RngState& rng_state);

} // namespace cugraph

/**
* @}
*/
61 changes: 28 additions & 33 deletions cpp/include/cugraph_c/sampling_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@
#include <cugraph_c/random.h>
#include <cugraph_c/resource_handle.h>

/** @defgroup sampling Sampling algorithms
*/

/**
* @defgroup sampling_test
* @ingroup c_api
/** @defgroup samplingC Sampling algorithms
*/

#ifdef __cplusplus
Expand Down Expand Up @@ -138,7 +133,7 @@ cugraph_error_code_t cugraph_node2vec(const cugraph_resource_handle_t* handle,
cugraph_error_t** error);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the max path length from random walk result
*
* @param [in] result The result from random walks
Expand All @@ -150,7 +145,7 @@ size_t cugraph_random_walk_result_get_max_path_length(cugraph_random_walk_result
// difference at the moment is that RW results contain weights
// and extract_paths results don't. But that's probably wrong.
/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the matrix (row major order) of vertices in the paths
*
* @param [in] result The result from a random walk algorithm
Expand All @@ -160,7 +155,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_paths(
cugraph_random_walk_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the matrix (row major order) of edge weights in the paths
*
* @param [in] result The result from a random walk algorithm
Expand All @@ -170,7 +165,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_weights(
cugraph_random_walk_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief If the random walk result is compressed, get the path sizes
* @deprecated This call will no longer be relevant once the new node2vec are called
*
Expand All @@ -181,7 +176,7 @@ cugraph_type_erased_device_array_view_t* cugraph_random_walk_result_get_path_siz
cugraph_random_walk_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Free random walks result
*
* @param [in] result The result from random walks
Expand All @@ -203,7 +198,7 @@ typedef struct {
} cugraph_sampling_options_t;

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Enumeration for prior sources behavior
*/
typedef enum cugraph_prior_sources_behavior_t {
Expand All @@ -215,7 +210,7 @@ typedef enum cugraph_prior_sources_behavior_t {
} cugraph_prior_sources_behavior_t;

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Create sampling options object
*
* All sampling options set to FALSE
Expand All @@ -228,7 +223,7 @@ cugraph_error_code_t cugraph_sampling_options_create(cugraph_sampling_options_t*
cugraph_error_t** error);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Set flag to renumber results
*
* @param options - opaque pointer to the sampling options
Expand All @@ -237,7 +232,7 @@ cugraph_error_code_t cugraph_sampling_options_create(cugraph_sampling_options_t*
void cugraph_sampling_set_renumber_results(cugraph_sampling_options_t* options, bool_t value);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Set flag to sample with_replacement
*
* @param options - opaque pointer to the sampling options
Expand All @@ -246,7 +241,7 @@ void cugraph_sampling_set_renumber_results(cugraph_sampling_options_t* options,
void cugraph_sampling_set_with_replacement(cugraph_sampling_options_t* options, bool_t value);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Set flag to sample return_hops
*
* @param options - opaque pointer to the sampling options
Expand All @@ -255,7 +250,7 @@ void cugraph_sampling_set_with_replacement(cugraph_sampling_options_t* options,
void cugraph_sampling_set_return_hops(cugraph_sampling_options_t* options, bool_t value);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Set prior sources behavior
*
* @param options - opaque pointer to the sampling options
Expand All @@ -274,7 +269,7 @@ void cugraph_sampling_set_prior_sources_behavior(cugraph_sampling_options_t* opt
void cugraph_sampling_set_dedupe_sources(cugraph_sampling_options_t* options, bool_t value);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Free sampling options object
*
* @param [in] options Opaque pointer to sampling object
Expand Down Expand Up @@ -390,7 +385,7 @@ cugraph_error_code_t cugraph_uniform_neighbor_sample(
cugraph_error_t** error);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the source vertices from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -400,7 +395,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_sources(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the destination vertices from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -410,7 +405,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_destinations(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the start labels from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -420,7 +415,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_start_labels(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the edge_id from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -430,7 +425,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_id(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the edge_type from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -440,7 +435,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_type(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the edge_weight from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -450,7 +445,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_edge_weight(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the hop from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -460,7 +455,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_hop(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the index from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -470,7 +465,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_index(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the result offsets from the sampling algorithm result
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -480,7 +475,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_offsets(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the renumber map
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -490,7 +485,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map(
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Get the renumber map offsets
*
* @param [in] result The result from a sampling algorithm
Expand All @@ -500,15 +495,15 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map_
const cugraph_sample_result_t* result);

/**
* @ingroup sampling
* @ingroup samplingC
* @brief Free a sampling result
*
* @param [in] result The result from a sampling algorithm
*/
void cugraph_sample_result_free(cugraph_sample_result_t* result);

/**
* @ingroup sampling_test
* @ingroup samplingC
* @brief Create a sampling result (testing API)
*
* @param [in] handle Handle for accessing resources
Expand Down Expand Up @@ -539,7 +534,7 @@ cugraph_error_code_t cugraph_test_sample_result_create(
cugraph_error_t** error);

/**
* @ingroup sampling_test
* @ingroup samplingC
* @brief Create a sampling result (testing API)
*
* @param [in] handle Handle for accessing resources
Expand Down Expand Up @@ -570,7 +565,7 @@ cugraph_error_code_t cugraph_test_uniform_neighborhood_sample_result_create(
cugraph_error_t** error);

/**
* @ingroup sampling_test
* @ingroup samplingC
* @brief Select random vertices from the graph
*
* @param [in] handle Handle for accessing resources
Expand Down
4 changes: 2 additions & 2 deletions docs/cugraph/source/api_docs/cugraph/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cugraph Python API Reference
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/cugraph/source/api_docs/cugraph_c/labeling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Weakly Connected Components
:project: libcugraph

Strongly Connected Components
--------
-----------------------------
.. doxygenfunction:: cugraph_strongly_connected_components
:project: libcugraph

Expand Down
12 changes: 4 additions & 8 deletions docs/cugraph/source/api_docs/cugraph_c/sampling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ Uniform Neighborhood Sampling
.. doxygenfunction:: cugraph_uniform_neighbor_sample
:project: libcugraph

Sampling Testing
----------------
.. doxygenfunction:: sampling_test
:project: libcugraph

Support
-------
.. doxygenfunction:: sampling
:project: libcugraph

.. doxygengroup:: samplingC
:project: libcugraph
:members:
:content-only:
8 changes: 5 additions & 3 deletions docs/cugraph/source/api_docs/cugraph_c/similarity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Jaccard

Sorensen
--------
.. jaccard:: cugraph_sorensen_coefficients
.. doxygenfunction:: cugraph_sorensen_coefficients
:project: libcugraph

Overlap
Expand All @@ -19,5 +19,7 @@ Overlap

Support
-------
.. doxygenfunction:: similarity
:project: libcugraph
.. doxygengroup:: similarity
:project: libcugraph
:members:
:content-only:
8 changes: 5 additions & 3 deletions docs/cugraph/source/api_docs/cugraph_c/traversal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Breadth First Search (BFS)

Single-Source Shortest-Path (SSSP)
----------------------------------
.. jaccard:: cugraph_sssp
.. doxygenfunction:: cugraph_sssp
:project: libcugraph

Path Extraction
Expand All @@ -24,5 +24,7 @@ Extract Max Path Length

Support
-------
.. doxygenfunction:: traversal
:project: libcugraph
.. doxygengroup:: traversal
:project: libcugraph
:members:
:content-only:
Loading

0 comments on commit 8109f7f

Please sign in to comment.