diff --git a/cpp/include/cugraph_c/graph_functions.h b/cpp/include/cugraph_c/graph_functions.h index cfe611da57d..8fe1ea0b958 100644 --- a/cpp/include/cugraph_c/graph_functions.h +++ b/cpp/include/cugraph_c/graph_functions.h @@ -60,8 +60,8 @@ cugraph_error_code_t cugraph_create_vertex_pairs( * @param [in] vertex_pairs A vertex_pairs * @return type erased array of vertex ids */ -cugraph_type_erased_device_array_view_t const* cugraph_vertex_pairs_get_first( - cugraph_vertex_pairs_t const* vertex_pairs); +cugraph_type_erased_device_array_view_t* cugraph_vertex_pairs_get_first( + cugraph_vertex_pairs_t* vertex_pairs); /** * @brief Get the second vertex id array @@ -69,8 +69,8 @@ cugraph_type_erased_device_array_view_t const* cugraph_vertex_pairs_get_first( * @param [in] vertex_pairs A vertex_pairs * @return type erased array of vertex ids */ -cugraph_type_erased_device_array_view_t const* cugraph_vertex_pairs_get_second( - cugraph_vertex_pairs_t const* vertex_pairs); +cugraph_type_erased_device_array_view_t* cugraph_vertex_pairs_get_second( + cugraph_vertex_pairs_t* vertex_pairs); /** * @brief Free vertex pair diff --git a/cpp/include/cugraph_c/similarity_algorithms.h b/cpp/include/cugraph_c/similarity_algorithms.h index 008c4e0c8b8..8d23182628b 100644 --- a/cpp/include/cugraph_c/similarity_algorithms.h +++ b/cpp/include/cugraph_c/similarity_algorithms.h @@ -43,8 +43,8 @@ typedef struct { * @param [in] result The result from a similarity algorithm * @return vertex pairs */ -cugraph_vertex_pairs_t const* cugraph_similarity_result_get_vertex_pairs( - cugraph_similarity_result_t const* result); +cugraph_vertex_pairs_t* cugraph_similarity_result_get_vertex_pairs( + cugraph_similarity_result_t* result); /** * @ingroup similarity @@ -54,7 +54,7 @@ cugraph_vertex_pairs_t const* cugraph_similarity_result_get_vertex_pairs( * @return type erased array of similarity coefficients */ cugraph_type_erased_device_array_view_t* cugraph_similarity_result_get_similarity( - cugraph_similarity_result_t const* result); + cugraph_similarity_result_t* result); /** * @ingroup similarity diff --git a/cpp/src/c_api/graph_functions.cpp b/cpp/src/c_api/graph_functions.cpp index a30300741b0..cd68490aa5f 100644 --- a/cpp/src/c_api/graph_functions.cpp +++ b/cpp/src/c_api/graph_functions.cpp @@ -244,21 +244,19 @@ extern "C" cugraph_error_code_t cugraph_create_vertex_pairs( return cugraph::c_api::run_algorithm(graph, functor, vertex_pairs, error); } -extern "C" cugraph_type_erased_device_array_view_t const* cugraph_vertex_pairs_get_first( - cugraph_vertex_pairs_t const* vertex_pairs) +extern "C" cugraph_type_erased_device_array_view_t* cugraph_vertex_pairs_get_first( + cugraph_vertex_pairs_t* vertex_pairs) { - auto internal_pointer = - reinterpret_cast(vertex_pairs); - return reinterpret_cast( + auto internal_pointer = reinterpret_cast(vertex_pairs); + return reinterpret_cast( internal_pointer->first_->view()); } -extern "C" cugraph_type_erased_device_array_view_t const* cugraph_vertex_pairs_get_second( - cugraph_vertex_pairs_t const* vertex_pairs) +extern "C" cugraph_type_erased_device_array_view_t* cugraph_vertex_pairs_get_second( + cugraph_vertex_pairs_t* vertex_pairs) { - auto internal_pointer = - reinterpret_cast(vertex_pairs); - return reinterpret_cast( + auto internal_pointer = reinterpret_cast(vertex_pairs); + return reinterpret_cast( internal_pointer->second_->view()); } diff --git a/cpp/src/c_api/similarity.cpp b/cpp/src/c_api/similarity.cpp index c81685ced26..29b27f68ee4 100644 --- a/cpp/src/c_api/similarity.cpp +++ b/cpp/src/c_api/similarity.cpp @@ -34,7 +34,7 @@ namespace c_api { struct cugraph_similarity_result_t { cugraph_type_erased_device_array_t* similarity_coefficients_; - cugraph_vertex_pairs_t const* vertex_pairs_; + cugraph_vertex_pairs_t* vertex_pairs_; }; } // namespace c_api @@ -303,7 +303,7 @@ struct overlap_functor { } // namespace extern "C" cugraph_type_erased_device_array_view_t* cugraph_similarity_result_get_similarity( - cugraph_similarity_result_t const* result) + cugraph_similarity_result_t* result) { auto internal_pointer = reinterpret_cast(result); @@ -311,12 +311,11 @@ extern "C" cugraph_type_erased_device_array_view_t* cugraph_similarity_result_ge internal_pointer->similarity_coefficients_->view()); } -extern "C" cugraph_vertex_pairs_t const* cugraph_similarity_result_get_vertex_pairs( - cugraph_similarity_result_t const* result) +extern "C" cugraph_vertex_pairs_t* cugraph_similarity_result_get_vertex_pairs( + cugraph_similarity_result_t* result) { - auto internal_pointer = - reinterpret_cast(result); - return reinterpret_cast(internal_pointer->vertex_pairs_); + auto internal_pointer = reinterpret_cast(result); + return reinterpret_cast(internal_pointer->vertex_pairs_); } extern "C" void cugraph_similarity_result_free(cugraph_similarity_result_t* result) diff --git a/cpp/tests/c_api/similarity_test.c b/cpp/tests/c_api/similarity_test.c index 2e2286af7af..5637a9d2b01 100644 --- a/cpp/tests/c_api/similarity_test.c +++ b/cpp/tests/c_api/similarity_test.c @@ -186,12 +186,12 @@ int generic_all_pairs_similarity_test(vertex_t* h_src, cugraph_type_erased_device_array_view_t* similarity_coefficient; - cugraph_vertex_pairs_t const* vertex_pairs; + cugraph_vertex_pairs_t * vertex_pairs; vertex_pairs = cugraph_similarity_result_get_vertex_pairs(result); similarity_coefficient = cugraph_similarity_result_get_similarity(result); - cugraph_type_erased_device_array_view_t const *result_v1; - cugraph_type_erased_device_array_view_t const *result_v2; + cugraph_type_erased_device_array_view_t *result_v1; + cugraph_type_erased_device_array_view_t *result_v2; result_v1 = cugraph_vertex_pairs_get_first(vertex_pairs); result_v2 = cugraph_vertex_pairs_get_second(vertex_pairs); diff --git a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx index d636e9ddf53..312918dc9d6 100644 --- a/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/jaccard_coefficients.pyx @@ -151,12 +151,12 @@ def jaccard_coefficients(ResourceHandle resource_handle, cupy_similarity = copy_to_cupy_array(c_resource_handle_ptr, similarity_ptr) - cdef const cugraph_type_erased_device_array_view_t* first_ptr = \ + cdef cugraph_type_erased_device_array_view_t* first_ptr = \ cugraph_vertex_pairs_get_first(vertex_pairs_ptr) cupy_first = copy_to_cupy_array(c_resource_handle_ptr, first_ptr) - cdef const cugraph_type_erased_device_array_view_t* second_ptr = \ + cdef cugraph_type_erased_device_array_view_t* second_ptr = \ cugraph_vertex_pairs_get_second(vertex_pairs_ptr) cupy_second = copy_to_cupy_array(c_resource_handle_ptr, second_ptr) diff --git a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx index aa71d0b63cb..65c14f7dd12 100644 --- a/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/overlap_coefficients.pyx @@ -150,12 +150,12 @@ def overlap_coefficients(ResourceHandle resource_handle, cupy_similarity = copy_to_cupy_array(c_resource_handle_ptr, similarity_ptr) - cdef const cugraph_type_erased_device_array_view_t* first_ptr = \ + cdef cugraph_type_erased_device_array_view_t* first_ptr = \ cugraph_vertex_pairs_get_first(vertex_pairs_ptr) cupy_first = copy_to_cupy_array(c_resource_handle_ptr, first_ptr) - cdef const cugraph_type_erased_device_array_view_t* second_ptr = \ + cdef cugraph_type_erased_device_array_view_t* second_ptr = \ cugraph_vertex_pairs_get_second(vertex_pairs_ptr) cupy_second = copy_to_cupy_array(c_resource_handle_ptr, second_ptr) diff --git a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx index dfce5ae9834..d0d971af1dd 100644 --- a/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx +++ b/python/pylibcugraph/pylibcugraph/sorensen_coefficients.pyx @@ -149,12 +149,12 @@ def sorensen_coefficients(ResourceHandle resource_handle, cupy_similarity = copy_to_cupy_array(c_resource_handle_ptr, similarity_ptr) - cdef const cugraph_type_erased_device_array_view_t* first_ptr = \ + cdef cugraph_type_erased_device_array_view_t* first_ptr = \ cugraph_vertex_pairs_get_first(vertex_pairs_ptr) cupy_first = copy_to_cupy_array(c_resource_handle_ptr, first_ptr) - cdef const cugraph_type_erased_device_array_view_t* second_ptr = \ + cdef cugraph_type_erased_device_array_view_t* second_ptr = \ cugraph_vertex_pairs_get_second(vertex_pairs_ptr) cupy_second = copy_to_cupy_array(c_resource_handle_ptr, second_ptr)