From eab3d792ff5552ea25f2d55f7c4b099dccce612c Mon Sep 17 00:00:00 2001 From: acostadon Date: Fri, 17 Jan 2025 12:32:56 -0500 Subject: [PATCH] Added more doxygen groups and fixed some existing onee --- .../cugraph/detail/collect_comm_wrapper.hpp | 5 +--- .../cugraph/detail/shuffle_wrappers.hpp | 17 +++++------ .../cugraph/detail/utility_wrappers.hpp | 18 +++++++++++- cpp/include/cugraph/graph_generators.hpp | 23 +++++++++------ cpp/include/cugraph/legacy/graph.hpp | 28 +++++++++++++------ 5 files changed, 62 insertions(+), 29 deletions(-) diff --git a/cpp/include/cugraph/detail/collect_comm_wrapper.hpp b/cpp/include/cugraph/detail/collect_comm_wrapper.hpp index f2307705ac0..7d65991c2ac 100644 --- a/cpp/include/cugraph/detail/collect_comm_wrapper.hpp +++ b/cpp/include/cugraph/detail/collect_comm_wrapper.hpp @@ -28,11 +28,8 @@ namespace detail { /** @defgroup collect_comm_wrapper_cpp C++ Shuffle Wrappers */ -/** @ingroup collect_comm_wrapper_cpp - * @{ - */ - /** + * @ingroup collect_comm_wrapper_cpp * @brief Gather the span of data from all ranks and broadcast the combined data to all ranks. * * @param[in] handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, diff --git a/cpp/include/cugraph/detail/shuffle_wrappers.hpp b/cpp/include/cugraph/detail/shuffle_wrappers.hpp index e0d8e7f0275..18afc61186e 100644 --- a/cpp/include/cugraph/detail/shuffle_wrappers.hpp +++ b/cpp/include/cugraph/detail/shuffle_wrappers.hpp @@ -28,11 +28,8 @@ namespace detail { /** @defgroup shuffle_wrappers_cpp C++ Shuffle Wrappers */ -/** @ingroup shuffle_wrappers_cpp - * @{ - */ - /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle external (i.e. before renumbering) vertex pairs (which can be edge end points) to * their local GPUs based on edge partitioning. * @@ -71,6 +68,7 @@ shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( std::optional>&& edge_types); /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle internal (i.e. renumbered) vertex pairs (which can be edge end points) to their * local GPUs based on edge partitioning. * @@ -113,6 +111,7 @@ shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( std::vector const& vertex_partition_range_lasts); /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle external (i.e. before renumbering) vertices to their local GPU based on vertex * partitioning. * @@ -129,6 +128,7 @@ rmm::device_uvector shuffle_ext_vertices_to_local_gpu_by_vertex_partit raft::handle_t const& handle, rmm::device_uvector&& vertices); /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle external (i.e. before renumbering) vertex & value pairs to their local GPU based * on vertex partitioning. * @@ -150,6 +150,7 @@ shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( rmm::device_uvector&& values); /** + * @ingroup shuffle_wrappers_cpp * @brief Permute a range. * * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. @@ -172,6 +173,7 @@ rmm::device_uvector permute_range(raft::handle_t const& handle, bool do_expensive_check = false); /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle internal (i.e. renumbered) vertices to their local GPUs based on vertex * partitioning. * @@ -192,6 +194,7 @@ rmm::device_uvector shuffle_int_vertices_to_local_gpu_by_vertex_partit std::vector const& vertex_partition_range_lasts); /** + * @ingroup shuffle_wrappers_cpp * @brief Shuffle vertices using the internal vertex key function which returns the target GPU ID. * * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. @@ -214,6 +217,7 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( std::vector const& vertex_partition_range_lasts); /** + * @ingroup shuffle_wrappers_cpp * @brief Groupby and count edgelist using the key function which returns the target local partition * ID for an edge. * @@ -248,6 +252,7 @@ rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( bool groupby_and_count_local_partition_by_minor = false); /** + * @ingroup shuffle_wrappers_cpp * @brief Collect vertex values (represented as k/v pairs across cluster) and return * local value arrays on the GPU responsible for each vertex. * @@ -283,7 +288,3 @@ rmm::device_uvector collect_local_vertex_values_from_ext_vertex_value_p } // namespace detail } // namespace cugraph - -/** - * @} - */ diff --git a/cpp/include/cugraph/detail/utility_wrappers.hpp b/cpp/include/cugraph/detail/utility_wrappers.hpp index b1afeafd66b..292ad2615cf 100644 --- a/cpp/include/cugraph/detail/utility_wrappers.hpp +++ b/cpp/include/cugraph/detail/utility_wrappers.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-2025, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,11 @@ namespace cugraph { namespace detail { +/** @defgroup utility_wrappers_cpp C++ Utility Wrappers + */ + /** + * @ingroup utility_wrappers_cpp * @brief Fill a buffer with uniformly distributed random values * * Fills a buffer with uniformly distributed random values between @@ -51,6 +55,7 @@ void uniform_random_fill(rmm::cuda_stream_view const& stream_view, raft::random::RngState& rng_state); /** + * @ingroup utility_wrappers_cpp * @brief Fill a buffer with a constant value * * @tparam value_t type of the value to operate on @@ -66,6 +71,7 @@ template void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, value_t value); /** + * @ingroup utility_wrappers_cpp * @brief Sort a device span * * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t. @@ -79,6 +85,7 @@ template void sort_ints(raft::handle_t const& handle, raft::device_span values); /** + * @ingroup utility_wrappers_cpp * @brief Keep unique element from a device span * * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t. @@ -93,6 +100,7 @@ template size_t unique_ints(raft::handle_t const& handle, raft::device_span values); /** + * @ingroup utility_wrappers_cpp * @brief Increment the values of a device span by a constant value * * @tparam value_t type of the value to operate on. Must be either int32_t or int64_t. @@ -108,6 +116,7 @@ void transform_increment_ints(raft::device_span values, rmm::cuda_stream_view const& stream_view); /** + * @ingroup utility_wrappers_cpp * @brief Fill a buffer with a sequence of values * * Fills the buffer with the sequence: @@ -130,6 +139,7 @@ void sequence_fill(rmm::cuda_stream_view const& stream_view, value_t start_value); /** + * @ingroup utility_wrappers_cpp * @brief Fill a buffer with a sequence of values with the input stride * * Fills the buffer with the sequence with the input stride: @@ -152,6 +162,7 @@ void stride_fill(rmm::cuda_stream_view const& stream_view, value_t stride); /** + * @ingroup utility_wrappers_cpp * @brief Compute the maximum vertex id of an edge list * * max(d_edgelist_srcs.max(), d_edgelist_dsts.max()) @@ -172,6 +183,7 @@ vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, size_t num_edges); /** + * @ingroup utility_wrappers_cpp * @brief Compute the maximum vertex id of an edge list * * max(d_edgelist_srcs.max(), d_edgelist_dsts.max()) @@ -194,6 +206,7 @@ vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, } /** + * @ingroup utility_wrappers_cpp * @brief Filter zero degree vertices from this frontier * * @tparam vertex_t vertex type @@ -211,6 +224,7 @@ std::tuple, rmm::device_uvector> filter_de rmm::device_uvector&& d_out_degs); /** + * @ingroup utility_wrappers_cpp * @brief Check if device span is sorted * * @tparam data_t type of data in span @@ -223,6 +237,7 @@ template bool is_sorted(raft::handle_t const& handle, raft::device_span span); /** + * @ingroup utility_wrappers_cpp * @brief Check if two device spans are equal. Returns true if every element in the spans are * equal. * @@ -239,6 +254,7 @@ bool is_equal(raft::handle_t const& handle, raft::device_span span2); /** + * @ingroup utility_wrappers_cpp * @brief Count the number of times a value appears in a span * * @tparam data_t type of data in span diff --git a/cpp/include/cugraph/graph_generators.hpp b/cpp/include/cugraph/graph_generators.hpp index 7246f0b2fb7..d1f424d9791 100644 --- a/cpp/include/cugraph/graph_generators.hpp +++ b/cpp/include/cugraph/graph_generators.hpp @@ -27,13 +27,10 @@ /** @defgroup graph_generators_cpp C++ Graph Generators */ -/** @ingroup graph_generators_cpp - * @{ - */ - namespace cugraph { /** + * @ingroup graph_generators_cpp * @brief generate an edge list for an R-mat graph. * @deprecated This function will be deprectated and should be replaced with the version that takes * raft::random::RngState as a parameter @@ -92,6 +89,7 @@ std::tuple, rmm::device_uvector> generat bool scramble_vertex_ids = false); /** + * @ingroup graph_generators_cpp * @brief generate an edge list for an R-mat graph. * * This function allows multi-edges and self-loops similar to the Graph 500 reference @@ -143,6 +141,7 @@ std::tuple, rmm::device_uvector> generat bool scramble_vertex_ids = false); /** + * @ingroup graph_generators_cpp * @brief generate an edge list for a bipartite R-mat graph. * * The source vertex IDs will be in the range of [0, 2^src_scale) and the destination vertex IDs @@ -184,6 +183,7 @@ generate_bipartite_rmat_edgelist(raft::handle_t const& handle, enum class generator_distribution_t { POWER_LAW = 0, UNIFORM }; /** + * @ingroup graph_generators_cpp * @brief generate multiple edge lists using the R-mat graph generator. * @deprecated This function will be deprectated and should be replaced with the version that takes *raft::random::RngState as a parameter @@ -236,6 +236,7 @@ generate_rmat_edgelists( bool scramble_vertex_ids = false); /** + * @ingroup graph_generators_cpp * @brief generate multiple edge lists using the R-mat graph generator. * * This function allows multi-edges and self-loops similar to the Graph 500 reference @@ -286,6 +287,7 @@ generate_rmat_edgelists( bool scramble_vertex_ids = false); /** + * @ingroup graph_generators_cpp * @brief generate an edge list for path graph * * A path graph of size n connects the vertices from 0 to (n - 1) @@ -315,6 +317,7 @@ generate_path_graph_edgelist( std::vector> const& component_parameters_v); /** + * @ingroup graph_generators_cpp * @brief generate an edge list for a 2D Mesh Graph * * A sequence of 2D mesh graphs will be constructed according to the @@ -340,6 +343,7 @@ generate_2d_mesh_graph_edgelist( std::vector> const& component_parameters_v); /** + * @ingroup graph_generators_cpp * @brief generate an edge list for a 3D Mesh Graph * * A sequence of 3D mesh graphs will be constructed according to the @@ -365,6 +369,7 @@ generate_3d_mesh_graph_edgelist( std::vector> const& component_parameters_v); /** + * @ingroup graph_generators_cpp * @brief generate an edge lists for some complete graphs * * A sequence of complete graphs will be constructed according to the @@ -390,6 +395,7 @@ generate_complete_graph_edgelist( std::vector> const& component_parameters_v); /** + * @ingroup graph_generators_cpp * @brief generate an edge lists for an Erdos-Renyi graph * * This API supports the G(n,p) model which requires O(n^2) work. @@ -417,6 +423,7 @@ generate_erdos_renyi_graph_edgelist_gnp(raft::handle_t const& handle, uint64_t seed = 0); /** + * @ingroup graph_generators_cpp * @brief generate an edge lists for an Erdos-Renyi graph * * This API supports the G(n,m) model @@ -444,6 +451,7 @@ generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, uint64_t seed = 0); /** + * @ingroup graph_generators_cpp * @brief symmetrize an edgelist from the edges in the lower (or upper but not both) triangular part * of a graph adjacency matrix * @@ -471,6 +479,7 @@ symmetrize_edgelist_from_triangular( bool check_diagonal = false); /** + * @ingroup graph_generators_cpp * @brief scramble vertex IDs in a graph * * Given a vertex list for a graph, scramble the input vertex IDs. @@ -491,6 +500,7 @@ rmm::device_uvector scramble_vertex_ids(raft::handle_t const& handle, size_t lgN); /** + * @ingroup graph_generators_cpp * @brief scramble vertex ids in a graph * * Given an edge list for a graph, scramble the input vertex IDs. @@ -515,6 +525,7 @@ std::tuple, rmm::device_uvector> scrambl size_t lgN); /** + * @ingroup graph_generators_cpp * @brief Combine edgelists from multiple sources into a single edgelist * * If executed in a multi-gpu context (handle comms has been initialized) @@ -543,7 +554,3 @@ combine_edgelists(raft::handle_t const& handle, bool remove_multi_edges = true); } // namespace cugraph - -/** - * @} - */ diff --git a/cpp/include/cugraph/legacy/graph.hpp b/cpp/include/cugraph/legacy/graph.hpp index 18d57533d62..088d4cc6eb4 100644 --- a/cpp/include/cugraph/legacy/graph.hpp +++ b/cpp/include/cugraph/legacy/graph.hpp @@ -51,11 +51,8 @@ enum class DegreeDirection { /** @defgroup legacy_graph_cpp C++ Legacy Graph */ -/** @ingroup legacy_graph_cpp - * @{ - */ - /** + * @ingroup legacy_graph_cpp * @brief Base class graphs, all but vertices and edges * * @tparam vertex_t Type of vertex id @@ -86,6 +83,7 @@ class GraphViewBase { vertex_t get_local_vertex_first() const { return vertex_t{0}; } /** + * @ingroup legacy_graph_cpp * @brief Fill the identifiers array with the vertex identifiers. * * @param[out] identifiers Pointer to device memory to store the vertex @@ -118,6 +116,7 @@ class GraphViewBase { }; /** + * @ingroup legacy_graph_cpp * @brief A graph stored in COO (COOrdinate) format. * * @tparam vertex_t Type of vertex id @@ -131,6 +130,7 @@ class GraphCOOView : public GraphViewBase { vertex_t* dst_indices{nullptr}; ///< colInd /** + * @ingroup legacy_graph_cpp * @brief Computes degree(in, out, in+out) of all the nodes of a Graph * * @throws cugraph::logic_error when an error occurs. @@ -148,6 +148,7 @@ class GraphCOOView : public GraphViewBase { GraphCOOView() : GraphViewBase(nullptr, 0, 0) {} /** + * @ingroup legacy_graph_cpp * @brief Wrap existing arrays representing an edge list in a Graph. * * GraphCOOView does not own the memory used to represent this @@ -180,6 +181,7 @@ class GraphCOOView : public GraphViewBase { }; /** + * @ingroup legacy_graph_cpp * @brief Base class for graph stored in CSR (Compressed Sparse Row) * format or CSC (Compressed * Sparse Column) format @@ -195,6 +197,7 @@ class GraphCompressedSparseBaseView : public GraphViewBase { public: /** * @brief Default constructor + * @ingroup legacy_graph_cpp + */ GraphCSR() : GraphCompressedSparseBase() {} /** + * @ingroup legacy_graph_cpp * @brief Take ownership of the provided graph arrays in CSR format * * @param number_of_vertices The number of vertices in the graph @@ -582,7 +598,3 @@ struct invalid_edge_id : invalid_idx {}; } // namespace cugraph #include "eidecl_graph.hpp" - -/** - * @} - */