From 3224a6539fabe6346747bee6a69cd3c8211366aa Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:07:37 -0400 Subject: [PATCH 1/4] Delete the deprecated data_type_id_t enum (#4737) Prep work for temporal graphs. We renamed `data_type_id_t` to `cugraph_data_id_t` about 8 months ago, this finishes the transition. We also split the types out into their own file in the C API. Marked as breaking since we are deleting a deprecated type from the C API. Authors: - Chuck Hastings (https://github.com/ChuckHastings) - Ralph Liu (https://github.com/nv-rliu) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4737 --- cpp/include/cugraph_c/resource_handle.h | 17 +---- cpp/include/cugraph_c/types.h | 47 ++++++++++++ cpp/src/c_api/array.cpp | 3 +- cpp/tests/c_api/biased_neighbor_sample_test.c | 70 ++++++++--------- cpp/tests/c_api/c_test_utils.h | 10 +-- cpp/tests/c_api/count_multi_edges_test.c | 10 +-- cpp/tests/c_api/create_graph_test.c | 36 ++++----- cpp/tests/c_api/ecg_test.c | 10 +-- cpp/tests/c_api/egonet_test.c | 10 +-- cpp/tests/c_api/induced_subgraph_test.c | 4 +- cpp/tests/c_api/k_core_test.c | 11 +-- cpp/tests/c_api/k_truss_test.c | 10 +-- cpp/tests/c_api/legacy_spectral_test.c | 20 ++--- cpp/tests/c_api/leiden_test.c | 11 +-- cpp/tests/c_api/louvain_test.c | 10 +-- .../c_api/mg_biased_neighbor_sample_test.c | 40 +++++----- cpp/tests/c_api/mg_count_multi_edges_test.c | 10 +-- cpp/tests/c_api/mg_create_graph_test.c | 18 ++--- cpp/tests/c_api/mg_generate_rmat_test.c | 12 +-- cpp/tests/c_api/mg_induced_subgraph_test.c | 6 +- cpp/tests/c_api/mg_k_truss_test.c | 4 +- cpp/tests/c_api/mg_lookup_src_dst_test.c | 10 +-- cpp/tests/c_api/mg_negative_sampling_test.c | 22 +++--- cpp/tests/c_api/mg_pagerank_test.c | 8 +- cpp/tests/c_api/mg_similarity_test.c | 4 +- cpp/tests/c_api/mg_test_utils.cpp | 38 +++++----- cpp/tests/c_api/mg_test_utils.h | 10 +-- .../c_api/mg_uniform_neighbor_sample_test.c | 40 +++++----- cpp/tests/c_api/negative_sampling_test.c | 22 +++--- cpp/tests/c_api/pagerank_test.c | 8 +- cpp/tests/c_api/similarity_test.c | 8 +- cpp/tests/c_api/test_utils.cpp | 22 +++--- .../c_api/uniform_neighbor_sample_test.c | 76 +++++++++---------- .../pylibcugraph/_cugraph_c/algorithms.pxd | 4 +- .../pylibcugraph/_cugraph_c/array.pxd | 20 ++--- .../_cugraph_c/centrality_algorithms.pxd | 4 +- .../_cugraph_c/community_algorithms.pxd | 4 +- .../_cugraph_c/core_algorithms.pxd | 4 +- .../pylibcugraph/_cugraph_c/graph.pxd | 4 +- .../_cugraph_c/graph_functions.pxd | 4 +- .../_cugraph_c/graph_generators.pxd | 6 +- .../_cugraph_c/labeling_algorithms.pxd | 4 +- .../_cugraph_c/lookup_src_dst.pxd | 4 +- .../_cugraph_c/resource_handle.pxd | 18 ----- .../_cugraph_c/sampling_algorithms.pxd | 4 +- .../_cugraph_c/similarity_algorithms.pxd | 4 +- .../pylibcugraph/_cugraph_c/types.pxd | 40 ++++++++++ .../all_pairs_cosine_coefficients.pyx | 4 +- .../all_pairs_jaccard_coefficients.pyx | 4 +- .../all_pairs_overlap_coefficients.pyx | 4 +- .../all_pairs_sorensen_coefficients.pyx | 4 +- .../pylibcugraph/balanced_cut_clustering.pyx | 4 +- .../pylibcugraph/betweenness_centrality.pyx | 4 +- python/pylibcugraph/pylibcugraph/bfs.pyx | 4 +- .../pylibcugraph/biased_neighbor_sample.pyx | 4 +- .../pylibcugraph/pylibcugraph/core_number.pyx | 5 +- .../pylibcugraph/cosine_coefficients.pyx | 4 +- .../pylibcugraph/count_multi_edges.pyx | 5 +- python/pylibcugraph/pylibcugraph/degrees.pyx | 5 +- python/pylibcugraph/pylibcugraph/ecg.pyx | 4 +- .../edge_betweenness_centrality.pyx | 4 +- python/pylibcugraph/pylibcugraph/egonet.pyx | 5 +- .../pylibcugraph/eigenvector_centrality.pyx | 5 +- .../pylibcugraph/generate_rmat_edgelist.pyx | 4 +- .../pylibcugraph/generate_rmat_edgelists.pyx | 4 +- python/pylibcugraph/pylibcugraph/hits.pyx | 5 +- .../pylibcugraph/induced_subgraph.pyx | 4 +- .../pylibcugraph/jaccard_coefficients.pyx | 4 +- python/pylibcugraph/pylibcugraph/k_core.pyx | 4 +- .../pylibcugraph/k_truss_subgraph.pyx | 4 +- .../pylibcugraph/katz_centrality.pyx | 4 +- python/pylibcugraph/pylibcugraph/leiden.pyx | 6 +- python/pylibcugraph/pylibcugraph/louvain.pyx | 6 +- .../pylibcugraph/negative_sampling.pyx | 4 +- python/pylibcugraph/pylibcugraph/node2vec.pyx | 4 +- .../pylibcugraph/overlap_coefficients.pyx | 4 +- python/pylibcugraph/pylibcugraph/pagerank.pyx | 6 +- .../pylibcugraph/personalized_pagerank.pyx | 6 +- .../pylibcugraph/sorensen_coefficients.pyx | 4 +- .../spectral_modularity_maximization.pyx | 4 +- python/pylibcugraph/pylibcugraph/sssp.pyx | 7 +- .../pylibcugraph/triangle_count.pyx | 4 +- .../pylibcugraph/two_hop_neighbors.pyx | 4 +- .../pylibcugraph/uniform_neighbor_sample.pyx | 4 +- python/pylibcugraph/pylibcugraph/utils.pxd | 9 ++- python/pylibcugraph/pylibcugraph/utils.pyx | 30 ++++---- .../weakly_connected_components.pyx | 4 +- 87 files changed, 562 insertions(+), 407 deletions(-) create mode 100644 cpp/include/cugraph_c/types.h create mode 100644 python/pylibcugraph/pylibcugraph/_cugraph_c/types.pxd diff --git a/cpp/include/cugraph_c/resource_handle.h b/cpp/include/cugraph_c/resource_handle.h index 0e45102aae2..402da451a6f 100644 --- a/cpp/include/cugraph_c/resource_handle.h +++ b/cpp/include/cugraph_c/resource_handle.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION. + * Copyright (c) 2022-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #pragma once #include +#include #include #include @@ -25,20 +26,6 @@ extern "C" { #endif -typedef enum bool_ { FALSE = 0, TRUE = 1 } bool_t; - -typedef int8_t byte_t; - -/** - * @deprecated - use cugraph_data_type_id_t; - */ -typedef enum data_type_id_ { INT32 = 0, INT64, FLOAT32, FLOAT64, SIZE_T, NTYPES } data_type_id_t; - -/** - * @brief - Enumeration of data types - */ -typedef data_type_id_t cugraph_data_type_id_t; - typedef struct cugraph_resource_handle_ { int32_t align_; } cugraph_resource_handle_t; diff --git a/cpp/include/cugraph_c/types.h b/cpp/include/cugraph_c/types.h new file mode 100644 index 00000000000..dddb802b931 --- /dev/null +++ b/cpp/include/cugraph_c/types.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022-2024, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum bool_ { FALSE = 0, TRUE = 1 } bool_t; + +typedef int8_t byte_t; + +typedef enum data_type_id_ { + INT8 = 0, + INT16, + INT32, + INT64, + UINT8, + UINT16, + UINT32, + UINT64, + FLOAT32, + FLOAT64, + SIZE_T, + BOOL, + NTYPES +} cugraph_data_type_id_t; + +#ifdef __cplusplus +} +#endif diff --git a/cpp/src/c_api/array.cpp b/cpp/src/c_api/array.cpp index c9c8eaa78ac..5d760f1c1ec 100644 --- a/cpp/src/c_api/array.cpp +++ b/cpp/src/c_api/array.cpp @@ -22,7 +22,8 @@ namespace cugraph { namespace c_api { -size_t data_type_sz[] = {4, 8, 4, 8, 8}; +// FIXME: This is paired with type definition... better solution coming in 24.12 release. +size_t data_type_sz[] = {1, 2, 4, 8, 1, 2, 4, 8, 4, 8, 8, 1}; } // namespace c_api } // namespace cugraph diff --git a/cpp/tests/c_api/biased_neighbor_sample_test.c b/cpp/tests/c_api/biased_neighbor_sample_test.c index 0ccb236f7fc..6f0af3a8e0d 100644 --- a/cpp/tests/c_api/biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/biased_neighbor_sample_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int vertex_id_compare_function(const void* a, const void* b) { @@ -468,11 +468,11 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 8; size_t num_vertices = 6; @@ -686,11 +686,11 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han int test_biased_neighbor_sample_clean(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -740,11 +740,11 @@ int test_biased_neighbor_sample_clean(const cugraph_resource_handle_t* handle) int test_biased_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -794,11 +794,11 @@ int test_biased_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* int test_biased_neighbor_sample_unique_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -848,11 +848,11 @@ int test_biased_neighbor_sample_unique_sources(const cugraph_resource_handle_t* int test_biased_neighbor_sample_carry_over_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -902,11 +902,11 @@ int test_biased_neighbor_sample_carry_over_sources(const cugraph_resource_handle int test_biased_neighbor_sample_renumber_results(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/cpp/tests/c_api/c_test_utils.h b/cpp/tests/c_api/c_test_utils.h index fbbf6333ee3..cddd08e0dfb 100644 --- a/cpp/tests/c_api/c_test_utils.h +++ b/cpp/tests/c_api/c_test_utils.h @@ -83,15 +83,15 @@ int create_test_graph_double(const cugraph_resource_handle_t* p_handle, cugraph_error_t** ret_error); int create_sg_test_graph(const cugraph_resource_handle_t* handle, - data_type_id_t vertex_tid, - data_type_id_t edge_tid, + cugraph_data_type_id_t vertex_tid, + cugraph_data_type_id_t edge_tid, void* h_src, void* h_dst, - data_type_id_t weight_tid, + cugraph_data_type_id_t weight_tid, void* h_wgt, - data_type_id_t edge_type_tid, + cugraph_data_type_id_t edge_type_tid, void* h_edge_type, - data_type_id_t edge_id_tid, + cugraph_data_type_id_t edge_id_tid, void* h_edge_id, size_t num_edges, bool_t store_transposed, diff --git a/cpp/tests/c_api/count_multi_edges_test.c b/cpp/tests/c_api/count_multi_edges_test.c index 222cf12ea36..9e54783b1b1 100644 --- a/cpp/tests/c_api/count_multi_edges_test.c +++ b/cpp/tests/c_api/count_multi_edges_test.c @@ -25,11 +25,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; /* * Create graph and count multi-edges diff --git a/cpp/tests/c_api/create_graph_test.c b/cpp/tests/c_api/create_graph_test.c index a07f31fce57..a4f31391488 100644 --- a/cpp/tests/c_api/create_graph_test.c +++ b/cpp/tests/c_api/create_graph_test.c @@ -48,9 +48,9 @@ int test_create_sg_graph_simple() properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -161,9 +161,9 @@ int test_create_sg_graph_csr() properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -355,9 +355,9 @@ int test_create_sg_graph_symmetric_error() properties.is_symmetric = TRUE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -462,9 +462,9 @@ int test_create_sg_graph_with_isolated_vertices() properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -626,9 +626,9 @@ int test_create_sg_graph_csr_with_isolated() properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -778,9 +778,9 @@ int test_create_sg_graph_with_isolated_vertices_multi_input() properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/ecg_test.c b/cpp/tests/c_api/ecg_test.c index 4f4c29b97b9..cdf1975ef8c 100644 --- a/cpp/tests/c_api/ecg_test.c +++ b/cpp/tests/c_api/ecg_test.c @@ -46,11 +46,11 @@ int generic_ecg_test(vertex_t* h_src, cugraph_graph_t* graph = NULL; cugraph_hierarchical_clustering_result_t* result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/egonet_test.c b/cpp/tests/c_api/egonet_test.c index 1bde50afbad..6d34e27b629 100644 --- a/cpp/tests/c_api/egonet_test.c +++ b/cpp/tests/c_api/egonet_test.c @@ -43,11 +43,11 @@ int generic_egonet_test(vertex_t* h_src, cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; cugraph_resource_handle_t* resource_handle = NULL; cugraph_graph_t* graph = NULL; diff --git a/cpp/tests/c_api/induced_subgraph_test.c b/cpp/tests/c_api/induced_subgraph_test.c index 929d911bf1c..0bd006ef591 100644 --- a/cpp/tests/c_api/induced_subgraph_test.c +++ b/cpp/tests/c_api/induced_subgraph_test.c @@ -57,8 +57,8 @@ int generic_induced_subgraph_test(vertex_t* h_src, cugraph_induced_subgraph_result_t* result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t size_t_tid = SIZE_T; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t size_t_tid = SIZE_T; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/k_core_test.c b/cpp/tests/c_api/k_core_test.c index c60001fc8e7..fdc948e07c2 100644 --- a/cpp/tests/c_api/k_core_test.c +++ b/cpp/tests/c_api/k_core_test.c @@ -15,6 +15,7 @@ */ #include "c_test_utils.h" /* RUN_TEST */ +#include "cugraph_c/types.h" #include #include @@ -43,11 +44,11 @@ int generic_k_core_test(vertex_t* h_src, cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; cugraph_resource_handle_t* resource_handle = NULL; cugraph_graph_t* graph = NULL; diff --git a/cpp/tests/c_api/k_truss_test.c b/cpp/tests/c_api/k_truss_test.c index 1ebacfead9f..621263e5a07 100644 --- a/cpp/tests/c_api/k_truss_test.c +++ b/cpp/tests/c_api/k_truss_test.c @@ -44,11 +44,11 @@ int generic_k_truss_test(vertex_t* h_src, cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; cugraph_resource_handle_t* resource_handle = NULL; cugraph_graph_t* graph = NULL; diff --git a/cpp/tests/c_api/legacy_spectral_test.c b/cpp/tests/c_api/legacy_spectral_test.c index ad695dd0883..5a9f3d3ad29 100644 --- a/cpp/tests/c_api/legacy_spectral_test.c +++ b/cpp/tests/c_api/legacy_spectral_test.c @@ -51,11 +51,11 @@ int generic_spectral_test(vertex_t* h_src, cugraph_graph_t* graph = NULL; cugraph_clustering_result_t* result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, handle != NULL, "resource handle creation failed."); @@ -170,11 +170,11 @@ int generic_balanced_cut_test(vertex_t* h_src, cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; cugraph_resource_handle_t* handle = NULL; cugraph_graph_t* graph = NULL; diff --git a/cpp/tests/c_api/leiden_test.c b/cpp/tests/c_api/leiden_test.c index 57e6e921cce..90441de2d8f 100644 --- a/cpp/tests/c_api/leiden_test.c +++ b/cpp/tests/c_api/leiden_test.c @@ -15,6 +15,7 @@ */ #include "c_test_utils.h" /* RUN_TEST */ +#include "cugraph_c/types.h" #include #include @@ -47,11 +48,11 @@ int generic_leiden_test(vertex_t* h_src, cugraph_graph_t* p_graph = NULL; cugraph_hierarchical_clustering_result_t* p_result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; p_handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, p_handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/louvain_test.c b/cpp/tests/c_api/louvain_test.c index c083dbaa676..7d57930bd18 100644 --- a/cpp/tests/c_api/louvain_test.c +++ b/cpp/tests/c_api/louvain_test.c @@ -46,11 +46,11 @@ int generic_louvain_test(vertex_t* h_src, cugraph_graph_t* p_graph = NULL; cugraph_hierarchical_clustering_result_t* p_result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; p_handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, p_handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c index ead86f22ad3..f7103d1e39d 100644 --- a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, vertex_t* h_src, @@ -1227,11 +1227,11 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han int test_biased_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -1277,11 +1277,11 @@ int test_biased_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* int test_biased_neighbor_sample_unique_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -1327,11 +1327,11 @@ int test_biased_neighbor_sample_unique_sources(const cugraph_resource_handle_t* int test_biased_neighbor_sample_carry_over_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/cpp/tests/c_api/mg_count_multi_edges_test.c b/cpp/tests/c_api/mg_count_multi_edges_test.c index 69eaaff40dc..02a5fd75dd1 100644 --- a/cpp/tests/c_api/mg_count_multi_edges_test.c +++ b/cpp/tests/c_api/mg_count_multi_edges_test.c @@ -25,11 +25,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; /* * Create graph and count multi-edges diff --git a/cpp/tests/c_api/mg_create_graph_test.c b/cpp/tests/c_api/mg_create_graph_test.c index 12579f26d06..82fee9dd440 100644 --- a/cpp/tests/c_api/mg_create_graph_test.c +++ b/cpp/tests/c_api/mg_create_graph_test.c @@ -49,9 +49,9 @@ int test_create_mg_graph_simple(const cugraph_resource_handle_t* handle) properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -159,9 +159,9 @@ int test_create_mg_graph_multiple_edge_lists(const cugraph_resource_handle_t* ha properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; const size_t num_local_arrays = 2; @@ -355,9 +355,9 @@ int test_create_mg_graph_multiple_edge_lists_multi_edge(const cugraph_resource_h properties.is_symmetric = FALSE; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; const size_t num_local_arrays = 2; diff --git a/cpp/tests/c_api/mg_generate_rmat_test.c b/cpp/tests/c_api/mg_generate_rmat_test.c index 47b7eb2fae6..339ab251283 100644 --- a/cpp/tests/c_api/mg_generate_rmat_test.c +++ b/cpp/tests/c_api/mg_generate_rmat_test.c @@ -109,9 +109,9 @@ int test_rmat_generation(const cugraph_resource_handle_t* handle) TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed."); TEST_ALWAYS_ASSERT(ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; ret_code = cugraph_generate_rmat_edgelist( handle, rng_state, 5, 30, 0.57, 0.19, 0.19, FALSE, &coo, &ret_error); @@ -342,9 +342,9 @@ int test_rmat_list_generation(const cugraph_resource_handle_t* handle) TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "rng_state create failed."); TEST_ALWAYS_ASSERT(ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; ret_code = cugraph_generate_rmat_edgelists( handle, rng_state, num_lists, 4, 6, 4, UNIFORM, POWER_LAW, FALSE, &coo_list, &ret_error); diff --git a/cpp/tests/c_api/mg_induced_subgraph_test.c b/cpp/tests/c_api/mg_induced_subgraph_test.c index 39eefb9258c..1866810d270 100644 --- a/cpp/tests/c_api/mg_induced_subgraph_test.c +++ b/cpp/tests/c_api/mg_induced_subgraph_test.c @@ -57,9 +57,9 @@ int generic_induced_subgraph_test(const cugraph_resource_handle_t* handle, cugraph_induced_subgraph_result_t* result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t size_t_tid = SIZE_T; - size_t num_subgraph_vertices = h_subgraph_offsets[num_subgraph_offsets - 1]; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t size_t_tid = SIZE_T; + size_t num_subgraph_vertices = h_subgraph_offsets[num_subgraph_offsets - 1]; ret_code = create_mg_test_graph( handle, h_src, h_dst, h_wgt, num_edges, store_transposed, FALSE, &graph, &ret_error); diff --git a/cpp/tests/c_api/mg_k_truss_test.c b/cpp/tests/c_api/mg_k_truss_test.c index ed385c6ca76..4709926232b 100644 --- a/cpp/tests/c_api/mg_k_truss_test.c +++ b/cpp/tests/c_api/mg_k_truss_test.c @@ -50,8 +50,8 @@ int generic_k_truss_test(const cugraph_resource_handle_t* handle, cugraph_induced_subgraph_result_t* result = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t size_t_tid = SIZE_T; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t size_t_tid = SIZE_T; ret_code = create_mg_test_graph( handle, h_src, h_dst, h_wgt, num_edges, store_transposed, TRUE, &graph, &ret_error); diff --git a/cpp/tests/c_api/mg_lookup_src_dst_test.c b/cpp/tests/c_api/mg_lookup_src_dst_test.c index 8c85d245acc..0840325d8f2 100644 --- a/cpp/tests/c_api/mg_lookup_src_dst_test.c +++ b/cpp/tests/c_api/mg_lookup_src_dst_test.c @@ -27,11 +27,11 @@ typedef int32_t edge_type_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int generic_lookup_src_dst_test(const cugraph_resource_handle_t* handle, vertex_t* h_srcs, diff --git a/cpp/tests/c_api/mg_negative_sampling_test.c b/cpp/tests/c_api/mg_negative_sampling_test.c index 274bad35dfb..c016ebfde0f 100644 --- a/cpp/tests/c_api/mg_negative_sampling_test.c +++ b/cpp/tests/c_api/mg_negative_sampling_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, vertex_t* h_src, @@ -210,9 +210,9 @@ int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, int test_negative_sampling_uniform(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -243,9 +243,9 @@ int test_negative_sampling_uniform(const cugraph_resource_handle_t* handle) int test_negative_sampling_biased(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/cpp/tests/c_api/mg_pagerank_test.c b/cpp/tests/c_api/mg_pagerank_test.c index 4616db3f704..274b03d690e 100644 --- a/cpp/tests/c_api/mg_pagerank_test.c +++ b/cpp/tests/c_api/mg_pagerank_test.c @@ -202,8 +202,8 @@ int generic_personalized_pagerank_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_view_t* personalization_vertices_view = NULL; cugraph_type_erased_device_array_view_t* personalization_values_view = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; ret_code = create_mg_test_graph( handle, h_src, h_dst, h_wgt, num_edges, store_transposed, FALSE, &p_graph, &ret_error); @@ -311,8 +311,8 @@ int generic_personalized_pagerank_nonconverging_test(const cugraph_resource_hand cugraph_type_erased_device_array_view_t* personalization_vertices_view = NULL; cugraph_type_erased_device_array_view_t* personalization_values_view = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; ret_code = create_mg_test_graph( handle, h_src, h_dst, h_wgt, num_edges, store_transposed, FALSE, &p_graph, &ret_error); diff --git a/cpp/tests/c_api/mg_similarity_test.c b/cpp/tests/c_api/mg_similarity_test.c index 637f66e40ed..fee4e264856 100644 --- a/cpp/tests/c_api/mg_similarity_test.c +++ b/cpp/tests/c_api/mg_similarity_test.c @@ -54,8 +54,8 @@ int generic_similarity_test(const cugraph_resource_handle_t* handle, bool_t use_weight, similarity_t test_type) { - int test_ret_value = 0; - data_type_id_t vertex_tid = INT32; + int test_ret_value = 0; + cugraph_data_type_id_t vertex_tid = INT32; cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; diff --git a/cpp/tests/c_api/mg_test_utils.cpp b/cpp/tests/c_api/mg_test_utils.cpp index 98b64014726..f96be61468f 100644 --- a/cpp/tests/c_api/mg_test_utils.cpp +++ b/cpp/tests/c_api/mg_test_utils.cpp @@ -143,9 +143,9 @@ extern "C" int create_mg_test_graph(const cugraph_resource_handle_t* handle, properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -241,9 +241,9 @@ extern "C" int create_mg_test_graph_double(const cugraph_resource_handle_t* hand properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT64; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT64; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -334,9 +334,9 @@ extern "C" int create_mg_test_graph_with_edge_ids(const cugraph_resource_handle_ properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -428,11 +428,11 @@ extern "C" int create_mg_test_graph_with_properties(const cugraph_resource_handl properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t index_tid = INT32; - data_type_id_t type_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t index_tid = INT32; + cugraph_data_type_id_t type_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src = NULL; cugraph_type_erased_device_array_t* dst = NULL; @@ -541,15 +541,15 @@ extern "C" int create_mg_test_graph_with_properties(const cugraph_resource_handl } int create_mg_test_graph_new(const cugraph_resource_handle_t* handle, - data_type_id_t vertex_tid, - data_type_id_t edge_tid, + cugraph_data_type_id_t vertex_tid, + cugraph_data_type_id_t edge_tid, void* h_src, void* h_dst, - data_type_id_t weight_tid, + cugraph_data_type_id_t weight_tid, void* h_wgt, - data_type_id_t edge_type_tid, + cugraph_data_type_id_t edge_type_tid, void* h_edge_type, - data_type_id_t edge_id_tid, + cugraph_data_type_id_t edge_id_tid, void* h_edge_id, size_t num_edges, bool_t store_transposed, diff --git a/cpp/tests/c_api/mg_test_utils.h b/cpp/tests/c_api/mg_test_utils.h index 7461d402b5b..b040d8dc529 100644 --- a/cpp/tests/c_api/mg_test_utils.h +++ b/cpp/tests/c_api/mg_test_utils.h @@ -107,15 +107,15 @@ int create_mg_test_graph_with_properties(const cugraph_resource_handle_t* p_hand cugraph_error_t** ret_error); int create_mg_test_graph_new(const cugraph_resource_handle_t* handle, - data_type_id_t vertex_tid, - data_type_id_t edge_tid, + cugraph_data_type_id_t vertex_tid, + cugraph_data_type_id_t edge_tid, void* h_src, void* h_dst, - data_type_id_t weight_tid, + cugraph_data_type_id_t weight_tid, void* h_wgt, - data_type_id_t edge_type_tid, + cugraph_data_type_id_t edge_type_tid, void* h_edge_type, - data_type_id_t edge_id_tid, + cugraph_data_type_id_t edge_id_tid, void* h_edge_id, size_t num_edges, bool_t store_transposed, diff --git a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c index b046b453c1c..f9388a2e565 100644 --- a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle, vertex_t* h_src, @@ -1223,11 +1223,11 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha int test_uniform_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -1273,11 +1273,11 @@ int test_uniform_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* int test_uniform_neighbor_sample_unique_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -1323,11 +1323,11 @@ int test_uniform_neighbor_sample_unique_sources(const cugraph_resource_handle_t* int test_uniform_neighbor_sample_carry_over_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/cpp/tests/c_api/negative_sampling_test.c b/cpp/tests/c_api/negative_sampling_test.c index 52360d622dd..8d59435c885 100644 --- a/cpp/tests/c_api/negative_sampling_test.c +++ b/cpp/tests/c_api/negative_sampling_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, vertex_t* h_src, @@ -201,9 +201,9 @@ int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, int test_negative_sampling_uniform(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -234,9 +234,9 @@ int test_negative_sampling_uniform(const cugraph_resource_handle_t* handle) int test_negative_sampling_biased(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/cpp/tests/c_api/pagerank_test.c b/cpp/tests/c_api/pagerank_test.c index b0caef58eee..8b23d60bb1f 100644 --- a/cpp/tests/c_api/pagerank_test.c +++ b/cpp/tests/c_api/pagerank_test.c @@ -202,8 +202,8 @@ int generic_personalized_pagerank_test(vertex_t* h_src, cugraph_type_erased_device_array_view_t* personalization_vertices_view = NULL; cugraph_type_erased_device_array_view_t* personalization_values_view = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; p_handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, p_handle != NULL, "resource handle creation failed."); @@ -311,8 +311,8 @@ int generic_personalized_pagerank_nonconverging_test(vertex_t* h_src, cugraph_type_erased_device_array_view_t* personalization_vertices_view = NULL; cugraph_type_erased_device_array_view_t* personalization_values_view = NULL; - data_type_id_t vertex_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; p_handle = cugraph_create_resource_handle(NULL); TEST_ASSERT(test_ret_value, p_handle != NULL, "resource handle creation failed."); diff --git a/cpp/tests/c_api/similarity_test.c b/cpp/tests/c_api/similarity_test.c index ac4dff850fa..2ae413521e1 100644 --- a/cpp/tests/c_api/similarity_test.c +++ b/cpp/tests/c_api/similarity_test.c @@ -41,8 +41,8 @@ int generic_similarity_test(vertex_t* h_src, bool_t use_weight, similarity_t test_type) { - int test_ret_value = 0; - data_type_id_t vertex_tid = INT32; + int test_ret_value = 0; + cugraph_data_type_id_t vertex_tid = INT32; cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; @@ -149,8 +149,8 @@ int generic_all_pairs_similarity_test(vertex_t* h_src, size_t topk, similarity_t test_type) { - int test_ret_value = 0; - data_type_id_t vertex_tid = INT32; + int test_ret_value = 0; + cugraph_data_type_id_t vertex_tid = INT32; cugraph_error_code_t ret_code = CUGRAPH_SUCCESS; cugraph_error_t* ret_error; diff --git a/cpp/tests/c_api/test_utils.cpp b/cpp/tests/c_api/test_utils.cpp index 2df62345784..c657d75b4c4 100644 --- a/cpp/tests/c_api/test_utils.cpp +++ b/cpp/tests/c_api/test_utils.cpp @@ -58,9 +58,9 @@ extern "C" int create_test_graph(const cugraph_resource_handle_t* p_handle, properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -144,9 +144,9 @@ extern "C" int create_test_graph_double(const cugraph_resource_handle_t* p_handl properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT64; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT64; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -271,15 +271,15 @@ extern "C" int run_sg_test_new(int (*test)(const cugraph_resource_handle_t*), } int create_sg_test_graph(const cugraph_resource_handle_t* handle, - data_type_id_t vertex_tid, - data_type_id_t edge_tid, + cugraph_data_type_id_t vertex_tid, + cugraph_data_type_id_t edge_tid, void* h_src, void* h_dst, - data_type_id_t weight_tid, + cugraph_data_type_id_t weight_tid, void* h_wgt, - data_type_id_t edge_type_tid, + cugraph_data_type_id_t edge_type_tid, void* h_edge_type, - data_type_id_t edge_id_tid, + cugraph_data_type_id_t edge_id_tid, void* h_edge_id, size_t num_edges, bool_t store_transposed, diff --git a/cpp/tests/c_api/uniform_neighbor_sample_test.c b/cpp/tests/c_api/uniform_neighbor_sample_test.c index 404e38627ae..931d1fbfe07 100644 --- a/cpp/tests/c_api/uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/uniform_neighbor_sample_test.c @@ -27,11 +27,11 @@ typedef int32_t vertex_t; typedef int32_t edge_t; typedef float weight_t; -data_type_id_t vertex_tid = INT32; -data_type_id_t edge_tid = INT32; -data_type_id_t weight_tid = FLOAT32; -data_type_id_t edge_id_tid = INT32; -data_type_id_t edge_type_tid = INT32; +cugraph_data_type_id_t vertex_tid = INT32; +cugraph_data_type_id_t edge_tid = INT32; +cugraph_data_type_id_t weight_tid = FLOAT32; +cugraph_data_type_id_t edge_id_tid = INT32; +cugraph_data_type_id_t edge_type_tid = INT32; int vertex_id_compare_function(const void* a, const void* b) { @@ -483,9 +483,9 @@ int create_test_graph_with_edge_ids(const cugraph_resource_handle_t* p_handle, properties.is_symmetric = is_symmetric; properties.is_multigraph = FALSE; - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; cugraph_type_erased_device_array_t* src; cugraph_type_erased_device_array_t* dst; @@ -559,11 +559,11 @@ int create_test_graph_with_edge_ids(const cugraph_resource_handle_t* p_handle, int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 8; size_t num_vertices = 6; @@ -776,11 +776,11 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha int test_uniform_neighbor_sample_clean(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -830,11 +830,11 @@ int test_uniform_neighbor_sample_clean(const cugraph_resource_handle_t* handle) int test_uniform_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -884,11 +884,11 @@ int test_uniform_neighbor_sample_dedupe_sources(const cugraph_resource_handle_t* int test_uniform_neighbor_sample_unique_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -938,11 +938,11 @@ int test_uniform_neighbor_sample_unique_sources(const cugraph_resource_handle_t* int test_uniform_neighbor_sample_carry_over_sources(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; @@ -992,11 +992,11 @@ int test_uniform_neighbor_sample_carry_over_sources(const cugraph_resource_handl int test_uniform_neighbor_sample_renumber_results(const cugraph_resource_handle_t* handle) { - data_type_id_t vertex_tid = INT32; - data_type_id_t edge_tid = INT32; - data_type_id_t weight_tid = FLOAT32; - data_type_id_t edge_id_tid = INT32; - data_type_id_t edge_type_tid = INT32; + cugraph_data_type_id_t vertex_tid = INT32; + cugraph_data_type_id_t edge_tid = INT32; + cugraph_data_type_id_t weight_tid = FLOAT32; + cugraph_data_type_id_t edge_id_tid = INT32; + cugraph_data_type_id_t edge_type_tid = INT32; size_t num_edges = 9; size_t num_vertices = 6; diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd index aa19ce60908..6d5d5a23cca 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/array.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/array.pxd index 73055c7391e..2bb08508df9 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/array.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/array.pxd @@ -1,4 +1,4 @@ -# Copyright (c) 2022, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -18,10 +18,12 @@ from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, cugraph_error_t, ) +from pylibcugraph._cugraph_c.types cimport ( + cugraph_data_type_id_t, + byte_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - data_type_id_t, - byte_t, ) @@ -42,7 +44,7 @@ cdef extern from "cugraph_c/array.h": cdef cugraph_error_code_t \ cugraph_type_erased_device_array_create( const cugraph_resource_handle_t* handle, - data_type_id_t dtype, + cugraph_data_type_id_t dtype, size_t n_elems, cugraph_type_erased_device_array_t** array, cugraph_error_t** error @@ -67,7 +69,7 @@ cdef extern from "cugraph_c/array.h": cugraph_type_erased_device_array_view_create( void* pointer, size_t n_elems, - data_type_id_t dtype + cugraph_data_type_id_t dtype ) cdef void \ @@ -80,7 +82,7 @@ cdef extern from "cugraph_c/array.h": const cugraph_type_erased_device_array_view_t* p ) - cdef data_type_id_t \ + cdef cugraph_data_type_id_t \ cugraph_type_erased_device_array_view_type( const cugraph_type_erased_device_array_view_t* p ) @@ -93,7 +95,7 @@ cdef extern from "cugraph_c/array.h": cdef cugraph_error_code_t \ cugraph_type_erased_host_array_create( const cugraph_resource_handle_t* handle, - data_type_id_t dtype, + cugraph_data_type_id_t dtype, size_t n_elems, cugraph_type_erased_host_array_t** array, cugraph_error_t** error @@ -118,7 +120,7 @@ cdef extern from "cugraph_c/array.h": cugraph_type_erased_host_array_view_create( void* pointer, size_t n_elems, - data_type_id_t dtype + cugraph_data_type_id_t dtype ) cdef void \ @@ -131,7 +133,7 @@ cdef extern from "cugraph_c/array.h": const cugraph_type_erased_host_array_t* p ) - cdef data_type_id_t \ + cdef cugraph_data_type_id_t \ cugraph_type_erased_host_array_type( const cugraph_type_erased_host_array_t* p ) diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd index 6e9a5432974..fb2c302e66a 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/centrality_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd index b8cd6148456..b914233cb2c 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/community_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd index ed25faa33f4..d8e28c7be3e 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/core_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd index 5bbe5bc4a87..48412099caa 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd index 315c9bd7503..b8f16cb94c8 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_functions.pxd @@ -19,9 +19,11 @@ from pylibcugraph._cugraph_c.error cimport ( cugraph_error_t, ) +from pylibcugraph._cugraph_c.types cimport ( + bool_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - bool_t, ) from pylibcugraph._cugraph_c.similarity_algorithms cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_generators.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_generators.pxd index cda47e55f77..d345eac707e 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_generators.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph_generators.pxd @@ -14,11 +14,13 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( - cugraph_resource_handle_t, +from pylibcugraph._cugraph_c.types cimport ( cugraph_data_type_id_t, bool_t, ) +from pylibcugraph._cugraph_c.resource_handle cimport ( + cugraph_resource_handle_t, +) from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, cugraph_error_t, diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd index 53c4c382d58..5d2ce168e01 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/labeling_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/lookup_src_dst.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/lookup_src_dst.pxd index e8a2bbf47ae..0c2f31f9a50 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/lookup_src_dst.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/lookup_src_dst.pxd @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd index f3f43d55dff..f8cf45d7af0 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/resource_handle.pxd @@ -14,26 +14,8 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from libc.stdint cimport int8_t - - cdef extern from "cugraph_c/resource_handle.h": - ctypedef enum bool_t: - FALSE - TRUE - - ctypedef enum data_type_id_t: - INT32 - INT64 - FLOAT32 - FLOAT64 - SIZE_T - - ctypedef data_type_id_t cugraph_data_type_id_t - - ctypedef int8_t byte_t - ctypedef struct cugraph_resource_handle_t: pass diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/sampling_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/sampling_algorithms.pxd index c982b12665a..3f7b8b9ae29 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/sampling_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/sampling_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd index 71d094a6058..228050abce0 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/similarity_algorithms.pxd @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/types.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/types.pxd new file mode 100644 index 00000000000..384b588c79f --- /dev/null +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/types.pxd @@ -0,0 +1,40 @@ +# Copyright (c) 2022-2024, NVIDIA CORPORATION. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Have cython use python 3 syntax +# cython: language_level = 3 + +from libc.stdint cimport int8_t + + +cdef extern from "cugraph_c/types.h": + + ctypedef enum bool_t: + FALSE + TRUE + + ctypedef enum cugraph_data_type_id_t: + INT8 + INT16 + INT32 + INT64 + UINT8 + UINT16 + UINT32 + UINT64 + FLOAT32 + FLOAT64 + SIZE_T + BOOL + + ctypedef int8_t byte_t diff --git a/python/pylibcugraph/pylibcugraph/all_pairs_cosine_coefficients.pyx b/python/pylibcugraph/pylibcugraph/all_pairs_cosine_coefficients.pyx index b600dd48567..6aa18ac9660 100644 --- a/python/pylibcugraph/pylibcugraph/all_pairs_cosine_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/all_pairs_cosine_coefficients.pyx @@ -17,8 +17,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/all_pairs_jaccard_coefficients.pyx b/python/pylibcugraph/pylibcugraph/all_pairs_jaccard_coefficients.pyx index b65905b6850..23694f89503 100644 --- a/python/pylibcugraph/pylibcugraph/all_pairs_jaccard_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/all_pairs_jaccard_coefficients.pyx @@ -17,8 +17,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/all_pairs_overlap_coefficients.pyx b/python/pylibcugraph/pylibcugraph/all_pairs_overlap_coefficients.pyx index 74f3bc06a94..f4fb721720d 100644 --- a/python/pylibcugraph/pylibcugraph/all_pairs_overlap_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/all_pairs_overlap_coefficients.pyx @@ -17,8 +17,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/all_pairs_sorensen_coefficients.pyx b/python/pylibcugraph/pylibcugraph/all_pairs_sorensen_coefficients.pyx index 5e3fc24a4b4..4702a5ccba9 100644 --- a/python/pylibcugraph/pylibcugraph/all_pairs_sorensen_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/all_pairs_sorensen_coefficients.pyx @@ -17,8 +17,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx b/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx index e0ec2f77233..ab1dc215a1e 100644 --- a/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx +++ b/python/pylibcugraph/pylibcugraph/balanced_cut_clustering.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx b/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx index 85df88b9001..c7bfcc9c4a0 100644 --- a/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/betweenness_centrality.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/bfs.pyx b/python/pylibcugraph/pylibcugraph/bfs.pyx index e65e94a8020..b92afcfd7db 100644 --- a/python/pylibcugraph/pylibcugraph/bfs.pyx +++ b/python/pylibcugraph/pylibcugraph/bfs.pyx @@ -31,8 +31,10 @@ from pylibcugraph._cugraph_c.array cimport ( cugraph_type_erased_device_array_view_t, cugraph_type_erased_device_array_view_create, ) -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/biased_neighbor_sample.pyx b/python/pylibcugraph/pylibcugraph/biased_neighbor_sample.pyx index 2dd138d5d06..244222e3dab 100644 --- a/python/pylibcugraph/pylibcugraph/biased_neighbor_sample.pyx +++ b/python/pylibcugraph/pylibcugraph/biased_neighbor_sample.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/core_number.pyx b/python/pylibcugraph/pylibcugraph/core_number.pyx index 50ce5bfe965..e754ef2c65e 100644 --- a/python/pylibcugraph/pylibcugraph/core_number.pyx +++ b/python/pylibcugraph/pylibcugraph/core_number.pyx @@ -16,9 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/cosine_coefficients.pyx b/python/pylibcugraph/pylibcugraph/cosine_coefficients.pyx index df194fe364e..926fa0f0c60 100644 --- a/python/pylibcugraph/pylibcugraph/cosine_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/cosine_coefficients.pyx @@ -18,8 +18,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf from cython.operator cimport dereference -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/count_multi_edges.pyx b/python/pylibcugraph/pylibcugraph/count_multi_edges.pyx index d3780e53283..e4eab82d363 100644 --- a/python/pylibcugraph/pylibcugraph/count_multi_edges.pyx +++ b/python/pylibcugraph/pylibcugraph/count_multi_edges.pyx @@ -14,9 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/degrees.pyx b/python/pylibcugraph/pylibcugraph/degrees.pyx index 7818da441bd..c6469b99068 100644 --- a/python/pylibcugraph/pylibcugraph/degrees.pyx +++ b/python/pylibcugraph/pylibcugraph/degrees.pyx @@ -16,9 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/ecg.pyx b/python/pylibcugraph/pylibcugraph/ecg.pyx index 4b8d8901d34..0e293cb82f0 100644 --- a/python/pylibcugraph/pylibcugraph/ecg.pyx +++ b/python/pylibcugraph/pylibcugraph/ecg.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx b/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx index 75a950eaa34..1d5881b0e7e 100644 --- a/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/edge_betweenness_centrality.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/egonet.pyx b/python/pylibcugraph/pylibcugraph/egonet.pyx index 070ea1fdd85..ce5a751eb33 100644 --- a/python/pylibcugraph/pylibcugraph/egonet.pyx +++ b/python/pylibcugraph/pylibcugraph/egonet.pyx @@ -16,9 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx b/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx index baa69eb2e30..b59b08f061f 100644 --- a/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/eigenvector_centrality.pyx @@ -16,9 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx index 4ea96920e61..f79590e022e 100644 --- a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx +++ b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelist.pyx @@ -15,9 +15,11 @@ # cython: language_level = 3 +from pylibcugraph._cugraph_c.types cimport ( + bool_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - bool_t, ) from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, diff --git a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx index 7de48708f80..532f73713e3 100644 --- a/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx +++ b/python/pylibcugraph/pylibcugraph/generate_rmat_edgelists.pyx @@ -15,9 +15,11 @@ # cython: language_level = 3 +from pylibcugraph._cugraph_c.types cimport ( + bool_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - bool_t, ) from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, diff --git a/python/pylibcugraph/pylibcugraph/hits.pyx b/python/pylibcugraph/pylibcugraph/hits.pyx index 3204ac2ba57..9dbf96ec271 100644 --- a/python/pylibcugraph/pylibcugraph/hits.pyx +++ b/python/pylibcugraph/pylibcugraph/hits.pyx @@ -16,9 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx b/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx index 6fd6d7b9af3..ba09841460b 100644 --- a/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx +++ b/python/pylibcugraph/pylibcugraph/induced_subgraph.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx index 9611f2ad884..70b77ba6306 100644 --- a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx @@ -18,8 +18,10 @@ from libc.stdint cimport uintptr_t from libc.stdio cimport printf from cython.operator cimport dereference -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/k_core.pyx b/python/pylibcugraph/pylibcugraph/k_core.pyx index 6e37ee778e9..eb08457a24d 100644 --- a/python/pylibcugraph/pylibcugraph/k_core.pyx +++ b/python/pylibcugraph/pylibcugraph/k_core.pyx @@ -17,8 +17,10 @@ from libc.stdint cimport uintptr_t import warnings -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx b/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx index 9ea533c9f28..ef78e652d3e 100644 --- a/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx +++ b/python/pylibcugraph/pylibcugraph/k_truss_subgraph.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/katz_centrality.pyx b/python/pylibcugraph/pylibcugraph/katz_centrality.pyx index 1716a4fc9bf..ef4f54b9183 100644 --- a/python/pylibcugraph/pylibcugraph/katz_centrality.pyx +++ b/python/pylibcugraph/pylibcugraph/katz_centrality.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/leiden.pyx b/python/pylibcugraph/pylibcugraph/leiden.pyx index 04f8887551c..aaff3f44535 100644 --- a/python/pylibcugraph/pylibcugraph/leiden.pyx +++ b/python/pylibcugraph/pylibcugraph/leiden.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/louvain.pyx b/python/pylibcugraph/pylibcugraph/louvain.pyx index 58f4f10bc18..12f22870ed1 100644 --- a/python/pylibcugraph/pylibcugraph/louvain.pyx +++ b/python/pylibcugraph/pylibcugraph/louvain.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/negative_sampling.pyx b/python/pylibcugraph/pylibcugraph/negative_sampling.pyx index 610cfa90ccf..d8daee61814 100644 --- a/python/pylibcugraph/pylibcugraph/negative_sampling.pyx +++ b/python/pylibcugraph/pylibcugraph/negative_sampling.pyx @@ -16,9 +16,11 @@ from libc.stdint cimport uintptr_t +from pylibcugraph._cugraph_c.types cimport ( + bool_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - bool_t, ) from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, diff --git a/python/pylibcugraph/pylibcugraph/node2vec.pyx b/python/pylibcugraph/pylibcugraph/node2vec.pyx index b2f2948affe..0e0fd73e6c8 100644 --- a/python/pylibcugraph/pylibcugraph/node2vec.pyx +++ b/python/pylibcugraph/pylibcugraph/node2vec.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx index 36f414e71ad..a1b61a0a768 100644 --- a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/pagerank.pyx b/python/pylibcugraph/pylibcugraph/pagerank.pyx index 9fec1328bbf..bcb8474ddfa 100644 --- a/python/pylibcugraph/pylibcugraph/pagerank.pyx +++ b/python/pylibcugraph/pylibcugraph/pagerank.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/personalized_pagerank.pyx b/python/pylibcugraph/pylibcugraph/personalized_pagerank.pyx index 85addffa694..209d4054491 100644 --- a/python/pylibcugraph/pylibcugraph/personalized_pagerank.pyx +++ b/python/pylibcugraph/pylibcugraph/personalized_pagerank.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,8 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx index 39814b8ad88..0752a35ee7e 100644 --- a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx b/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx index a2c93e025a8..920784a7406 100644 --- a/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx +++ b/python/pylibcugraph/pylibcugraph/spectral_modularity_maximization.pyx @@ -15,8 +15,10 @@ # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/sssp.pyx b/python/pylibcugraph/pylibcugraph/sssp.pyx index 56765c4a1b8..7e40a801e94 100644 --- a/python/pylibcugraph/pylibcugraph/sssp.pyx +++ b/python/pylibcugraph/pylibcugraph/sssp.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,9 +14,10 @@ # Have cython use python 3 syntax # cython: language_level = 3 -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, - data_type_id_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/triangle_count.pyx b/python/pylibcugraph/pylibcugraph/triangle_count.pyx index 0cbe9be7f19..5debb92f665 100644 --- a/python/pylibcugraph/pylibcugraph/triangle_count.pyx +++ b/python/pylibcugraph/pylibcugraph/triangle_count.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx b/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx index 4b1a5b74a3f..d45e6394383 100644 --- a/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx +++ b/python/pylibcugraph/pylibcugraph/two_hop_neighbors.pyx @@ -15,9 +15,11 @@ # cython: language_level = 3 +from pylibcugraph._cugraph_c.types cimport ( + bool_t, +) from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, - bool_t, ) from pylibcugraph._cugraph_c.error cimport ( cugraph_error_code_t, diff --git a/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx b/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx index f3e2336d8f6..d9d19972684 100644 --- a/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx +++ b/python/pylibcugraph/pylibcugraph/uniform_neighbor_sample.pyx @@ -16,8 +16,10 @@ from libc.stdint cimport uintptr_t -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( diff --git a/python/pylibcugraph/pylibcugraph/utils.pxd b/python/pylibcugraph/pylibcugraph/utils.pxd index 21ab49a1f1e..1f9a7727b6f 100644 --- a/python/pylibcugraph/pylibcugraph/utils.pxd +++ b/python/pylibcugraph/pylibcugraph/utils.pxd @@ -14,8 +14,11 @@ # Have cython use python 3 syntax # cython: language_level = 3 +from pylibcugraph._cugraph_c.types cimport ( + cugraph_data_type_id_t, +) + from pylibcugraph._cugraph_c.resource_handle cimport ( - data_type_id_t, cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.array cimport ( @@ -35,13 +38,13 @@ cdef assert_CAI_type(obj, var_name, allow_None=*) cdef assert_AI_type(obj, var_name, allow_None=*) -cdef get_numpy_type_from_c_type(data_type_id_t c_type) +cdef get_numpy_type_from_c_type(cugraph_data_type_id_t c_type) cdef get_c_type_from_numpy_type(numpy_type) cdef get_c_weight_type_from_numpy_edge_ids_type(numpy_type) -cdef get_numpy_edge_ids_type_from_c_weight_type(data_type_id_t c_type) +cdef get_numpy_edge_ids_type_from_c_weight_type(cugraph_data_type_id_t c_type) cdef copy_to_cupy_array( cugraph_resource_handle_t* c_resource_handle_ptr, diff --git a/python/pylibcugraph/pylibcugraph/utils.pyx b/python/pylibcugraph/pylibcugraph/utils.pyx index 70bef89f4cf..6fc53e2f5dc 100644 --- a/python/pylibcugraph/pylibcugraph/utils.pyx +++ b/python/pylibcugraph/pylibcugraph/utils.pyx @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -107,16 +107,16 @@ cdef assert_AI_type(obj, var_name, allow_None=False): raise TypeError(msg) -cdef get_numpy_type_from_c_type(data_type_id_t c_type): - if c_type == data_type_id_t.INT32: +cdef get_numpy_type_from_c_type(cugraph_data_type_id_t c_type): + if c_type == cugraph_data_type_id_t.INT32: return numpy.int32 - elif c_type == data_type_id_t.INT64: + elif c_type == cugraph_data_type_id_t.INT64: return numpy.int64 - elif c_type == data_type_id_t.FLOAT32: + elif c_type == cugraph_data_type_id_t.FLOAT32: return numpy.float32 - elif c_type == data_type_id_t.FLOAT64: + elif c_type == cugraph_data_type_id_t.FLOAT64: return numpy.float64 - elif c_type == data_type_id_t.SIZE_T: + elif c_type == cugraph_data_type_id_t.SIZE_T: return numpy.int64 else: raise RuntimeError("Internal error: got invalid data type enum value " @@ -126,25 +126,25 @@ cdef get_numpy_type_from_c_type(data_type_id_t c_type): cdef get_c_type_from_numpy_type(numpy_type): dt = numpy.dtype(numpy_type) if dt == numpy.int32: - return data_type_id_t.INT32 + return cugraph_data_type_id_t.INT32 elif dt == numpy.int64: - return data_type_id_t.INT64 + return cugraph_data_type_id_t.INT64 elif dt == numpy.float32: - return data_type_id_t.FLOAT32 + return cugraph_data_type_id_t.FLOAT32 elif dt == numpy.float64: - return data_type_id_t.FLOAT64 + return cugraph_data_type_id_t.FLOAT64 else: raise RuntimeError("Internal error: got invalid data type enum value " f"from Numpy: {numpy_type}") cdef get_c_weight_type_from_numpy_edge_ids_type(numpy_type): if numpy_type == numpy.int32: - return data_type_id_t.FLOAT32 + return cugraph_data_type_id_t.FLOAT32 else: - return data_type_id_t.FLOAT64 + return cugraph_data_type_id_t.FLOAT64 -cdef get_numpy_edge_ids_type_from_c_weight_type(data_type_id_t c_weight_type): - if c_weight_type == data_type_id_t.FLOAT32: +cdef get_numpy_edge_ids_type_from_c_weight_type(cugraph_data_type_id_t c_weight_type): + if c_weight_type == cugraph_data_type_id_t.FLOAT32: return numpy.int32 else: return numpy.int64 diff --git a/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx b/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx index c9f62be389d..5da8c7065c9 100644 --- a/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx +++ b/python/pylibcugraph/pylibcugraph/weakly_connected_components.pyx @@ -16,8 +16,10 @@ from pylibcugraph import GraphProperties, SGGraph -from pylibcugraph._cugraph_c.resource_handle cimport ( +from pylibcugraph._cugraph_c.types cimport ( bool_t, +) +from pylibcugraph._cugraph_c.resource_handle cimport ( cugraph_resource_handle_t, ) from pylibcugraph._cugraph_c.error cimport ( From 050d524d88c27cce6d91c6ec4f26350d1fd9b3bb Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 30 Oct 2024 17:30:58 -0500 Subject: [PATCH 2/4] print sccache stats in builds (#4719) Contributes to https://github.com/rapidsai/build-planning/issues/111 Proposes some small packaging/CI changes, matching similar changes being made across RAPIDS. * printing `sccache` stats to CI logs * updating to the latest `rapids-dependency-file-generator` (v1.16.0) * always explicitly specifying `cpp` / `python` in calls to `rapids-upload-wheels-to-s3` ## Notes for Reviewers This originally also ran wheel builds with `--no-build-isolation`, but I reverted that based on https://github.com/rapidsai/build-planning/issues/108#issuecomment-2436764212. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: https://github.com/rapidsai/cugraph/pull/4719 --- .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 2 ++ ci/build_python.sh | 7 +++++++ ci/build_wheel.sh | 10 ++++++++-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3687562b48e..b5fbcf9ad42 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: setup[.]cfg$ - id: verify-alpha-spec - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 859977d76d5..93e5c680d07 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -17,4 +17,6 @@ rapids-logger "Begin cpp build" RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry mambabuild conda/recipes/libcugraph +sccache --show-adv-stats + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index c94cc2a0fce..af9c3c56403 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -20,6 +20,8 @@ export RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-logger "Begin py build" +sccache --zero-stats + # TODO: Remove `--no-test` flags once importing on a CPU # node works correctly rapids-conda-retry mambabuild \ @@ -27,12 +29,17 @@ rapids-conda-retry mambabuild \ --channel "${CPP_CHANNEL}" \ conda/recipes/pylibcugraph +sccache --show-adv-stats +sccache --zero-stats + rapids-conda-retry mambabuild \ --no-test \ --channel "${CPP_CHANNEL}" \ --channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \ conda/recipes/cugraph +sccache --show-adv-stats + # NOTE: nothing in nx-cugraph is CUDA-specific, but it is built on each CUDA # platform to ensure it is included in each set of artifacts, since test # scripts only install from one set of artifacts based on the CUDA version used diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f3979ab3049..944975c55ee 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -15,6 +15,10 @@ rapids-generate-version > ./VERSION cd "${package_dir}" +sccache --zero-stats + +rapids-logger "Building '${package_name}' wheel" + python -m pip wheel \ -w dist \ -v \ @@ -23,12 +27,14 @@ python -m pip wheel \ --extra-index-url https://pypi.nvidia.com \ . +sccache --show-adv-stats + # pure-python packages should be marked as pure, and not have auditwheel run on them. if [[ ${package_name} == "nx-cugraph" ]] || \ [[ ${package_name} == "cugraph-dgl" ]] || \ [[ ${package_name} == "cugraph-pyg" ]] || \ [[ ${package_name} == "cugraph-equivariant" ]]; then - RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-upload-wheels-to-s3 python dist else case "${RAPIDS_CUDA_VERSION}" in 12.*) @@ -48,5 +54,5 @@ else mkdir -p final_dist python -m auditwheel repair -w final_dist "${EXCLUDE_ARGS[@]}" dist/* - RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist + RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python final_dist fi From 0e57e65afab421edec4d72ed2b5920b295c38a68 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 7 Nov 2024 15:23:44 -0500 Subject: [PATCH 3/4] Put a ceiling on cuda-python (#4747) This project is incompatible with newer versions of `cuda-python`. This puts ceilings of `<=11.8.3` (CUDA 11) and `<=12.6.0` (CUDA 12) on that library. Those ceilings should be removed and replaced with `!=` constraints once new releases of `cuda-python` are up that this project is compatible with. See https://github.com/rapidsai/build-planning/issues/116 for more information. Authors: - Bradley Dice (https://github.com/bdice) - James Lamb (https://github.com/jameslamb) Approvers: - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cugraph/pull/4747 --- conda/recipes/cugraph/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/recipes/cugraph/meta.yaml b/conda/recipes/cugraph/meta.yaml index 9f5a137faba..5a13ba30fd0 100644 --- a/conda/recipes/cugraph/meta.yaml +++ b/conda/recipes/cugraph/meta.yaml @@ -75,10 +75,10 @@ requirements: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major == "11" %} - cudatoolkit - - cuda-python >=11.7.1,<12.0a0 + - cuda-python >=11.7.1,<12.0a0,<=11.8.3 {% else %} - cuda-cudart - - cuda-python >=12.0,<13.0a0 + - cuda-python >=12.0,<13.0a0,<=12.6.0 {% endif %} - cudf ={{ minor_version }} - cupy >=12.0.0 From 2d1189b82b134cd5e319b0a6456ef723c2ac8de6 Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:24:33 -0500 Subject: [PATCH 4/4] Remove CMake/C++ references to cugraph-ops (#4744) Delete deprecated cugraph-ops functionality, clean up references to cugraph-ops. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - James Lamb (https://github.com/jameslamb) - Bradley Dice (https://github.com/bdice) - Seunghwa Kang (https://github.com/seunghwak) - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4744 --- build.sh | 11 +- cpp/CMakeLists.txt | 23 ---- cpp/cmake/thirdparty/get_libcugraphops.cmake | 83 ------------ cpp/include/cugraph/algorithms.hpp | 74 +---------- .../sample_and_compute_local_nbr_indices.cuh | 11 +- ...r_v_random_select_transform_outgoing_e.cuh | 6 - cpp/src/sampling/neighbor_sampling_impl.hpp | 7 - cpp/src/sampling/neighborhood.cu | 122 ------------------ cpp/tests/c_api/biased_neighbor_sample_test.c | 10 -- .../c_api/mg_biased_neighbor_sample_test.c | 20 --- .../c_api/mg_uniform_neighbor_sample_test.c | 20 --- .../c_api/uniform_neighbor_sample_test.c | 10 -- .../sampling/mg_uniform_neighbor_sampling.cpp | 22 ---- .../sampling/uniform_neighbor_sampling.cpp | 21 --- python/cugraph/CMakeLists.txt | 9 -- .../cugraph/tests/docs/test_doctests.py | 9 +- python/cugraph/pytest.ini | 1 - 17 files changed, 6 insertions(+), 453 deletions(-) delete mode 100644 cpp/cmake/thirdparty/get_libcugraphops.cmake delete mode 100644 cpp/src/sampling/neighborhood.cu diff --git a/build.sh b/build.sh index 24ce8c08e8d..29abd48166a 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,6 @@ VALIDARGS=" --pydevelop --allgpuarch --skip_cpp_tests - --without_cugraphops --cmake_default_generator --clean -h @@ -74,7 +73,6 @@ HELP="$0 [ ...] [ ...] --pydevelop - install the Python packages in editable mode --allgpuarch - build for all supported GPU architectures --skip_cpp_tests - do not build the SG test binaries as part of the libcugraph and libcugraph_etl targets - --without_cugraphops - do not build algos that require cugraph-ops --cmake_default_generator - use the default cmake generator instead of ninja --clean - clean an individual target (note: to do a complete rebuild, use the clean target described above) -h - print this text @@ -107,7 +105,6 @@ BUILD_CPP_TESTS=ON BUILD_CPP_MG_TESTS=OFF BUILD_CPP_MTMG_TESTS=OFF BUILD_ALL_GPU_ARCH=0 -BUILD_WITH_CUGRAPHOPS=ON CMAKE_GENERATOR_OPTION="-G Ninja" PYTHON_ARGS_FOR_INSTALL="-m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true" @@ -170,9 +167,6 @@ fi if hasArg --skip_cpp_tests; then BUILD_CPP_TESTS=OFF fi -if hasArg --without_cugraphops; then - BUILD_WITH_CUGRAPHOPS=OFF -fi if hasArg cpp-mtmgtests; then BUILD_CPP_MTMG_TESTS=ON fi @@ -268,7 +262,6 @@ if buildDefault || hasArg libcugraph || hasArg all; then -DBUILD_TESTS=${BUILD_CPP_TESTS} \ -DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \ -DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \ - -DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \ ${CMAKE_GENERATOR_OPTION} \ ${CMAKE_VERBOSE_OPTION} cmake --build "${LIBCUGRAPH_BUILD_DIR}" -j${PARALLEL_LEVEL} ${INSTALL_TARGET} ${VERBOSE_FLAG} @@ -312,7 +305,7 @@ if buildDefault || hasArg pylibcugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/pylibcugraph else - SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/pylibcugraph fi fi @@ -322,7 +315,7 @@ if buildDefault || hasArg cugraph || hasArg all; then if hasArg --clean; then cleanPythonDir ${REPODIR}/python/cugraph else - SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS}" \ + SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \ python ${PYTHON_ARGS_FOR_INSTALL} ${REPODIR}/python/cugraph fi fi diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index fc3dbb57e1f..2cea2e504ab 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -54,17 +54,11 @@ option(BUILD_SHARED_LIBS "Build cuGraph shared libraries" ON) option(BUILD_CUGRAPH_MG_TESTS "Build cuGraph multigpu algorithm tests" OFF) option(CMAKE_CUDA_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF) option(BUILD_TESTS "Configure CMake to build tests" ON) -option(USE_CUGRAPH_OPS "Enable all functions that call cugraph-ops" ON) option(USE_RAFT_STATIC "Build raft as a static library" OFF) option(CUGRAPH_COMPILE_RAFT_LIB "Compile the raft library instead of using it header-only" ON) option(CUDA_STATIC_RUNTIME "Statically link the CUDA toolkit runtime and libraries" OFF) -option(CUGRAPH_USE_CUGRAPH_OPS_STATIC "Build and statically link the cugraph-ops library" OFF) -option(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL "Exclude cugraph-ops targets from cuGraph's 'all' target" OFF) -option(ALLOW_CLONE_CUGRAPH_OPS "Whether to attempt to clone cugraph-ops when a local version is not available" OFF) message(VERBOSE "CUGRAPH: CUDA_STATIC_RUNTIME=${CUDA_STATIC_RUNTIME}") -message(VERBOSE "CUGRAPH: CUGRAPH_USE_CUGRAPH_OPS_STATIC=${CUGRAPH_USE_CUGRAPH_OPS_STATIC}") -message(VERBOSE "CUGRAPH: CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL=${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL}") ################################################################################ # - compiler options ----------------------------------------------------------- @@ -115,13 +109,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug) list(APPEND CUGRAPH_CUDA_FLAGS -G -Xcompiler=-rdynamic) endif() -if(NOT USE_CUGRAPH_OPS) - message(STATUS "Disabling functions that reference cugraph-ops") - list(APPEND CUGRAPH_C_FLAGS -DNO_CUGRAPH_OPS) - list(APPEND CUGRAPH_CXX_FLAGS -DNO_CUGRAPH_OPS) - list(APPEND CUGRAPH_CUDA_FLAGS -DNO_CUGRAPH_OPS) -endif() - ################################################################################################### # - find CPM based dependencies ------------------------------------------------------------------ @@ -151,10 +138,6 @@ include(${rapids-cmake-dir}/cpm/cuco.cmake) rapids_cpm_cuco(BUILD_EXPORT_SET cugraph-exports INSTALL_EXPORT_SET cugraph-exports) include(cmake/thirdparty/get_raft.cmake) -if(USE_CUGRAPH_OPS) - include(cmake/thirdparty/get_libcugraphops.cmake) -endif() - if(BUILD_TESTS) include(${rapids-cmake-dir}/cpm/gtest.cmake) rapids_cpm_gtest(BUILD_STATIC) @@ -438,12 +421,6 @@ set(CUGRAPH_SOURCES src/mtmg/vertex_pairs_result_mg_v64_e64.cu ) -if(USE_CUGRAPH_OPS) - list(APPEND CUGRAPH_SOURCES - src/sampling/neighborhood.cu - ) -endif() - add_library(cugraph ${CUGRAPH_SOURCES}) set_target_properties(cugraph diff --git a/cpp/cmake/thirdparty/get_libcugraphops.cmake b/cpp/cmake/thirdparty/get_libcugraphops.cmake deleted file mode 100644 index b10af300a98..00000000000 --- a/cpp/cmake/thirdparty/get_libcugraphops.cmake +++ /dev/null @@ -1,83 +0,0 @@ -#============================================================================= -# Copyright (c) 2022, NVIDIA CORPORATION. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -set(CUGRAPH_MIN_VERSION_cugraph_ops "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00") - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_VERSION) - set(CUGRAPH_CUGRAPH_OPS_VERSION "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}") -endif() - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_BRANCH) - set(CUGRAPH_CUGRAPH_OPS_BRANCH "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}") -endif() - -if(NOT DEFINED CUGRAPH_CUGRAPH_OPS_REPOSITORY) - set(CUGRAPH_CUGRAPH_OPS_REPOSITORY "git@github.com:rapidsai/cugraph-ops.git") -endif() - -function(find_and_configure_cugraph_ops) - - set(oneValueArgs VERSION REPO PINNED_TAG BUILD_STATIC EXCLUDE_FROM_ALL ALLOW_CLONE_CUGRAPH_OPS) - cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN}) - - if(PKG_ALLOW_CLONE_CUGRAPH_OPS) - if(NOT PKG_PINNED_TAG STREQUAL "branch-${CUGRAPH_CUGRAPH_OPS_VERSION}") - message("Pinned tag found: ${PKG_PINNED_TAG}. Cloning cugraph-ops locally.") - set(CPM_DOWNLOAD_cugraph-ops ON) - elseif(PKG_BUILD_STATIC AND (NOT CPM_cugraph-ops_SOURCE)) - message(STATUS "CUGRAPH: Cloning cugraph-ops locally to build static libraries.") - set(CPM_DOWNLOAD_cugraph-ops ON) - endif() - endif() - - set(CUGRAPH_OPS_BUILD_SHARED_LIBS ON) - if(PKG_BUILD_STATIC) - set(CUGRAPH_OPS_BUILD_SHARED_LIBS OFF) - endif() - - rapids_cpm_find(cugraph-ops ${PKG_VERSION} REQUIRED - GLOBAL_TARGETS cugraph-ops::cugraph-ops++ - BUILD_EXPORT_SET cugraph-exports - INSTALL_EXPORT_SET cugraph-exports - CPM_ARGS - SOURCE_SUBDIR cpp - GIT_REPOSITORY ${PKG_REPO} - GIT_TAG ${PKG_PINNED_TAG} - EXCLUDE_FROM_ALL ${PKG_EXCLUDE_FROM_ALL} - OPTIONS - "BUILD_CUGRAPH_OPS_CPP_TESTS OFF" - "BUILD_SHARED_LIBS ${CUGRAPH_OPS_BUILD_SHARED_LIBS}" - ) -endfunction() - -### -# Change pinned tag and fork here to test a commit in CI -# -# To use a locally-built cugraph-ops package, set the CMake variable -# `-D cugraph-ops_ROOT=/path/to/cugraph-ops/build` -### -find_and_configure_cugraph_ops(VERSION ${CUGRAPH_MIN_VERSION_cugraph_ops} - REPO ${CUGRAPH_CUGRAPH_OPS_REPOSITORY} - PINNED_TAG ${CUGRAPH_CUGRAPH_OPS_BRANCH} - BUILD_STATIC ${CUGRAPH_USE_CUGRAPH_OPS_STATIC} - EXCLUDE_FROM_ALL ${CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL} - # Allow cloning cugraph-ops in cases when we - # expect the local copy of cugraph-ops to not be - # the one that we want. Cases include static - # linking such that we need to compile a static - # lib or during development when using a - # different branch of cugraph-ops. - ALLOW_CLONE_CUGRAPH_OPS ${ALLOW_CLONE_CUGRAPH_OPS}) diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index 7e5af4ac686..60f4d21822f 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -23,16 +23,12 @@ #include #include -#include - -#ifndef NO_CUGRAPH_OPS -#include -#endif - #include #include #include +#include + #include #include @@ -1678,72 +1674,6 @@ node2vec_random_walks(raft::handle_t const& handle, weight_t p, weight_t q); -#ifndef NO_CUGRAPH_OPS -/** - * @brief generate sub-sampled graph as an adjacency list (CSR format) given input graph, - * list of vertices and sample size per vertex. The output graph consists of the given - * vertices with each vertex having at most `sample_size` neighbors from the original graph - * - * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead. - * - * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and - * single-gpu). - * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and - * handles to various CUDA libraries) to run graph algorithms. - * @param rng_state The RngState instance holding pseudo-random number generator state. - * @param graph Graph (view )object to sub-sample. - * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling. - * @param num_start_vertices = number(vertices) to use for sub-sampling. - * @param sampling_size = max number of neighbors per output vertex. - * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs. - * @return std::tuple, - * rmm::device_uvector> - * Tuple consisting of two arrays representing the offsets and indices of - * the sub-sampled graph. - */ -template -std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -/** - * @brief generate sub-sampled graph as an edge list (COO format) given input graph, - * list of vertices and sample size per vertex. The output graph consists of the given - * vertices with each vertex having at most `sample_size` neighbors from the original graph - * - * @deprecated This API will be deprecated. uniform_neighbor_sample can be used instead. - * - * @tparam graph_t Type of input graph/view (typically, graph_view_t, non-transposed and - * single-gpu). - * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and - * handles to various CUDA libraries) to run graph algorithms. - * @param rng_state The RngState instance holding pseudo-random number generator state. - * @param graph Graph (view )object to sub-sample. - * @param ptr_d_start Device pointer to set of starting vertex indices for the sub-sampling. - * @param num_start_vertices = number(vertices) to use for sub-sampling. - * @param sampling_size = max number of neighbors per output vertex. - * @param sampling_algo = the sampling algorithm (algo R/algo L/etc.) used to produce outputs. - * @return std::tuple, - * rmm::device_uvector> - * Tuple consisting of two arrays representing the source and destination nodes of - * the sub-sampled graph. - */ -template -std::tuple, rmm::device_uvector> sample_neighbors_edgelist( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -#endif - /** * @brief Finds (weakly-connected-)component IDs of each vertices in the input graph. * diff --git a/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh b/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh index a6a164d36c1..5ebc3dc8aea 100644 --- a/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh +++ b/cpp/src/prims/detail/sample_and_compute_local_nbr_indices.cuh @@ -597,7 +597,6 @@ rmm::device_uvector compute_uniform_sampling_index_without_replacement( raft::random::RngState& rng_state, size_t K) { -#ifndef NO_CUGRAPH_OPS assert(cugraph::invalid_edge_id_v == cugraph::ops::graph::INVALID_ID); edge_t mid_partition_degree_range_last = static_cast(K * 10); // tuning parameter @@ -978,9 +977,6 @@ rmm::device_uvector compute_uniform_sampling_index_without_replacement( frontier_degrees.shrink_to_fit(handle.get_stream()); return nbr_indices; -#else - CUGRAPH_FAIL("unimplemented."); -#endif } template @@ -1572,7 +1568,7 @@ uniform_sample_and_compute_local_nbr_indices( bool with_replacement) { using edge_t = typename GraphViewType::edge_type; -#ifndef NO_CUGRAPH_OPS + assert(cugraph::invalid_edge_id_v == cugraph::ops::graph::INVALID_ID); using vertex_t = typename GraphViewType::vertex_type; @@ -1673,11 +1669,6 @@ uniform_sample_and_compute_local_nbr_indices( return std::make_tuple( std::move(local_nbr_indices), std::move(key_indices), std::move(local_frontier_sample_offsets)); -#else - CUGRAPH_FAIL("unimplemented."); - return std::make_tuple( - rmm::device_uvector(0, handle.get_stream()), std::nullopt, std::vector()); -#endif } template invalid_value, bool do_expensive_check) { -#ifndef NO_CUGRAPH_OPS using vertex_t = typename GraphViewType::vertex_type; using edge_t = typename GraphViewType::edge_type; using key_t = typename VertexFrontierBucketType::key_type; @@ -590,11 +589,6 @@ per_v_random_select_transform_e(raft::handle_t const& handle, } return std::make_tuple(std::move(sample_offsets), std::move(sample_e_op_results)); -#else - CUGRAPH_FAIL("unimplemented."); - return std::make_tuple(std::nullopt, - allocate_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{})); -#endif } } // namespace detail diff --git a/cpp/src/sampling/neighbor_sampling_impl.hpp b/cpp/src/sampling/neighbor_sampling_impl.hpp index 1785f934426..d8e8cc2b756 100644 --- a/cpp/src/sampling/neighbor_sampling_impl.hpp +++ b/cpp/src/sampling/neighbor_sampling_impl.hpp @@ -67,12 +67,6 @@ neighbor_sample_impl( raft::random::RngState& rng_state, bool do_expensive_check) { -#ifdef NO_CUGRAPH_OPS // FIXME: this is relevant only when edge_bias_view.has_value() is false, - // this ifdef statement will be removed once we migrate relevant cugraph-ops - // functions to cugraph - CUGRAPH_FAIL( - "neighbor_sample_impl not supported in this configuration, built with NO_CUGRAPH_OPS"); -#else static_assert(std::is_floating_point_v); CUGRAPH_EXPECTS(fan_out.size() > 0, "Invalid input argument: number of levels must be non-zero."); @@ -336,7 +330,6 @@ neighbor_sample_impl( std::move(result_hops), std::move(result_labels), label_to_output_comm_rank); -#endif } } // namespace detail diff --git a/cpp/src/sampling/neighborhood.cu b/cpp/src/sampling/neighborhood.cu deleted file mode 100644 index e75b08136ea..00000000000 --- a/cpp/src/sampling/neighborhood.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utilities/cugraph_ops_utils.hpp" - -#include -#include - -#include - -#include - -namespace cugraph { - -template -std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo) -{ - using base_vertex_t = std::decay_t; - using base_edge_t = std::decay_t; - static_assert(std::is_same_v, - "cugraph-ops sampling not yet implemented for different node and edge types"); - - const auto ops_graph = detail::get_graph(graph_view); - return ops::graph::uniform_sample_csc(rng_state, - ops_graph, - ptr_d_start, - num_start_vertices, - sampling_size, - sampling_algo, - ops_graph.dst_max_in_degree, - handle.get_stream()); -} - -template -std::tuple, rmm::device_uvector> sample_neighbors_edgelist( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - vertex_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo) -{ - using base_vertex_t = std::decay_t; - using base_edge_t = std::decay_t; - static_assert(std::is_same_v, - "cugraph-ops sampling not yet implemented for different node and edge types"); - - const auto ops_graph = detail::get_graph(graph_view); - return ops::graph::uniform_sample_coo(rng_state, - ops_graph, - ptr_d_start, - num_start_vertices, - sampling_size, - sampling_algo, - ops_graph.dst_max_in_degree, - handle.get_stream()); -} - -// template explicit instantiation directives (EIDir's): -// -// CSR SG FP32{ -template std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int32_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -template std::tuple, rmm::device_uvector> -sample_neighbors_adjacency_list(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int64_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -//} -// -// COO SG FP32{ -template std::tuple, rmm::device_uvector> -sample_neighbors_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int32_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); - -template std::tuple, rmm::device_uvector> -sample_neighbors_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& gview, - int64_t const* ptr_d_start, - size_t num_start_vertices, - size_t sampling_size, - ops::graph::SamplingAlgoT sampling_algo); -//} - -} // namespace cugraph diff --git a/cpp/tests/c_api/biased_neighbor_sample_test.c b/cpp/tests/c_api/biased_neighbor_sample_test.c index 6f0af3a8e0d..e0c9945e091 100644 --- a/cpp/tests/c_api/biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/biased_neighbor_sample_test.c @@ -149,10 +149,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -459,7 +455,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -584,10 +579,6 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -678,7 +669,6 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han cugraph_sample_result_free(result); cugraph_sampling_options_free(sampling_options); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c index f7103d1e39d..ba06ffb254d 100644 --- a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c @@ -142,10 +142,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -430,7 +426,6 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -576,10 +571,6 @@ int test_biased_neighbor_from_alex(const cugraph_resource_handle_t* handle) &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed"); -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -673,7 +664,6 @@ int test_biased_neighbor_from_alex(const cugraph_resource_handle_t* handle) M[h_srcs[i]][h_dsts[i]] >= 0, "biased_neighbor_sample got edge that doesn't exist"); } -#endif cugraph_sample_result_free(result); @@ -854,10 +844,6 @@ int test_biased_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -939,7 +925,6 @@ int test_biased_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handle test_ret_value, result_offsets_size == expected_size[rank], "incorrect number of results"); cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -1114,10 +1099,6 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "biased_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "biased_neighbor_sample failed."); @@ -1219,7 +1200,6 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c index f9388a2e565..7322b7379d3 100644 --- a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c @@ -141,10 +141,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -429,7 +425,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -574,10 +569,6 @@ int test_uniform_neighbor_from_alex(const cugraph_resource_handle_t* handle) &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed"); -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -671,7 +662,6 @@ int test_uniform_neighbor_from_alex(const cugraph_resource_handle_t* handle) M[h_srcs[i]][h_dsts[i]] >= 0, "uniform_neighbor_sample got edge that doesn't exist"); } -#endif cugraph_sample_result_free(result); @@ -851,10 +841,6 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -936,7 +922,6 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl test_ret_value, result_offsets_size == expected_size[rank], "incorrect number of results"); cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -1110,10 +1095,6 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -1215,7 +1196,6 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/uniform_neighbor_sample_test.c b/cpp/tests/c_api/uniform_neighbor_sample_test.c index 931d1fbfe07..d37c8b9ffdc 100644 --- a/cpp/tests/c_api/uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/uniform_neighbor_sample_test.c @@ -148,10 +148,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -458,7 +454,6 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle } cugraph_sample_result_free(result); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); @@ -674,10 +669,6 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha &result, &ret_error); -#ifdef NO_CUGRAPH_OPS - TEST_ASSERT( - test_ret_value, ret_code != CUGRAPH_SUCCESS, "uniform_neighbor_sample should have failed") -#else TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, cugraph_error_message(ret_error)); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "uniform_neighbor_sample failed."); @@ -768,7 +759,6 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha cugraph_sample_result_free(result); cugraph_sampling_options_free(sampling_options); -#endif cugraph_graph_free(graph); cugraph_error_free(ret_error); diff --git a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp index 0dd63e4fb06..dc9043e0c02 100644 --- a/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp +++ b/cpp/tests/sampling/mg_uniform_neighbor_sampling.cpp @@ -155,27 +155,6 @@ class Tests_MGUniform_Neighbor_Sampling random_sources.size(), handle_->get_stream()); -#ifdef NO_CUGRAPH_OPS - EXPECT_THROW( - cugraph::uniform_neighbor_sample( - *handle_, - mg_graph_view, - mg_edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}, - raft::device_span{random_sources_copy.data(), random_sources.size()}, - std::make_optional( - raft::device_span{batch_number.data(), batch_number.size()}), - std::make_optional(std::make_tuple( - raft::device_span{unique_batches.data(), unique_batches.size()}, - raft::device_span{comm_ranks.data(), comm_ranks.size()})), - raft::host_span(uniform_neighbor_sampling_usecase.fanout.data(), - uniform_neighbor_sampling_usecase.fanout.size()), - rng_state, - true, - uniform_neighbor_sampling_usecase.with_replacement), - std::exception); -#else if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement handle_->get_comms().barrier(); @@ -291,7 +270,6 @@ class Tests_MGUniform_Neighbor_Sampling } } } -#endif } private: diff --git a/cpp/tests/sampling/uniform_neighbor_sampling.cpp b/cpp/tests/sampling/uniform_neighbor_sampling.cpp index 87524b03acf..db4123d2476 100644 --- a/cpp/tests/sampling/uniform_neighbor_sampling.cpp +++ b/cpp/tests/sampling/uniform_neighbor_sampling.cpp @@ -131,26 +131,6 @@ class Tests_Uniform_Neighbor_Sampling std::optional, raft::device_span>> label_to_output_comm_rank_mapping{std::nullopt}; -#ifdef NO_CUGRAPH_OPS - EXPECT_THROW( - cugraph::uniform_neighbor_sample( - handle, - graph_view, - edge_weight_view, - std::optional>{std::nullopt}, - std::optional>{std::nullopt}, - raft::device_span{random_sources_copy.data(), random_sources.size()}, - batch_number ? std::make_optional(raft::device_span{batch_number->data(), - batch_number->size()}) - : std::nullopt, - label_to_output_comm_rank_mapping, - raft::host_span(uniform_neighbor_sampling_usecase.fanout.data(), - uniform_neighbor_sampling_usecase.fanout.size()), - rng_state, - true, - uniform_neighbor_sampling_usecase.flag_replacement), - std::exception); -#else if (cugraph::test::g_perf) { RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement hr_timer.start("Uniform neighbor sampling"); @@ -224,7 +204,6 @@ class Tests_Uniform_Neighbor_Sampling uniform_neighbor_sampling_usecase.fanout.size())); } } -#endif } }; diff --git a/python/cugraph/CMakeLists.txt b/python/cugraph/CMakeLists.txt index ca38b5551c9..117f7cf5142 100644 --- a/python/cugraph/CMakeLists.txt +++ b/python/cugraph/CMakeLists.txt @@ -32,13 +32,8 @@ project( option(FIND_CUGRAPH_CPP "Search for existing CUGRAPH C++ installations before defaulting to local files" OFF ) -option(USE_CUGRAPH_OPS "Enable all functions that call cugraph-ops" ON) option(USE_CUDA_MATH_WHEELS "Use the CUDA math wheels instead of the system libraries" OFF) -if(NOT USE_CUGRAPH_OPS) - message(STATUS "Disabling libcugraph functions that reference cugraph-ops") - add_compile_definitions(NO_CUGRAPH_OPS) -endif() # If the user requested it, we attempt to find CUGRAPH. if(FIND_CUGRAPH_CPP) @@ -54,14 +49,10 @@ if(NOT cugraph_FOUND) set(BUILD_TESTS OFF) set(BUILD_CUGRAPH_MG_TESTS OFF) - set(BUILD_CUGRAPH_OPS_CPP_TESTS OFF) set(CUDA_STATIC_RUNTIME ON) set(CUDA_STATIC_MATH_LIBRARIES ON) set(USE_RAFT_STATIC ON) set(CUGRAPH_COMPILE_RAFT_LIB ON) - set(CUGRAPH_USE_CUGRAPH_OPS_STATIC ON) - set(CUGRAPH_EXCLUDE_CUGRAPH_OPS_FROM_ALL ON) - set(ALLOW_CLONE_CUGRAPH_OPS ON) if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.0) set(CUDA_STATIC_MATH_LIBRARIES OFF) diff --git a/python/cugraph/cugraph/tests/docs/test_doctests.py b/python/cugraph/cugraph/tests/docs/test_doctests.py index 44ab16410ca..2095fd41fe9 100644 --- a/python/cugraph/cugraph/tests/docs/test_doctests.py +++ b/python/cugraph/cugraph/tests/docs/test_doctests.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -186,11 +186,4 @@ def test_docstring(self, docstring): f"{docstring.name}:\n{doctest_stdout.getvalue()}" ) except AssertionError: - # If some failed but all the failures were due to lack of - # cugraph-ops support, we can skip. - out = doctest_stdout.getvalue() - if ("CUGRAPH_UNKNOWN_ERROR" in out and "unimplemented" in out) or ( - "built with NO_CUGRAPH_OPS" in out - ): - pytest.skip("Doctest requires cugraph-ops support.") raise diff --git a/python/cugraph/pytest.ini b/python/cugraph/pytest.ini index 2f01a0cc51b..5cbc4631664 100644 --- a/python/cugraph/pytest.ini +++ b/python/cugraph/pytest.ini @@ -41,7 +41,6 @@ markers = nx_types: use NetworkX input types matrix_types: use SciPy/CuPy matrix input types slow: slow-running tests/benchmarks - cugraph_ops: Tests requiring cugraph-ops mg: Test MG code paths - number of gpu > 1 sg: Test SG code paths and dask sg tests - number of gpu == 1 ci: Tests that should be run in ci