Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jnke2016 committed Nov 15, 2024
1 parent 9edd3ae commit c8b5875
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cpp/include/cugraph_c/sampling_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_renumber_map_
* @return type erased array pointing to the renumber map
*/
cugraph_type_erased_device_array_view_t*
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map(
cugraph_sample_result_get_edge_renumber_map(
const cugraph_sample_result_t* result);

/**
Expand All @@ -794,7 +794,7 @@ cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map(
* @return type erased array pointing to the renumber map
*/
cugraph_type_erased_device_array_view_t*
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets(
cugraph_sample_result_get_edge_renumber_map_offsets(
const cugraph_sample_result_t* result);

/**
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/c_api/neighbor_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ struct cugraph_sample_result_t {
cugraph_type_erased_device_array_t* label_{nullptr};
cugraph_type_erased_device_array_t* renumber_map_{nullptr};
cugraph_type_erased_device_array_t* renumber_map_offsets_{nullptr};
cugraph_type_erased_device_array_t* renumbered_and_sorted_edge_id_renumber_map_{nullptr};
cugraph_type_erased_device_array_t* edge_renumber_map_{nullptr};
cugraph_type_erased_device_array_t*
renumbered_and_sorted_edge_id_renumber_map_label_type_offsets_{nullptr};
edge_renumber_map_offsets_{nullptr};
};

} // namespace c_api
Expand Down Expand Up @@ -1594,25 +1594,25 @@ extern "C" cugraph_type_erased_device_array_view_t* cugraph_sample_result_get_re
}

extern "C" cugraph_type_erased_device_array_view_t*
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map(
cugraph_sample_result_get_edge_renumber_map(
const cugraph_sample_result_t* result)
{
auto internal_pointer = reinterpret_cast<cugraph::c_api::cugraph_sample_result_t const*>(result);
return internal_pointer->renumber_map_ == nullptr
? NULL
: reinterpret_cast<cugraph_type_erased_device_array_view_t*>(
internal_pointer->renumbered_and_sorted_edge_id_renumber_map_->view());
internal_pointer->edge_renumber_map_->view());
}

extern "C" cugraph_type_erased_device_array_view_t*
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets(
cugraph_sample_result_get_edge_renumber_map_offsets(
const cugraph_sample_result_t* result)
{
auto internal_pointer = reinterpret_cast<cugraph::c_api::cugraph_sample_result_t const*>(result);
return internal_pointer->renumber_map_ == nullptr
? NULL
: reinterpret_cast<cugraph_type_erased_device_array_view_t*>(
internal_pointer->renumbered_and_sorted_edge_id_renumber_map_label_type_offsets_
internal_pointer->edge_renumber_map_offsets_
->view());
}

Expand Down
4 changes: 2 additions & 2 deletions python/pylibcugraph/pylibcugraph/_cugraph_c/algorithms.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ cdef extern from "cugraph_c/algorithms.h":
)

cdef cugraph_type_erased_device_array_view_t* \
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map(
cugraph_sample_result_get_edge_renumber_map(
const cugraph_sample_result_t* result
)

cdef cugraph_type_erased_device_array_view_t* \
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets(
cugraph_sample_result_get_edge_renumber_map_offsets(
const cugraph_sample_result_t* result
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ def heterogeneous_biased_neighbor_sample(ResourceHandle resource_handle,
if renumber:
cupy_renumber_map = result.get_renumber_map()
cupy_renumber_map_offsets = result.get_renumber_map_offsets()
cupy_edge_renumber_map = result.get_renumbered_and_sorted_edge_id_renumber_map()
cupy_edge_renumber_map_offsets = result.get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets()
cupy_edge_renumber_map = result.get_edge_renumber_map()
cupy_edge_renumber_map_offsets = result.get_edge_renumber_map_offsets()

sampling_results = {
'major_offsets': cupy_major_offsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ def heterogeneous_uniform_neighbor_sample(ResourceHandle resource_handle,
if renumber:
cupy_renumber_map = result.get_renumber_map()
cupy_renumber_map_offsets = result.get_renumber_map_offsets()
cupy_edge_renumber_map = result.get_renumbered_and_sorted_edge_id_renumber_map()
cupy_edge_renumber_map_offsets = result.get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets()
cupy_edge_renumber_map = result.get_edge_renumber_map()
cupy_edge_renumber_map_offsets = result.get_edge_renumber_map_offsets()

sampling_results = {
'major_offsets': cupy_major_offsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ def homogeneous_biased_neighbor_sample(ResourceHandle resource_handle,
if renumber:
cupy_renumber_map = result.get_renumber_map()
cupy_renumber_map_offsets = result.get_renumber_map_offsets()
cupy_edge_renumber_map = result.get_renumbered_and_sorted_edge_id_renumber_map()
cupy_edge_renumber_map_offsets = result.get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets()
cupy_edge_renumber_map = result.get_edge_renumber_map()
cupy_edge_renumber_map_offsets = result.get_edge_renumber_map_offsets()

sampling_results = {
'major_offsets': cupy_major_offsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ def homogeneous_uniform_neighbor_sample(ResourceHandle resource_handle,
if renumber:
cupy_renumber_map = result.get_renumber_map()
cupy_renumber_map_offsets = result.get_renumber_map_offsets()
cupy_edge_renumber_map = result.get_renumbered_and_sorted_edge_id_renumber_map()
cupy_edge_renumber_map_offsets = result.get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets()
cupy_edge_renumber_map = result.get_edge_renumber_map()
cupy_edge_renumber_map_offsets = result.get_edge_renumber_map_offsets()

sampling_results = {
'major_offsets': cupy_major_offsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ from pylibcugraph._cugraph_c.algorithms cimport (
cugraph_sample_result_get_offsets, # deprecated
cugraph_sample_result_get_renumber_map,
cugraph_sample_result_get_renumber_map_offsets,
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map,
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets,
cugraph_sample_result_get_edge_renumber_map,
cugraph_sample_result_get_edge_renumber_map_offsets,
cugraph_sample_result_free,
)
from pylibcugraph.utils cimport (
Expand Down Expand Up @@ -261,25 +261,25 @@ cdef class SamplingResult:
self)


def get_renumbered_and_sorted_edge_id_renumber_map(self):
def get_edge_renumber_map(self):
if self.c_sample_result_ptr is NULL:
raise ValueError("pointer not set, must call set_ptr() with a "
"non-NULL value first.")
cdef cugraph_type_erased_device_array_view_t* device_array_view_ptr = (
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map(self.c_sample_result_ptr)
cugraph_sample_result_get_edge_renumber_map(self.c_sample_result_ptr)
)
if device_array_view_ptr is NULL:
return None

return create_cupy_array_view_for_device_ptr(device_array_view_ptr,
self)

def get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets(self):
def get_edge_renumber_map_offsets(self):
if self.c_sample_result_ptr is NULL:
raise ValueError("pointer not set, must call set_ptr() with a "
"non-NULL value first.")
cdef cugraph_type_erased_device_array_view_t* device_array_view_ptr = (
cugraph_sample_result_get_renumbered_and_sorted_edge_id_renumber_map_label_type_offsets(self.c_sample_result_ptr)
cugraph_sample_result_get_edge_renumber_map_offsets(self.c_sample_result_ptr)
)
if device_array_view_ptr is NULL:
return None
Expand Down

0 comments on commit c8b5875

Please sign in to comment.