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] 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 (