Skip to content

Commit

Permalink
remove outdate arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnke2016 committed Sep 26, 2024
1 parent 73b3ffe commit ea972f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 105 deletions.
56 changes: 4 additions & 52 deletions cpp/include/cugraph_c/sampling_algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,51 +330,12 @@ void cugraph_sampling_options_free(cugraph_sampling_options_t* options);
/**
* @brief Opaque neighborhood sampling heterogeneous fan_out type
*/
typedef struct {
int32_t align_;
} cugraph_sample_heterogeneous_fan_out_t;

/**
* @brief Create heterogeneous fan_out
*
* Input data will be stored in the heterogenous_fan_out.
*
* The fan_out is going to be a CSR structure, the edge_type_offsets will define which range
* of the fan_out array is associated with each edge type, the fan_out will be the values of
* fan_out for that hop/type. So for edge type k, fan_out[edge_type_offsets[k]] will identify
* the fan_out for hop 0 for edge type k. fan_out[edge_type_offsets[k] +1] will identify the
* fan_out for hop 1, etc. edge_type_offsets[k+1] will mark the beginning of the fan_out
* array for type k+1 (and the end of the fan_out array for type k.
*
* @param [in] handle Handle for accessing resources
* @param [in] graph Pointer to graph
* @param [in] edge_type_offsets Type erased array of edge type offsets
* @param [in] fan_out Type erased array of fan_out values
* @param [out] heterogeneous_fan_out Opaque pointer to fan_out_t
* @param [out] error Pointer to an error object storing details of any error. Will
* be populated if error code is not CUGRAPH_SUCCESS
* @return error code
*/
cugraph_error_code_t cugraph_create_heterogeneous_fan_out(
const cugraph_resource_handle_t* handle,
cugraph_graph_t* graph,
const cugraph_type_erased_host_array_view_t* edge_type_offsets,
const cugraph_type_erased_host_array_view_t* fan_out,
cugraph_sample_heterogeneous_fan_out_t** heterogeneous_fan_out,
cugraph_error_t** error);

/**
* @brief Free edge type and fan_out pairs
*
* @param [in] heterogeneous_fan_out The edge type size and fan_out values
*/
void cugraph_heterogeneous_fan_out_free(cugraph_sample_heterogeneous_fan_out_t* heterogeneous_fan_out);

/**
* @brief Uniform Neighborhood Sampling
*
* @deprecated This API will be deleted, use cugraph_homogeneous_neighbor_sample with
* 'is_biased' set to false instead
* @deprecated This API will be deleted, use cugraph_homogeneous_uniform_neighbor_sample
*
* Returns a sample of the neighborhood around specified start vertices. Optionally, each
* start vertex can be associated with a label, allowing the caller to specify multiple batches
Expand Down Expand Up @@ -431,8 +392,7 @@ cugraph_error_code_t cugraph_uniform_neighbor_sample(
/**
* @brief Biased Neighborhood Sampling
*
* @deprecated This API will be deleted, use cugraph_homogeneous_neighbor_sample with
* 'is_biased' set to true instead
* @deprecated This API will be deleted, use cugraph_homogeneous_biased_neighbor_sample.
*
* Returns a sample of the neighborhood around specified start vertices. Optionally, each
* start vertex can be associated with a label, allowing the caller to specify multiple batches
Expand Down Expand Up @@ -516,9 +476,6 @@ cugraph_error_code_t cugraph_biased_neighbor_sample(
* sample.
* @param [in] sampling_options
* Opaque pointer defining the sampling options.
* @param [in] is_biased
* A flag specifying whether to run biased neighborhood sampling
* (if set to true) or uniform neighbor sampling.
* @param [in] do_expensive_check
* A flag to run expensive checks for input arguments (if set to true)
* @param [out] result Output from the uniform_neighbor_sample call
Expand All @@ -533,10 +490,9 @@ cugraph_error_code_t cugraph_heterogeneous_uniform_neighbor_sample(
const cugraph_edge_property_view_t* edge_biases,
const cugraph_type_erased_device_array_view_t* start_vertices,
const cugraph_type_erased_device_array_view_t* start_vertex_offsets,
const cugraph_sample_heterogeneous_fan_out_t* fan_out,
const cugraph_type_erased_device_array_view_t* fan_out,
int num_edge_types,
const cugraph_sampling_options_t* options,
bool_t is_biased,
bool_t do_expensive_check,
cugraph_sample_result_t** result,
cugraph_error_t** error);
Expand Down Expand Up @@ -570,9 +526,6 @@ cugraph_error_code_t cugraph_heterogeneous_uniform_neighbor_sample(
* sample.
* @param [in] sampling_options
* Opaque pointer defining the sampling options.
* @param [in] is_biased
* A flag specifying whether to run biased neighborhood sampling
* (if set to true) or uniform neighbor sampling.
* @param [in] do_expensive_check
* A flag to run expensive checks for input arguments (if set to true)
* @param [out] result Output from the uniform_neighbor_sample call
Expand All @@ -587,10 +540,9 @@ cugraph_error_code_t cugraph_heterogeneous_biased_neighbor_sample(
const cugraph_edge_property_view_t* edge_biases,
const cugraph_type_erased_device_array_view_t* start_vertices,
const cugraph_type_erased_device_array_view_t* start_vertex_offsets,
const cugraph_sample_heterogeneous_fan_out_t* fan_out,
const cugraph_type_erased_device_array_view_t* fan_out,
int num_edge_types,
const cugraph_sampling_options_t* options,
bool_t is_biased,
bool_t do_expensive_check,
cugraph_sample_result_t** result,
cugraph_error_t** error);
Expand Down
26 changes: 0 additions & 26 deletions cpp/src/c_api/neighbor_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include "c_api/neighbor_sampling.hpp"

#include "c_api/abstract_functor.hpp"
#include "c_api/graph.hpp"
Expand Down Expand Up @@ -1860,8 +1859,6 @@ cugraph_error_code_t cugraph_uniform_neighbor_sample(
CUGRAPH_INVALID_INPUT,
"fan_out should be of type int",
*error);

bool is_biased = false;

uniform_neighbor_sampling_functor functor{handle,
graph,
Expand Down Expand Up @@ -1941,8 +1938,6 @@ cugraph_error_code_t cugraph_biased_neighbor_sample(
"fan_out should be of type int",
*error);

bool is_biased = true;

biased_neighbor_sampling_functor functor{handle,
graph,
edge_biases,
Expand Down Expand Up @@ -2125,7 +2120,6 @@ cugraph_error_code_t cugraph_homogeneous_uniform_neighbor_sample(
"vertex type of graph and start_vertices must match",
*error);


neighbor_sampling_functor functor{handle,
rng_state,
graph,
Expand Down Expand Up @@ -2205,23 +2199,3 @@ cugraph_error_code_t cugraph_homogeneous_biased_neighbor_sample(
do_expensive_check};
return cugraph::c_api::run_algorithm(graph, functor, result, error);
}






extern "C" cugraph_error_code_t cugraph_create_heterogeneous_fan_out(
const cugraph_resource_handle_t* handle,
cugraph_graph_t* graph,
const cugraph_type_erased_host_array_view_t* edge_type_offsets,
const cugraph_type_erased_host_array_view_t* fan_out,
cugraph_sample_heterogeneous_fan_out_t** heterogeneous_fan_out,
cugraph_error_t** error)
{
*heterogeneous_fan_out = reinterpret_cast<cugraph_sample_heterogeneous_fan_out_t*> (new std::tuple<cugraph::c_api::cugraph_type_erased_host_array_t *, cugraph::c_api::cugraph_type_erased_host_array_t*> {
new cugraph::c_api::cugraph_type_erased_host_array_t(reinterpret_cast<cugraph::c_api::cugraph_type_erased_host_array_view_t const*>(edge_type_offsets)),
new cugraph::c_api::cugraph_type_erased_host_array_t(reinterpret_cast<cugraph::c_api::cugraph_type_erased_host_array_view_t const*>(fan_out))});

return CUGRAPH_SUCCESS;
}
27 changes: 0 additions & 27 deletions cpp/src/c_api/neighbor_sampling.hpp

This file was deleted.

0 comments on commit ea972f3

Please sign in to comment.