// Generated by scripts/dev/bindings.sh cugraph with bindgen-cli 0.73.2.
// DO NOT EDIT. Run scripts/dev/bindings.sh cugraph to regenerate.
/* automatically generated by rust-bindgen 0.73.2 */
impl cugraph_error_code_ {
pub const CUGRAPH_SUCCESS: cugraph_error_code_ = cugraph_error_code_(0);
pub const CUGRAPH_UNKNOWN_ERROR: cugraph_error_code_ = cugraph_error_code_(1);
pub const CUGRAPH_INVALID_HANDLE: cugraph_error_code_ = cugraph_error_code_(2);
pub const CUGRAPH_ALLOC_ERROR: cugraph_error_code_ = cugraph_error_code_(3);
pub const CUGRAPH_INVALID_INPUT: cugraph_error_code_ = cugraph_error_code_(4);
pub const CUGRAPH_NOT_IMPLEMENTED: cugraph_error_code_ = cugraph_error_code_(5);
pub const CUGRAPH_UNSUPPORTED_TYPE_COMBINATION: cugraph_error_code_ = cugraph_error_code_(6);
pub const CUGRAPH_INVALID_STATE: cugraph_error_code_ = cugraph_error_code_(7);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_error_code_(pub ::std::os::raw::c_uint);
pub use self::cugraph_error_code_ as cugraph_error_code_t;
impl cugraph_allocation_source_ {
pub const CUGRAPH_ALLOCATION_SOURCE_UNKNOWN: cugraph_allocation_source_ = cugraph_allocation_source_(0);
pub const CUGRAPH_ALLOCATION_SOURCE_RMM_OUT_OF_MEMORY: cugraph_allocation_source_ = cugraph_allocation_source_(1);
pub const CUGRAPH_ALLOCATION_SOURCE_RMM_BAD_ALLOC: cugraph_allocation_source_ = cugraph_allocation_source_(2);
pub const CUGRAPH_ALLOCATION_SOURCE_STD_BAD_ALLOC: cugraph_allocation_source_ = cugraph_allocation_source_(3);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_allocation_source_(pub ::std::os::raw::c_uint);
pub use self::cugraph_allocation_source_ as cugraph_allocation_source_t;
impl cugraph_error_failure_source_ {
pub const CUGRAPH_ERROR_FAILURE_SOURCE_PHYSICAL: cugraph_error_failure_source_ = cugraph_error_failure_source_(0);
pub const CUGRAPH_ERROR_FAILURE_SOURCE_RESERVATION_LIMIT: cugraph_error_failure_source_ =
cugraph_error_failure_source_(1);
pub const CUGRAPH_ERROR_FAILURE_SOURCE_UNKNOWN: cugraph_error_failure_source_ = cugraph_error_failure_source_(2);
}
#[repr(transparent)]
#[doc = " @brief Provenance of an allocation failure, when the allocation owner can\n distinguish a logical reservation limit from physical device memory\n pressure.\n\n This is intentionally separate from `cugraph_allocation_source_t`, which\n records the C++ exception type caught at the boundary."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_error_failure_source_(pub ::std::os::raw::c_uint);
#[doc = " @brief Provenance of an allocation failure, when the allocation owner can\n distinguish a logical reservation limit from physical device memory\n pressure.\n\n This is intentionally separate from `cugraph_allocation_source_t`, which\n records the C++ exception type caught at the boundary."]
pub use self::cugraph_error_failure_source_ as cugraph_error_failure_source_t;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_error_ {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_error_"][::std::mem::size_of::<cugraph_error_>() - 4usize];
["Alignment of cugraph_error_"][::std::mem::align_of::<cugraph_error_>() - 4usize];
["Offset of field: cugraph_error_::align_"][::std::mem::offset_of!(cugraph_error_, align_) - 0usize];
};
pub type cugraph_error_t = cugraph_error_;
unsafe extern "C" {
#[doc = " @brief Return an error message\n\n @param [in] error The error object from some cugraph function call\n @return a C-style string that provides detail for the error"]
pub fn cugraph_error_message(error: *const cugraph_error_t) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn cugraph_error_allocation_source(error: *const cugraph_error_t) -> cugraph_allocation_source_t;
}
unsafe extern "C" {
pub fn cugraph_error_failure_source(error: *const cugraph_error_t) -> cugraph_error_failure_source_t;
}
unsafe extern "C" {
pub fn cugraph_error_domain_id(error: *const cugraph_error_t) -> u64;
}
unsafe extern "C" {
pub fn cugraph_error_member_id(error: *const cugraph_error_t) -> u64;
}
unsafe extern "C" {
pub fn cugraph_error_generation(error: *const cugraph_error_t) -> u64;
}
unsafe extern "C" {
pub fn cugraph_error_requested_bytes(error: *const cugraph_error_t) -> u64;
}
unsafe extern "C" {
pub fn cugraph_error_alignment(error: *const cugraph_error_t) -> u64;
}
unsafe extern "C" {
pub fn cugraph_error_cuda_error(error: *const cugraph_error_t) -> i32;
}
unsafe extern "C" {
#[doc = " @brief Destroy an error message\n\n @param [in] error The error object from some cugraph function call"]
pub fn cugraph_error_free(error: *mut cugraph_error_t);
}
impl bool_ {
pub const FALSE: bool_ = bool_(0);
pub const TRUE: bool_ = bool_(1);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct bool_(pub ::std::os::raw::c_uint);
pub use self::bool_ as bool_t;
pub type byte_t = i8;
impl data_type_id_ {
pub const INT8: data_type_id_ = data_type_id_(0);
pub const INT16: data_type_id_ = data_type_id_(1);
pub const INT32: data_type_id_ = data_type_id_(2);
pub const INT64: data_type_id_ = data_type_id_(3);
pub const UINT8: data_type_id_ = data_type_id_(4);
pub const UINT16: data_type_id_ = data_type_id_(5);
pub const UINT32: data_type_id_ = data_type_id_(6);
pub const UINT64: data_type_id_ = data_type_id_(7);
pub const FLOAT32: data_type_id_ = data_type_id_(8);
pub const FLOAT64: data_type_id_ = data_type_id_(9);
pub const SIZE_T: data_type_id_ = data_type_id_(10);
pub const BOOL: data_type_id_ = data_type_id_(11);
pub const NTYPES: data_type_id_ = data_type_id_(12);
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct data_type_id_(pub ::std::os::raw::c_uint);
pub use self::data_type_id_ as cugraph_data_type_id_t;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_resource_handle_ {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_resource_handle_"][::std::mem::size_of::<cugraph_resource_handle_>() - 4usize];
["Alignment of cugraph_resource_handle_"][::std::mem::align_of::<cugraph_resource_handle_>() - 4usize];
["Offset of field: cugraph_resource_handle_::align_"]
[::std::mem::offset_of!(cugraph_resource_handle_, align_) - 0usize];
};
pub type cugraph_resource_handle_t = cugraph_resource_handle_;
unsafe extern "C" {
#[doc = " @brief Construct a resource handle\n\n @param [in] raft_handle Handle for accessing resources\n If NULL, we will create a raft handle\n internally\n\n @return A graph resource handle"]
pub fn cugraph_create_resource_handle(raft_handle: *mut ::std::os::raw::c_void) -> *mut cugraph_resource_handle_t;
}
unsafe extern "C" {
#[doc = " @brief get comm_size from resource handle\n\n If the resource handle has been configured for multi-gpu, this will return\n the comm_size for this cluster. If the resource handle has not been configured for\n multi-gpu this will always return 1.\n\n @param [in] handle Handle for accessing resources\n @return comm_size"]
pub fn cugraph_resource_handle_get_comm_size(handle: *const cugraph_resource_handle_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @brief get rank from resource handle\n\n If the resource handle has been configured for multi-gpu, this will return\n the rank for this worker. If the resource handle has not been configured for\n multi-gpu this will always return 0.\n\n @param [in] handle Handle for accessing resources\n @return rank"]
pub fn cugraph_resource_handle_get_rank(handle: *const cugraph_resource_handle_t) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @brief Free resources in the resource handle\n\n @param [in] handle Handle for accessing resources"]
pub fn cugraph_free_resource_handle(handle: *mut cugraph_resource_handle_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_type_erased_device_array_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_type_erased_device_array_t"]
[::std::mem::size_of::<cugraph_type_erased_device_array_t>() - 4usize];
["Alignment of cugraph_type_erased_device_array_t"]
[::std::mem::align_of::<cugraph_type_erased_device_array_t>() - 4usize];
["Offset of field: cugraph_type_erased_device_array_t::align_"]
[::std::mem::offset_of!(cugraph_type_erased_device_array_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_type_erased_device_array_view_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_type_erased_device_array_view_t"]
[::std::mem::size_of::<cugraph_type_erased_device_array_view_t>() - 4usize];
["Alignment of cugraph_type_erased_device_array_view_t"]
[::std::mem::align_of::<cugraph_type_erased_device_array_view_t>() - 4usize];
["Offset of field: cugraph_type_erased_device_array_view_t::align_"]
[::std::mem::offset_of!(cugraph_type_erased_device_array_view_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_type_erased_host_array_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_type_erased_host_array_t"][::std::mem::size_of::<cugraph_type_erased_host_array_t>() - 4usize];
["Alignment of cugraph_type_erased_host_array_t"]
[::std::mem::align_of::<cugraph_type_erased_host_array_t>() - 4usize];
["Offset of field: cugraph_type_erased_host_array_t::align_"]
[::std::mem::offset_of!(cugraph_type_erased_host_array_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_type_erased_host_array_view_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_type_erased_host_array_view_t"]
[::std::mem::size_of::<cugraph_type_erased_host_array_view_t>() - 4usize];
["Alignment of cugraph_type_erased_host_array_view_t"]
[::std::mem::align_of::<cugraph_type_erased_host_array_view_t>() - 4usize];
["Offset of field: cugraph_type_erased_host_array_view_t::align_"]
[::std::mem::offset_of!(cugraph_type_erased_host_array_view_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Create a type erased device array\n\n @param [in] handle Handle for accessing resources\n @param [in] n_elems The number of elements in the array\n @param [in] dtype The type of array to create\n @param [out] array Pointer to the location to store the pointer to the device array\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_create(
handle: *const cugraph_resource_handle_t,
n_elems: usize,
dtype: cugraph_data_type_id_t,
array: *mut *mut cugraph_type_erased_device_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Create a type erased device array from a view\n\n Copies the data from the view into the new device array\n\n @param [in] handle Handle for accessing resources\n @param [in] view Type erased device array view to copy from\n @param [out] array Pointer to the location to store the pointer to the device array\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_create_from_view(
handle: *const cugraph_resource_handle_t,
view: *const cugraph_type_erased_device_array_view_t,
array: *mut *mut cugraph_type_erased_device_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a type erased device array\n\n @param [in] p Pointer to the type erased device array"]
pub fn cugraph_type_erased_device_array_free(p: *mut cugraph_type_erased_device_array_t);
}
unsafe extern "C" {
#[doc = " @brief Create a type erased device array view from\n a type erased device array\n\n @param [in] array Pointer to the type erased device array\n @return Pointer to the view of the host array"]
pub fn cugraph_type_erased_device_array_view(
array: *mut cugraph_type_erased_device_array_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Create a type erased device array view with a different type\n\n Create a type erased device array view from\n a type erased device array treating the underlying\n pointer as a different type.\n\n Note: This is only viable when the underlying types are the same size. That\n is, you can switch between INT32 and FLOAT32, or between INT64 and FLOAT64.\n But if the types are different sizes this will be an error.\n\n @param [in] array Pointer to the type erased device array\n @param [in] dtype The type to cast the pointer to\n @param [out] result_view Address where to put the allocated device view\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_view_as_type(
array: *mut cugraph_type_erased_device_array_t,
dtype: cugraph_data_type_id_t,
result_view: *mut *mut cugraph_type_erased_device_array_view_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Create a type erased device array view from\n a raw device pointer.\n\n @param [in] pointer Raw device pointer\n @param [in] n_elems The number of elements in the array\n @param [in] dtype The type of array to create\n @return Pointer to the view of the host array"]
pub fn cugraph_type_erased_device_array_view_create(
pointer: *mut ::std::os::raw::c_void,
n_elems: usize,
dtype: cugraph_data_type_id_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a type erased device array view\n\n @param [in] p Pointer to the type erased device array view"]
pub fn cugraph_type_erased_device_array_view_free(p: *mut cugraph_type_erased_device_array_view_t);
}
unsafe extern "C" {
#[doc = " @brief Get the size of a type erased device array view\n\n @param [in] p Pointer to the type erased device array view\n @return The number of elements in the array"]
pub fn cugraph_type_erased_device_array_view_size(p: *const cugraph_type_erased_device_array_view_t) -> usize;
}
unsafe extern "C" {
#[doc = " @brief Get the type of a type erased device array view\n\n @param [in] p Pointer to the type erased device array view\n @return The type of the elements in the array"]
pub fn cugraph_type_erased_device_array_view_type(
p: *const cugraph_type_erased_device_array_view_t,
) -> cugraph_data_type_id_t;
}
unsafe extern "C" {
#[doc = " @brief Get the raw pointer of the type erased device array view\n\n @param [in] p Pointer to the type erased device array view\n @return Pointer (device memory) for the data in the array"]
pub fn cugraph_type_erased_device_array_view_pointer(
p: *const cugraph_type_erased_device_array_view_t,
) -> *const ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " @brief Create a type erased host array\n\n @param [in] handle Handle for accessing resources\n @param [in] n_elems The number of elements in the array\n @param [in] dtype The type of array to create\n @param [out] array Pointer to the location to store the pointer to the host array\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_host_array_create(
handle: *const cugraph_resource_handle_t,
n_elems: usize,
dtype: cugraph_data_type_id_t,
array: *mut *mut cugraph_type_erased_host_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a type erased host array\n\n @param [in] p Pointer to the type erased host array"]
pub fn cugraph_type_erased_host_array_free(p: *mut cugraph_type_erased_host_array_t);
}
unsafe extern "C" {
#[doc = " @brief Create a type erased host array view from\n a type erased host array\n\n @param [in] array Pointer to the type erased host array\n @return Pointer to the view of the host array"]
pub fn cugraph_type_erased_host_array_view(
array: *mut cugraph_type_erased_host_array_t,
) -> *mut cugraph_type_erased_host_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Create a type erased host array view from\n a raw host pointer.\n\n @param [in] pointer Raw host pointer\n @param [in] n_elems The number of elements in the array\n @param [in] dtype The type of array to create\n @return pointer to the view of the host array"]
pub fn cugraph_type_erased_host_array_view_create(
pointer: *mut ::std::os::raw::c_void,
n_elems: usize,
dtype: cugraph_data_type_id_t,
) -> *mut cugraph_type_erased_host_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a type erased host array view\n\n @param [in] p Pointer to the type erased host array view"]
pub fn cugraph_type_erased_host_array_view_free(p: *mut cugraph_type_erased_host_array_view_t);
}
unsafe extern "C" {
#[doc = " @brief Get the size of a type erased host array view\n\n @param [in] p Pointer to the type erased host array view\n @return The number of elements in the array"]
pub fn cugraph_type_erased_host_array_size(p: *const cugraph_type_erased_host_array_view_t) -> usize;
}
unsafe extern "C" {
#[doc = " @brief Get the type of a type erased host array view\n\n @param [in] p Pointer to the type erased host array view\n @return The type of the elements in the array"]
pub fn cugraph_type_erased_host_array_type(
p: *const cugraph_type_erased_host_array_view_t,
) -> cugraph_data_type_id_t;
}
unsafe extern "C" {
#[doc = " @brief Get the raw pointer of the type erased host array view\n\n @param [in] p Pointer to the type erased host array view\n @return Pointer (host memory) for the data in the array"]
pub fn cugraph_type_erased_host_array_pointer(
p: *const cugraph_type_erased_host_array_view_t,
) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " @brief Copy data between two type erased device array views\n\n @param [in] handle Handle for accessing resources\n @param [out] dst Pointer to type erased host array view destination\n @param [in] src Pointer to type erased host array view source\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_host_array_view_copy(
handle: *const cugraph_resource_handle_t,
dst: *mut cugraph_type_erased_host_array_view_t,
src: *const cugraph_type_erased_host_array_view_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Copy data from host to a type erased device array view\n\n @param [in] handle Handle for accessing resources\n @param [out] dst Pointer to the type erased device array view\n @param [in] h_src Pointer to host array to copy into device memory\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_view_copy_from_host(
handle: *const cugraph_resource_handle_t,
dst: *mut cugraph_type_erased_device_array_view_t,
h_src: *const byte_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Copy data from device to a type erased host array\n\n @param [in] handle Handle for accessing resources\n @param [out] h_dst Pointer to host array\n @param [in] src Pointer to the type erased device array view source\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_view_copy_to_host(
handle: *const cugraph_resource_handle_t,
h_dst: *mut byte_t,
src: *const cugraph_type_erased_device_array_view_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Copy data between two type erased device array views\n\n @param [in] handle Handle for accessing resources\n @param [out] dst Pointer to type erased device array view destination\n @param [in] src Pointer to type erased device array view source\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_type_erased_device_array_view_copy(
handle: *const cugraph_resource_handle_t,
dst: *mut cugraph_type_erased_device_array_view_t,
src: *const cugraph_type_erased_device_array_view_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_graph_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_graph_t"][::std::mem::size_of::<cugraph_graph_t>() - 4usize];
["Alignment of cugraph_graph_t"][::std::mem::align_of::<cugraph_graph_t>() - 4usize];
["Offset of field: cugraph_graph_t::align_"][::std::mem::offset_of!(cugraph_graph_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_data_mask_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_data_mask_t"][::std::mem::size_of::<cugraph_data_mask_t>() - 4usize];
["Alignment of cugraph_data_mask_t"][::std::mem::align_of::<cugraph_data_mask_t>() - 4usize];
["Offset of field: cugraph_data_mask_t::align_"][::std::mem::offset_of!(cugraph_data_mask_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_graph_properties_t {
pub is_symmetric: bool_t,
pub is_multigraph: bool_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_graph_properties_t"][::std::mem::size_of::<cugraph_graph_properties_t>() - 8usize];
["Alignment of cugraph_graph_properties_t"][::std::mem::align_of::<cugraph_graph_properties_t>() - 4usize];
["Offset of field: cugraph_graph_properties_t::is_symmetric"]
[::std::mem::offset_of!(cugraph_graph_properties_t, is_symmetric) - 0usize];
["Offset of field: cugraph_graph_properties_t::is_multigraph"]
[::std::mem::offset_of!(cugraph_graph_properties_t, is_multigraph) - 4usize];
};
unsafe extern "C" {
#[doc = " @brief Construct an SG graph\n\n @deprecated Use cugraph_graph_create_with_times_sg instead\n\n @param [in] handle Handle for accessing resources\n @param [in] properties Properties of the constructed graph\n @param [in] vertices Optional device array containing a list of vertex ids\n (specify NULL if we should create vertex ids from the\n unique contents of @p src and @p dst)\n @param [in] src Device array containing the source vertex ids.\n @param [in] dst Device array containing the destination vertex ids\n @param [in] weights Device array containing the edge weights. Note that an unweighted\n graph can be created by passing weights == NULL.\n @param [in] edge_ids Device array containing the edge ids for each edge. Optional\nargument that can be NULL if edge ids are not used.\n @param [in] edge_type_ids Device array containing the edge types for each edge. Optional\nargument that can be NULL if edge types are not used.\n @param [in] store_transposed If true create the graph initially in transposed format\n @param [in] renumber If true, renumber vertices to make an efficient data structure.\n If false, do not renumber. Renumbering enables some significant optimizations within\n the graph primitives library, so it is strongly encouraged. Renumbering is required if\n the vertices are not sequential integer values from 0 to num_vertices.\n @param [in] drop_self_loops If true, drop any self loops that exist in the provided edge list.\n @param [in] drop_multi_edges If true, drop any multi edges that exist in the provided edge list.\n Note that setting this flag will arbitrarily select one instance of a multi edge to be the\n edge that survives. If the edges have properties that should be honored (e.g. sum the\nweights,\n or take the maximum weight), the caller should remove specific edges themselves and not rely\n on this flag.\n @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges\n with edge_ids and/or edge_type_ids is currently not supported.\n @param [in] do_expensive_check If true, do expensive checks to validate the input data\n is consistent with software assumptions. If false bypass these checks.\n @param [out] graph A pointer to the graph object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n\n @return error code"]
pub fn cugraph_graph_create_sg(
handle: *const cugraph_resource_handle_t,
properties: *const cugraph_graph_properties_t,
vertices: *const cugraph_type_erased_device_array_view_t,
src: *const cugraph_type_erased_device_array_view_t,
dst: *const cugraph_type_erased_device_array_view_t,
weights: *const cugraph_type_erased_device_array_view_t,
edge_ids: *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const cugraph_type_erased_device_array_view_t,
store_transposed: bool_t,
renumber: bool_t,
drop_self_loops: bool_t,
drop_multi_edges: bool_t,
symmetrize: bool_t,
do_expensive_check: bool_t,
graph: *mut *mut cugraph_graph_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Construct an SG graph\n\n @param [in] handle Handle for accessing resources\n @param [in] properties Properties of the constructed graph\n @param [in] vertices Optional device array containing a list of vertex ids\n (specify NULL if we should create vertex ids from the\n unique contents of @p src and @p dst)\n @param [in] src Device array containing the source vertex ids.\n @param [in] dst Device array containing the destination vertex ids\n @param [in] weights Device array containing the edge weights. Note that an unweighted\n graph can be created by passing weights == NULL.\n @param [in] edge_ids Device array containing the edge ids for each edge. Optional\nargument that can be NULL if edge ids are not used.\n @param [in] edge_type_ids Device array containing the edge types for each edge. Optional\nargument that can be NULL if edge types are not used.\n @param [in] edge_start_time_ids Device array containing the edge start times for each\n edge. Optional argument that can be NULL if edge start times are not used.\n @param [in] edge_end_time_ids Device array containing the edge end times for each\n edge. Optional argument that can be NULL if edge end times are not used.\n @param [in] store_transposed If true create the graph initially in transposed format\n @param [in] renumber If true, renumber vertices to make an efficient data structure.\n If false, do not renumber. Renumbering enables some significant optimizations within\n the graph primitives library, so it is strongly encouraged. Renumbering is required if\n the vertices are not sequential integer values from 0 to num_vertices.\n @param [in] drop_self_loops If true, drop any self loops that exist in the provided edge list.\n @param [in] drop_multi_edges If true, drop any multi edges that exist in the provided edge list.\n Note that setting this flag will arbitrarily select one instance of a multi edge to be the\n edge that survives. If the edges have properties that should be honored (e.g. sum the\nweights,\n or take the maximum weight), the caller should remove specific edges themselves and not rely\n on this flag.\n @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges\n with edge_ids and/or edge_type_ids is currently not supported.\n @param [in] do_expensive_check If true, do expensive checks to validate the input data\n is consistent with software assumptions. If false bypass these checks.\n @param [out] graph A pointer to the graph object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n\n @return error code"]
pub fn cugraph_graph_create_with_times_sg(
handle: *const cugraph_resource_handle_t,
properties: *const cugraph_graph_properties_t,
vertices: *const cugraph_type_erased_device_array_view_t,
src: *const cugraph_type_erased_device_array_view_t,
dst: *const cugraph_type_erased_device_array_view_t,
weights: *const cugraph_type_erased_device_array_view_t,
edge_ids: *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const cugraph_type_erased_device_array_view_t,
edge_start_time_ids: *const cugraph_type_erased_device_array_view_t,
edge_end_time_ids: *const cugraph_type_erased_device_array_view_t,
store_transposed: bool_t,
renumber: bool_t,
drop_self_loops: bool_t,
drop_multi_edges: bool_t,
symmetrize: bool_t,
do_expensive_check: bool_t,
graph: *mut *mut cugraph_graph_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Construct an SG graph from a CSR input\n\n @param [in] handle Handle for accessing resources\n @param [in] properties Properties of the constructed graph\n @param [in] offsets Device array containing the CSR offsets array\n @param [in] indices Device array containing the destination vertex ids\n @param [in] weights Device array containing the edge weights. Note that an unweighted\n graph can be created by passing weights == NULL.\n @param [in] edge_ids Device array containing the edge ids for each edge. Optional\nargument that can be NULL if edge ids are not used.\n @param [in] edge_type_ids Device array containing the edge types for each edge. Optional\nargument that can be NULL if edge types are not used.\n @param [in] store_transposed If true create the graph initially in transposed format\n @param [in] renumber If true, renumber vertices to make an efficient data structure.\n If false, do not renumber. Renumbering enables some significant optimizations within\n the graph primitives library, so it is strongly encouraged. Renumbering is required if\n the vertices are not sequential integer values from 0 to num_vertices.\n @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges\n with edge_ids and/or edge_type_ids is currently not supported.\n @param [in] do_expensive_check If true, do expensive checks to validate the input data\n is consistent with software assumptions. If false bypass these checks.\n @param [out] graph A pointer to the graph object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n\n @return error code"]
pub fn cugraph_graph_create_sg_from_csr(
handle: *const cugraph_resource_handle_t,
properties: *const cugraph_graph_properties_t,
offsets: *const cugraph_type_erased_device_array_view_t,
indices: *const cugraph_type_erased_device_array_view_t,
weights: *const cugraph_type_erased_device_array_view_t,
edge_ids: *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const cugraph_type_erased_device_array_view_t,
store_transposed: bool_t,
renumber: bool_t,
symmetrize: bool_t,
do_expensive_check: bool_t,
graph: *mut *mut cugraph_graph_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Construct an MG graph\n\n @deprecated Use cugraph_graph_create_with_times_mg instead\n\n @param [in] handle Handle for accessing resources\n @param [in] properties Properties of the constructed graph\n @param [in] vertices List of device arrays containing the unique vertex ids.\n If NULL we will construct this internally using the unique\n entries specified in src and dst\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] src List of device array containing the source vertex ids\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] dst List of device array containing the destination vertex ids\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] weights List of device array containing the edge weights. Note that an\n unweighted graph can be created by passing weights == NULL. If a weighted graph is to be\n created, the weights device array should be created on each rank, but the pointer can be NULL and\n the size 0 if there are no inputs provided by this rank All entries in this list will be\n concatenated on this GPU into a single array.\n @param [in] edge_ids List of device array containing the edge ids for each edge. Optional\n argument that can be NULL if edge ids are not used.\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] edge_type_ids List of device array containing the edge types for each edge.\n Optional argument that can be NULL if edge types are not used. All entries in this list will be\n concatenated on this GPU into a single array.\n @param [in] store_transposed If true create the graph initially in transposed format\n @param [in] num_arrays The number of arrays specified in @p vertices, @p src, @p dst, @p\n weights, @p edge_ids and @p edge_type_ids\n @param [in] drop_self_loops If true, drop any self loops that exist in the provided edge list.\n @param [in] drop_multi_edges If true, drop any multi edges that exist in the provided edge list.\n Note that setting this flag will arbitrarily select one instance of a multi edge to be the\n edge that survives. If the edges have properties that should be honored (e.g. sum the\n weights, or take the maximum weight), the caller should do that on not rely on this flag.\n @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges\n with edge_ids and/or edge_type_ids is currently not supported.\n @param [in] do_expensive_check If true, do expensive checks to validate the input data\n is consistent with software assumptions. If false bypass these checks.\n @param [out] graph A pointer to the graph object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_graph_create_mg(
handle: *const cugraph_resource_handle_t,
properties: *const cugraph_graph_properties_t,
vertices: *const *const cugraph_type_erased_device_array_view_t,
src: *const *const cugraph_type_erased_device_array_view_t,
dst: *const *const cugraph_type_erased_device_array_view_t,
weights: *const *const cugraph_type_erased_device_array_view_t,
edge_ids: *const *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const *const cugraph_type_erased_device_array_view_t,
store_transposed: bool_t,
num_arrays: usize,
drop_self_loops: bool_t,
drop_multi_edges: bool_t,
symmetrize: bool_t,
do_expensive_check: bool_t,
graph: *mut *mut cugraph_graph_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Construct an MG graph\n\n @param [in] handle Handle for accessing resources\n @param [in] properties Properties of the constructed graph\n @param [in] vertices List of device arrays containing the unique vertex ids.\n If NULL we will construct this internally using the unique\n entries specified in src and dst\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] src List of device array containing the source vertex ids\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] dst List of device array containing the destination vertex ids\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] weights List of device array containing the edge weights. Note that an\n unweighted graph can be created by passing weights == NULL. If a weighted graph is to be\n created, the weights device array should be created on each rank, but the pointer can be NULL and\n the size 0 if there are no inputs provided by this rank All entries in this list will be\n concatenated on this GPU into a single array.\n @param [in] edge_ids List of device array containing the edge ids for each edge. Optional\n argument that can be NULL if edge ids are not used.\n All entries in this list will be concatenated on this GPU\n into a single array.\n @param [in] edge_type_ids List of device array containing the edge types for each edge.\n Optional argument that can be NULL if edge types are not used. All entries in this list will be\n concatenated on this GPU into a single array.\n @param [in] edge_type_ids List of device array containing the edge types for each edge.\n Optional argument that can be NULL if edge types are not used. All entries in this list will be\n concatenated on this GPU into a single array.\n @param [in] edge_start_time_ids List of device array containing the edge start times for each\n edge. Optional argument that can be NULL if edge start times are not used. All entries in this\n list will be concatenated on this GPU into a single array.\n @param [in] edge_end_time_ids List of device array containing the edge end times for each\n edge. Optional argument that can be NULL if edge end times are not used. All entries in this list\n will be concatenated on this GPU into a single array.\n @param [in] store_transposed If true create the graph initially in transposed format\n @param [in] num_arrays The number of arrays specified in @p vertices, @p src, @p dst, @p\n weights, @p edge_ids and @p edge_type_ids\n @param [in] drop_self_loops If true, drop any self loops that exist in the provided edge list.\n @param [in] drop_multi_edges If true, drop any multi edges that exist in the provided edge list.\n Note that setting this flag will arbitrarily select one instance of a multi edge to be the\n edge that survives. If the edges have properties that should be honored (e.g. sum the\n weights, or take the maximum weight), the caller should do that on not rely on this flag.\n @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges\n with edge_ids and/or edge_type_ids is currently not supported.\n @param [in] do_expensive_check If true, do expensive checks to validate the input data\n is consistent with software assumptions. If false bypass these checks.\n @param [out] graph A pointer to the graph object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_graph_create_with_times_mg(
handle: *const cugraph_resource_handle_t,
properties: *const cugraph_graph_properties_t,
vertices: *const *const cugraph_type_erased_device_array_view_t,
src: *const *const cugraph_type_erased_device_array_view_t,
dst: *const *const cugraph_type_erased_device_array_view_t,
weights: *const *const cugraph_type_erased_device_array_view_t,
edge_ids: *const *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const *const cugraph_type_erased_device_array_view_t,
edge_start_time_ids: *const *const cugraph_type_erased_device_array_view_t,
edge_end_time_ids: *const *const cugraph_type_erased_device_array_view_t,
store_transposed: bool_t,
num_arrays: usize,
drop_self_loops: bool_t,
drop_multi_edges: bool_t,
symmetrize: bool_t,
do_expensive_check: bool_t,
graph: *mut *mut cugraph_graph_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy an graph\n\n @param [in] graph A pointer to the graph object to destroy"]
pub fn cugraph_graph_free(graph: *mut cugraph_graph_t);
}
unsafe extern "C" {
#[doc = " @brief Create a data mask\n\n @param [in] handle Handle for accessing resources\n @param [in] vertex_bit_mask Device array containing vertex bit mask\n @param [in] edge_bit_mask Device array containing edge bit mask\n @param [in] complement If true, a 0 in one of the bit masks implies\n the vertex/edge should be included and a 1 should\n be excluded. If false a 1 in one of the bit masks\n implies the vertex/edge should be included and a 0\n should be excluded.\n @param [out] mask An opaque pointer to the constructed mask object\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_data_mask_create(
handle: *const cugraph_resource_handle_t,
vertex_bit_mask: *const cugraph_type_erased_device_array_view_t,
edge_bit_mask: *const cugraph_type_erased_device_array_view_t,
complement: bool_t,
mask: *mut *mut cugraph_data_mask_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Get the data mask currently associated with a graph\n\n @param [in] graph The input graph\n @param [out] mask Opaque pointer where we should store the\n current mask. Will be NULL if there is no mask\n currently assigned to the graph.\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_graph_get_data_mask(
graph: *mut cugraph_graph_t,
mask: *mut *mut cugraph_data_mask_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Associate a data mask with a graph\n\n NOTE: This function will fail if there is already a data mask associated with this graph\n\n @param [in] graph The input graph\n @param [out] mask Opaque pointer of the new data mask\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_graph_add_data_mask(
graph: *mut cugraph_graph_t,
mask: *mut cugraph_data_mask_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Release the data mask currently associated with a graph\n\n This function will remove the associated of the current data mask\n with this graph. The caller will be responsible for destroying the data\n mask using graph_data_mask_destroy.\n\n If this function is not called and the graph is destroyed, the act of destroying\n the graph will also destroy the data mask.\n\n If this function is called on a graph that is not currently associated with\n a graph, then the mask will be set to NULL.\n\n @param [in] graph The input graph\n @param [out] mask Opaque pointer where we should store the\n current mask.\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_graph_release_data_mask(
graph: *mut cugraph_graph_t,
mask: *mut *mut cugraph_data_mask_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a data mask\n\n @param [in] mask A pointer to the data mask to destroy"]
pub fn cugraph_data_mask_destroy(mask: *mut cugraph_data_mask_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_rng_state_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_rng_state_t"][::std::mem::size_of::<cugraph_rng_state_t>() - 4usize];
["Alignment of cugraph_rng_state_t"][::std::mem::align_of::<cugraph_rng_state_t>() - 4usize];
["Offset of field: cugraph_rng_state_t::align_"][::std::mem::offset_of!(cugraph_rng_state_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Create a Random Number Generator State\n\n @param [in] seed Initial value for seed. In MG this should be different\n on each GPU\n @param [out] state Pointer to the location to store the pointer to the RngState\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_rng_state_create(
handle: *const cugraph_resource_handle_t,
seed: u64,
state: *mut *mut cugraph_rng_state_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Destroy a Random Number Generator State\n\n @param [in] p Pointer to the Random Number Generator State"]
pub fn cugraph_rng_state_free(p: *mut cugraph_rng_state_t);
}
#[doc = " @brief Opaque centrality result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_centrality_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_centrality_result_t"][::std::mem::size_of::<cugraph_centrality_result_t>() - 4usize];
["Alignment of cugraph_centrality_result_t"][::std::mem::align_of::<cugraph_centrality_result_t>() - 4usize];
["Offset of field: cugraph_centrality_result_t::align_"]
[::std::mem::offset_of!(cugraph_centrality_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the vertex ids from the centrality result\n\n @param [in] result The result from a centrality algorithm\n @return type erased array of vertex ids"]
pub fn cugraph_centrality_result_get_vertices(
result: *mut cugraph_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the centrality values from a centrality algorithm result\n\n @param [in] result The result from a centrality algorithm\n @return type erased array view of centrality values"]
pub fn cugraph_centrality_result_get_values(
result: *mut cugraph_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the number of iterations executed from the algorithm metadata\n\n @param [in] result The result from a centrality algorithm\n @return the number of iterations"]
pub fn cugraph_centrality_result_get_num_iterations(result: *mut cugraph_centrality_result_t) -> usize;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Returns true if the centrality algorithm converged\n\n @param [in] result The result from a centrality algorithm\n @return True if the centrality algorithm converged, false otherwise"]
pub fn cugraph_centrality_result_converged(result: *mut cugraph_centrality_result_t) -> bool_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Free centrality result\n\n @param [in] result The result from a centrality algorithm"]
pub fn cugraph_centrality_result_free(result: *mut cugraph_centrality_result_t);
}
unsafe extern "C" {
#[doc = " @brief Compute pagerank\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] precomputed_vertex_out_weight_vertices\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed.\n @param [in] precomputed_vertex_out_weight_sums\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). Set to NULL if\n no value is passed.\n @param [in] initial_guess_vertices\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed. If NULL, initial PageRank\n values are set to 1.0 divided by the number of vertices in\n the graph.\n @param [in] initial_guess_values\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). Set to NULL if\n no value is passed. If NULL, initial PageRank values are set\n to 1.0 divided by the number of vertices in the graph.\n @param [in] alpha PageRank damping factor.\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in PageRank values between two\n consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon.\n @param [in] max_iterations Maximum number of PageRank iterations.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to pagerank results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_pagerank(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
precomputed_vertex_out_weight_vertices: *const cugraph_type_erased_device_array_view_t,
precomputed_vertex_out_weight_sums: *const cugraph_type_erased_device_array_view_t,
initial_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_guess_values: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute pagerank\n\n @deprecated This version of pagerank should be dropped in favor\n of the cugraph_pagerank_allow_nonconvergence version.\n Eventually that version will be renamed to this version.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] precomputed_vertex_out_weight_vertices\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed.\n @param [in] precomputed_vertex_out_weight_sums\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). Set to NULL if\n no value is passed.\n @param [in] initial_guess_vertices\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed. If NULL, initial PageRank\n values are set to 1.0 divided by the number of vertices in\n the graph.\n @param [in] initial_guess_values\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). Set to NULL if\n no value is passed. If NULL, initial PageRank values are set\n to 1.0 divided by the number of vertices in the graph.\n @param [in] alpha PageRank damping factor.\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in PageRank values between two\n consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon.\n @param [in] max_iterations Maximum number of PageRank iterations.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to pagerank results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_pagerank_allow_nonconvergence(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
precomputed_vertex_out_weight_vertices: *const cugraph_type_erased_device_array_view_t,
precomputed_vertex_out_weight_sums: *const cugraph_type_erased_device_array_view_t,
initial_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_guess_values: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute personalized pagerank\n\n @deprecated This version of personalized pagerank should be dropped in favor\n of the cugraph_personalized_pagerank_allow_nonconvergence version.\n Eventually that version will be renamed to this version.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] precomputed_vertex_out_weight_vertices\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed.\n @param [in] precomputed_vertex_out_weight_sums\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). Set to NULL if\n no value is passed.\n @param [in] initial_guess_vertices\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed. If NULL, initial PageRank\n values are set to 1.0 divided by the number of vertices in\n the graph.\n @param [in] initial_guess_values\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). Set to NULL if\n no value is passed. If NULL, initial PageRank values are set\n to 1.0 divided by the number of vertices in the graph.\n @param [in] personalization_vertices Pointer to an array storing personalization vertex\n identifiers (compute personalized PageRank).\n @param [in] personalization_values Pointer to an array storing personalization values for the\n vertices in the personalization set.\n @param [in] alpha PageRank damping factor.\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in PageRank values between two\n consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon.\n @param [in] max_iterations Maximum number of PageRank iterations.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to pagerank results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_personalized_pagerank(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
precomputed_vertex_out_weight_vertices: *const cugraph_type_erased_device_array_view_t,
precomputed_vertex_out_weight_sums: *const cugraph_type_erased_device_array_view_t,
initial_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_guess_values: *const cugraph_type_erased_device_array_view_t,
personalization_vertices: *const cugraph_type_erased_device_array_view_t,
personalization_values: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute personalized pagerank\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] precomputed_vertex_out_weight_vertices\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed.\n @param [in] precomputed_vertex_out_weight_sums\n Optionally send in precomputed sum of vertex out weights\n (a performance optimization). Set to NULL if\n no value is passed.\n @param [in] initial_guess_vertices\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). This defines the vertices.\n Set to NULL if no value is passed. If NULL, initial PageRank\n values are set to 1.0 divided by the number of vertices in\n the graph.\n @param [in] initial_guess_values\n Optionally send in an initial guess of the pagerank values\n (a performance optimization). Set to NULL if\n no value is passed. If NULL, initial PageRank values are set\n to 1.0 divided by the number of vertices in the graph.\n @param [in] personalization_vertices Pointer to an array storing personalization vertex\n identifiers (compute personalized PageRank).\n @param [in] personalization_values Pointer to an array storing personalization values for the\n vertices in the personalization set.\n @param [in] alpha PageRank damping factor.\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in PageRank values between two\n consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon.\n @param [in] max_iterations Maximum number of PageRank iterations.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to pagerank results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_personalized_pagerank_allow_nonconvergence(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
precomputed_vertex_out_weight_vertices: *const cugraph_type_erased_device_array_view_t,
precomputed_vertex_out_weight_sums: *const cugraph_type_erased_device_array_view_t,
initial_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_guess_values: *const cugraph_type_erased_device_array_view_t,
personalization_vertices: *const cugraph_type_erased_device_array_view_t,
personalization_values: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute eigenvector centrality\n\n Computed using the power method.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] epsilon Error tolerance to check convergence. Convergence is measured\n comparing the L1 norm until it is less than epsilon\n @param [in] max_iterations Maximum number of power iterations, will not exceed this number\n of iterations even if we haven't converged\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to eigenvector centrality results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_eigenvector_centrality(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
pub fn cugraph_eigenvector_centrality_allow_nonconvergence(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute katz centrality\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] betas Optionally send in a device array holding values to be added to\n each vertex's new Katz Centrality score in every iteration.\n If set to NULL then @p beta is used for all vertices.\n @param [in] alpha Katz centrality attenuation factor. This should be smaller\n than the inverse of the maximum eigenvalue of this graph\n @param [in] beta Constant value to be added to each vertex's new Katz\n Centrality score in every iteration. Relevant only when\n @p betas is NULL\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in Katz Centrality values between\n two consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon. (L1-norm)\n @param [in] max_iterations Maximum number of Katz Centrality iterations.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to katz centrality results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_katz_centrality(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
betas: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
beta: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute katz centrality, reporting non-convergence in the result\n\n Takes the arguments of cugraph_katz_centrality. Instead of failing when the iteration does not\n converge within @p max_iterations, it returns a result whose\n cugraph_centrality_result_converged is false and whose values are the last iteration without\n normalization; a diverging iteration (an @p alpha above the inverse of the largest adjacency\n eigenvalue) can leave them non-finite."]
pub fn cugraph_katz_centrality_allow_nonconvergence(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
betas: *const cugraph_type_erased_device_array_view_t,
alpha: f64,
beta: f64,
epsilon: f64,
max_iterations: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute betweenness centrality\n\n Betweenness can be computed exactly by specifying vertex_list as NULL. This will compute\n betweenness centrality by doing a traversal from every source vertex.\n\n Approximate betweenness can be computed specifying a list of vertices that should be\n used as seeds for the traversals. Note that the function cugraph_select_random_vertices can be\n used to create a list of seeds.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_list Optionally specify a device array containing a list of vertices\n to use as seeds for betweenness centrality approximation\n @param [in] normalized Normalize\n @param [in] include_endpoints The traditional formulation of betweenness centrality does not\n include endpoints when considering a vertex to be on a shortest\n path. Setting this to true will consider the endpoints of a\n path to be part of the path.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to betweenness centrality results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_betweenness_centrality(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_list: *const cugraph_type_erased_device_array_view_t,
normalized: bool_t,
include_endpoints: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque edge centrality result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_edge_centrality_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_edge_centrality_result_t"][::std::mem::size_of::<cugraph_edge_centrality_result_t>() - 4usize];
["Alignment of cugraph_edge_centrality_result_t"]
[::std::mem::align_of::<cugraph_edge_centrality_result_t>() - 4usize];
["Offset of field: cugraph_edge_centrality_result_t::align_"]
[::std::mem::offset_of!(cugraph_edge_centrality_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the src vertex ids from an edge centrality result\n\n @param [in] result The result from an edge centrality algorithm\n @return type erased array of src vertex ids"]
pub fn cugraph_edge_centrality_result_get_src_vertices(
result: *mut cugraph_edge_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the dst vertex ids from an edge centrality result\n\n @param [in] result The result from an edge centrality algorithm\n @return type erased array of dst vertex ids"]
pub fn cugraph_edge_centrality_result_get_dst_vertices(
result: *mut cugraph_edge_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the edge ids from an edge centrality result\n\n @param [in] result The result from an edge centrality algorithm\n @return type erased array of edge ids"]
pub fn cugraph_edge_centrality_result_get_edge_ids(
result: *mut cugraph_edge_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the centrality values from an edge centrality algorithm result\n\n @param [in] result The result from an edge centrality algorithm\n @return type erased array view of centrality values"]
pub fn cugraph_edge_centrality_result_get_values(
result: *mut cugraph_edge_centrality_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Free centrality result\n\n @param [in] result The result from a centrality algorithm"]
pub fn cugraph_edge_centrality_result_free(result: *mut cugraph_edge_centrality_result_t);
}
unsafe extern "C" {
#[doc = " @brief Compute edge betweenness centrality\n\n Edge betweenness can be computed exactly by specifying vertex_list as NULL. This will compute\n betweenness centrality by doing a traversal from every vertex and counting the frequency that a\n edge appears on a shortest path.\n\n Approximate betweenness can be computed specifying a list of vertices that should be\n used as seeds for the traversals. Note that the function cugraph_select_random_vertices can be\n used to create a list of seeds.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_list Optionally specify a device array containing a list of vertices\n to use as seeds for betweenness centrality approximation\n @param [in] normalized Normalize\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to edge betweenness centrality results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_edge_betweenness_centrality(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_list: *const cugraph_type_erased_device_array_view_t,
normalized: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_edge_centrality_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque hits result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_hits_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_hits_result_t"][::std::mem::size_of::<cugraph_hits_result_t>() - 4usize];
["Alignment of cugraph_hits_result_t"][::std::mem::align_of::<cugraph_hits_result_t>() - 4usize];
["Offset of field: cugraph_hits_result_t::align_"][::std::mem::offset_of!(cugraph_hits_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the vertex ids from the hits result\n\n @param [in] result The result from hits\n @return type erased array of vertex ids"]
pub fn cugraph_hits_result_get_vertices(
result: *mut cugraph_hits_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the hubs values from the hits result\n\n @param [in] result The result from hits\n @return type erased array of hubs values"]
pub fn cugraph_hits_result_get_hubs(
result: *mut cugraph_hits_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the authorities values from the hits result\n\n @param [in] result The result from hits\n @return type erased array of authorities values"]
pub fn cugraph_hits_result_get_authorities(
result: *mut cugraph_hits_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the score differences between the last two iterations\n\n @param [in] result The result from hits\n @return score differences"]
pub fn cugraph_hits_result_get_hub_score_differences(result: *mut cugraph_hits_result_t) -> f64;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Get the actual number of iterations\n\n @param [in] result The result from hits\n @return actual number of iterations"]
pub fn cugraph_hits_result_get_number_of_iterations(result: *mut cugraph_hits_result_t) -> usize;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Returns true if hits converged\n\n @param [in] result The result from hits\n @return True if hits converged within its maximum iterations, false otherwise"]
pub fn cugraph_hits_result_converged(result: *mut cugraph_hits_result_t) -> bool_t;
}
unsafe extern "C" {
#[doc = " @ingroup centrality\n @brief Free hits result\n\n @param [in] result The result from hits"]
pub fn cugraph_hits_result_free(result: *mut cugraph_hits_result_t);
}
unsafe extern "C" {
#[doc = " @brief Compute hits\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] epsilon Error tolerance to check convergence. Convergence is assumed\n if the sum of the differences in Hits values between two\n consecutive iterations is less than the number of vertices\n in the graph multiplied by @p epsilon.\n @param [in] max_iterations\n Maximum number of Hits iterations.\n @param [in] initial_hubs_guess_vertices\n Pointer to optional type erased device array containing\n the vertex ids for an initial hubs guess. If set to NULL\n there is no initial guess.\n @param [in] initial_hubs_guess_values\n Pointer to optional type erased device array containing\n the values for an initial hubs guess. If set to NULL\n there is no initial guess. Note that both\n @p initial_hubs_guess_vertices and @p initial_hubs_guess_values\n have to be specified (or they both have to be NULL). Otherwise\n this will be treated as an error.\n @param [in] normalize A flag to normalize the results (if set to `true`)\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to hits results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_hits(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
epsilon: f64,
max_iterations: usize,
initial_hubs_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_hubs_guess_values: *const cugraph_type_erased_device_array_view_t,
normalize: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_hits_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute hits, reporting non-convergence in the result\n\n Takes the arguments of cugraph_hits. Instead of failing when the iteration does not converge\n within @p max_iterations, it returns a result whose cugraph_hits_result_converged is false and\n whose scores are those of the last iteration."]
pub fn cugraph_hits_allow_nonconvergence(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
epsilon: f64,
max_iterations: usize,
initial_hubs_guess_vertices: *const cugraph_type_erased_device_array_view_t,
initial_hubs_guess_values: *const cugraph_type_erased_device_array_view_t,
normalize: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_hits_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque vertex pair type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_vertex_pairs_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_vertex_pairs_t"][::std::mem::size_of::<cugraph_vertex_pairs_t>() - 4usize];
["Alignment of cugraph_vertex_pairs_t"][::std::mem::align_of::<cugraph_vertex_pairs_t>() - 4usize];
["Offset of field: cugraph_vertex_pairs_t::align_"]
[::std::mem::offset_of!(cugraph_vertex_pairs_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Create vertex_pairs\n\n Input data will be shuffled to the proper GPU and stored in the\n output vertex_pairs.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Graph to operate on\n @param [in] first Type erased array of vertex ids for the first vertex of the pair\n @param [in] second Type erased array of vertex ids for the second vertex of the pair\n @param [out] vertex_pairs Opaque pointer to vertex_pairs\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_create_vertex_pairs(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
first: *const cugraph_type_erased_device_array_view_t,
second: *const cugraph_type_erased_device_array_view_t,
vertex_pairs: *mut *mut cugraph_vertex_pairs_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Get the first vertex id array\n\n @param [in] vertex_pairs A vertex_pairs\n @return type erased array of vertex ids"]
pub fn cugraph_vertex_pairs_get_first(
vertex_pairs: *mut cugraph_vertex_pairs_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the second vertex id array\n\n @param [in] vertex_pairs A vertex_pairs\n @return type erased array of vertex ids"]
pub fn cugraph_vertex_pairs_get_second(
vertex_pairs: *mut cugraph_vertex_pairs_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Free vertex pair\n\n @param [in] vertex_pairs The vertex pairs"]
pub fn cugraph_vertex_pairs_free(vertex_pairs: *mut cugraph_vertex_pairs_t);
}
unsafe extern "C" {
#[doc = " @brief Find all 2-hop neighbors in the graph\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] start_vertices Optional type erased array of starting vertices\n If NULL use all, if specified compute two-hop\n neighbors for these starting vertices\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque pointer to resulting vertex pairs\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_two_hop_neighbors(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_vertex_pairs_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Verify if a vertex exists in the graph\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertices Vertices to be queried\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque pointer to resulting queried vertices\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_has_vertex(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertices: *mut cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_type_erased_device_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque induced subgraph type\n\n @deprecated This API will be deleted, use cugraph_edgelist_t"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_induced_subgraph_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_induced_subgraph_result_t"][::std::mem::size_of::<cugraph_induced_subgraph_result_t>() - 4usize];
["Alignment of cugraph_induced_subgraph_result_t"]
[::std::mem::align_of::<cugraph_induced_subgraph_result_t>() - 4usize];
["Offset of field: cugraph_induced_subgraph_result_t::align_"]
[::std::mem::offset_of!(cugraph_induced_subgraph_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Get the source vertex ids\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_sources\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of source vertex ids"]
pub fn cugraph_induced_subgraph_get_sources(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the destination vertex ids\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_destinations\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of destination vertex ids"]
pub fn cugraph_induced_subgraph_get_destinations(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge weights\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_edge_weights\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of edge weights"]
pub fn cugraph_induced_subgraph_get_edge_weights(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge ids\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_edge_ids\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of edge ids"]
pub fn cugraph_induced_subgraph_get_edge_ids(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge types\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_edge_type_ids\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of edge types"]
pub fn cugraph_induced_subgraph_get_edge_type_ids(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the subgraph offsets\n\n @deprecated This API will be deleted, use cugraph_edgelist_get_edge_offsets\n\n @param [in] induced_subgraph Opaque pointer to induced subgraph\n @return type erased array view of subgraph identifiers"]
pub fn cugraph_induced_subgraph_get_subgraph_offsets(
induced_subgraph: *mut cugraph_induced_subgraph_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Free induced subgraph\n\n @deprecated This API will be deleted, use cugraph_edgelist_free\n\n @param [in] induced subgraph Opaque pointer to induced subgraph"]
pub fn cugraph_induced_subgraph_result_free(induced_subgraph: *mut cugraph_induced_subgraph_result_t);
}
unsafe extern "C" {
#[doc = " @brief Extract induced subgraph(s)\n\n Given a list of vertex ids, extract a list of edges that represent the subgraph\n containing only the specified vertex ids.\n\n This function will do multiple subgraph extractions concurrently. The vertex ids\n are specified in CSR-style, with @p subgraph_vertices being a list of vertex ids\n and @p subgraph_offsets[i] identifying the start offset for each extracted subgraph\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] subgraph_offsets Type erased array of subgraph offsets into\n @p subgraph_vertices\n @param [in] subgraph_vertices Type erased array of vertices to include in\n extracted subgraph.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to induced subgraph result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_extract_induced_subgraph(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
subgraph_offsets: *const cugraph_type_erased_device_array_view_t,
subgraph_vertices: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_induced_subgraph_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Gather edgelist\n\n This function collects the edgelist from all ranks and stores the combine edgelist\n in each rank\n\n @param [in] handle Handle for accessing resources.\n @param [in] src Device array containing the source vertex ids.\n @param [in] dst Device array containing the destination vertex ids\n @param [in] weights Optional device array containing the edge weights\n @param [in] edge_ids Optional device array containing the edge ids for each edge.\n @param [in] edge_type_ids Optional device array containing the edge types for each edge\n @param [out] result Opaque pointer to gathered edgelist result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_allgather(
handle: *const cugraph_resource_handle_t,
src: *const cugraph_type_erased_device_array_view_t,
dst: *const cugraph_type_erased_device_array_view_t,
weights: *const cugraph_type_erased_device_array_view_t,
edge_ids: *const cugraph_type_erased_device_array_view_t,
edge_type_ids: *const cugraph_type_erased_device_array_view_t,
result: *mut *mut cugraph_induced_subgraph_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Count multi_edges\n\n Count the number of multi-edges in the graph\n\n @param [in] handle Handle for accessing resources.\n @param [in] graph Pointer to graph\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Where to store the count of multi-edges\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_count_multi_edges(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut usize,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque degree result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_degrees_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_degrees_result_t"][::std::mem::size_of::<cugraph_degrees_result_t>() - 4usize];
["Alignment of cugraph_degrees_result_t"][::std::mem::align_of::<cugraph_degrees_result_t>() - 4usize];
["Offset of field: cugraph_degrees_result_t::align_"]
[::std::mem::offset_of!(cugraph_degrees_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Compute in degrees\n\n Compute the in degrees for the vertices in the graph.\n\n @param [in] handle Handle for accessing resources.\n @param [in] graph Pointer to graph\n @param [in] source_vertices Device array of vertices we want to compute in degrees for.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Opaque pointer to degrees result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_in_degrees(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
source_vertices: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_degrees_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute out degrees\n\n Compute the out degrees for the vertices in the graph.\n\n @param [in] handle Handle for accessing resources.\n @param [in] graph Pointer to graph\n @param [in] source_vertices Device array of vertices we want to compute out degrees for.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Opaque pointer to degrees result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_out_degrees(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
source_vertices: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_degrees_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute degrees\n\n Compute the degrees for the vertices in the graph.\n\n @param [in] handle Handle for accessing resources.\n @param [in] graph Pointer to graph\n @param [in] source_vertices Device array of vertices we want to compute degrees for.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Opaque pointer to degrees result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_degrees(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
source_vertices: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_degrees_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Get the vertex ids\n\n @param [in] degrees_result Opaque pointer to degree result\n @return type erased array view of vertex ids"]
pub fn cugraph_degrees_result_get_vertices(
degrees_result: *mut cugraph_degrees_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the in degrees\n\n @param [in] degrees_result Opaque pointer to degree result\n @return type erased array view of vertex ids"]
pub fn cugraph_degrees_result_get_in_degrees(
degrees_result: *mut cugraph_degrees_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the out degrees\n\n If the graph is symmetric, in degrees and out degrees will be equal (and\n will be stored in the same memory).\n\n @param [in] degrees_result Opaque pointer to degree result\n @return type erased array view of vertex ids"]
pub fn cugraph_degrees_result_get_out_degrees(
degrees_result: *mut cugraph_degrees_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Free degree result\n\n @param [in] degrees_result Opaque pointer to degree result"]
pub fn cugraph_degrees_result_free(degrees_result: *mut cugraph_degrees_result_t);
}
#[doc = " @brief Opaque edgelist type\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_edgelist_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_edgelist_t"][::std::mem::size_of::<cugraph_edgelist_t>() - 4usize];
["Alignment of cugraph_edgelist_t"][::std::mem::align_of::<cugraph_edgelist_t>() - 4usize];
["Offset of field: cugraph_edgelist_t::align_"][::std::mem::offset_of!(cugraph_edgelist_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Get the source vertex ids\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of source vertex ids"]
pub fn cugraph_edgelist_get_sources(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the destination vertex ids\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of destination vertex ids"]
pub fn cugraph_edgelist_get_destinations(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge weights\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of edge weights"]
pub fn cugraph_edgelist_get_edge_weights(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge ids\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of edge ids"]
pub fn cugraph_edgelist_get_edge_ids(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge types\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of edge types"]
pub fn cugraph_edgelist_get_edge_type_ids(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge offsets\n\n @param [in] edgelist Opaque pointer to edgelist\n @return type erased array view of subgraph identifiers"]
pub fn cugraph_edgelist_get_edge_offsets(
edgelist: *mut cugraph_edgelist_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Free edgelist\n\n @param [in] edgelist Opaque pointer to edgelist"]
pub fn cugraph_edgelist_free(edgelist: *mut cugraph_edgelist_t);
}
unsafe extern "C" {
#[doc = " @brief Construct the edge list from the graph view object.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Graph to operate on\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Opaque pointer to edgelist\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_decompress_to_edgelist(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_edgelist_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Extract the vertex list from the graph view object.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Graph to operate on\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n true)\n @param [out] result Opaque pointer to vertex list\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_extract_vertex_list(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_type_erased_device_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Renumber arbitrary edgelist\n\n This function is designed to assist renumbering graph vertices in the case where the\n the global vertex id list exceeds the GPU memory. Renumbering is done in-place in the\n supplied @p src and @p dst parameters.\n\n @param [in] handle Handle for accessing resources\n @param [in] renumber_map Host array with the renumber map\n @param [in/out] srcs Device array of src vertices to renumber\n @param [in/out] dsts Device array of dst vertices to renumber\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_renumber_arbitrary_edgelist(
handle: *const cugraph_resource_handle_t,
renumber_map: *const cugraph_type_erased_host_array_view_t,
srcs: *mut cugraph_type_erased_device_array_view_t,
dsts: *mut cugraph_type_erased_device_array_view_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque triangle counting result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_triangle_count_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_triangle_count_result_t"][::std::mem::size_of::<cugraph_triangle_count_result_t>() - 4usize];
["Alignment of cugraph_triangle_count_result_t"]
[::std::mem::align_of::<cugraph_triangle_count_result_t>() - 4usize];
["Offset of field: cugraph_triangle_count_result_t::align_"]
[::std::mem::offset_of!(cugraph_triangle_count_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Triangle Counting\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start Device array of vertices we want to count triangles for. If NULL\n the entire set of vertices in the graph is processed\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the triangle_count call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_triangle_count(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
start: *const cugraph_type_erased_device_array_view_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_triangle_count_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Get triangle counting vertices"]
pub fn cugraph_triangle_count_result_get_vertices(
result: *mut cugraph_triangle_count_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Get triangle counting counts"]
pub fn cugraph_triangle_count_result_get_counts(
result: *mut cugraph_triangle_count_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Free a triangle count result\n\n @param [in] result The result from a sampling algorithm"]
pub fn cugraph_triangle_count_result_free(result: *mut cugraph_triangle_count_result_t);
}
#[doc = " @brief Opaque hierarchical clustering output"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_hierarchical_clustering_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_hierarchical_clustering_result_t"]
[::std::mem::size_of::<cugraph_hierarchical_clustering_result_t>() - 4usize];
["Alignment of cugraph_hierarchical_clustering_result_t"]
[::std::mem::align_of::<cugraph_hierarchical_clustering_result_t>() - 4usize];
["Offset of field: cugraph_hierarchical_clustering_result_t::align_"]
[::std::mem::offset_of!(cugraph_hierarchical_clustering_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Compute Louvain\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] max_level Maximum level in hierarchy\n @param [in] threshold Threshold parameter, defines convergence at each level of hierarchy\n @param [in] resolution Resolution parameter (gamma) in modularity formula.\n This changes the size of the communities. Higher resolutions\n lead to more smaller communities, lower resolutions lead to\n fewer larger communities.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the Louvain call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_louvain(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
max_level: usize,
threshold: f64,
resolution: f64,
do_expensive_check: bool_t,
result: *mut *mut cugraph_hierarchical_clustering_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute Leiden\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] max_level Maximum level in hierarchy\n @param [in] resolution Resolution parameter (gamma) in modularity formula.\n This changes the size of the communities. Higher resolutions\n lead to more smaller communities, lower resolutions lead to\n fewer larger communities.\n @param[in] theta (optional) The value of the parameter to scale modularity\n gain in Leiden refinement phase. It is used to compute\n the probability of joining a random leiden community.\n Called theta in the Leiden algorithm.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the Leiden call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_leiden(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
max_level: usize,
resolution: f64,
theta: f64,
do_expensive_check: bool_t,
result: *mut *mut cugraph_hierarchical_clustering_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Get hierarchical clustering vertices"]
pub fn cugraph_hierarchical_clustering_result_get_vertices(
result: *mut cugraph_hierarchical_clustering_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Get hierarchical clustering clusters"]
pub fn cugraph_hierarchical_clustering_result_get_clusters(
result: *mut cugraph_hierarchical_clustering_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Get modularity"]
pub fn cugraph_hierarchical_clustering_result_get_modularity(
result: *mut cugraph_hierarchical_clustering_result_t,
) -> f64;
}
unsafe extern "C" {
#[doc = " @ingroup community\n @brief Free a hierarchical clustering result\n\n @param [in] result The result from a sampling algorithm"]
pub fn cugraph_hierarchical_clustering_result_free(result: *mut cugraph_hierarchical_clustering_result_t);
}
unsafe extern "C" {
#[doc = " @brief Compute ECG clustering\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] min_weight Minimum edge weight in final graph\n @param [in] ensemble_size The number of Louvain iterations to run\n @param [in] max_level Maximum level in hierarchy for final Louvain\n @param [in] threshold Threshold parameter, defines convergence at each level of hierarchy\n for final Louvain\n @param [in] resolution Resolution parameter (gamma) in modularity formula.\n This changes the size of the communities. Higher resolutions\n lead to more smaller communities, lower resolutions lead to\n fewer larger communities.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the Louvain call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_ecg(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
min_weight: f64,
ensemble_size: usize,
max_level: usize,
threshold: f64,
resolution: f64,
do_expensive_check: bool_t,
result: *mut *mut cugraph_hierarchical_clustering_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Extract ego graphs\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] source_vertices Device array of vertices we want to extract egonets for.\n @param [in] radius The number of hops to go out from each source vertex\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque object containing the extracted subgraph\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_extract_ego(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
source_vertices: *const cugraph_type_erased_device_array_view_t,
radius: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_induced_subgraph_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Extract k truss for a graph\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] k The order of the truss\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque object containing the extracted subgraph\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_k_truss_subgraph(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
k: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_induced_subgraph_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque clustering output"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_clustering_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_clustering_result_t"][::std::mem::size_of::<cugraph_clustering_result_t>() - 4usize];
["Alignment of cugraph_clustering_result_t"][::std::mem::align_of::<cugraph_clustering_result_t>() - 4usize];
["Offset of field: cugraph_clustering_result_t::align_"]
[::std::mem::offset_of!(cugraph_clustering_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Balanced cut clustering\n\n @deprecated This function is deprecated and will be removed in a future release.\n Use cugraph_spectral_clustering (spectral modularity maximization) instead.\n\n NOTE: This currently wraps the legacy balanced cut clustering implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] n_clusters The desired number of clusters\n @param [in] n_eigenvectors The number of eigenvectors to use\n @param [in] evs_tolerance The tolerance to use for the eigenvalue solver\n @param [in] evs_max_iterations The maximum number of iterations of the eigenvalue solver\n @param [in] k_means_tolerance The tolerance to use for the k-means solver\n @param [in] k_means_max_iterations The maximum number of iterations of the k-means solver\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque object containing the clustering result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_balanced_cut_clustering(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
n_clusters: usize,
n_eigenvectors: usize,
evs_tolerance: f64,
evs_max_iterations: ::std::os::raw::c_int,
k_means_tolerance: f64,
k_means_max_iterations: ::std::os::raw::c_int,
do_expensive_check: bool_t,
result: *mut *mut cugraph_clustering_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Spectral clustering\n\n NOTE: This currently wraps the legacy spectral clustering implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] n_clusters The desired number of clusters\n @param [in] n_eigenvectors The number of eigenvectors to use\n @param [in] evs_tolerance The tolerance to use for the eigenvalue solver\n @param [in] evs_max_iterations The maximum number of iterations of the eigenvalue solver\n @param [in] k_means_tolerance The tolerance to use for the k-means solver\n @param [in] k_means_max_iterations The maximum number of iterations of the k-means solver\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque object containing the clustering result\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_spectral_modularity_maximization(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
n_clusters: usize,
n_eigenvectors: usize,
evs_tolerance: f64,
evs_max_iterations: ::std::os::raw::c_int,
k_means_tolerance: f64,
k_means_max_iterations: ::std::os::raw::c_int,
do_expensive_check: bool_t,
result: *mut *mut cugraph_clustering_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute modularity of the specified clustering\n\n NOTE: This currently wraps the legacy spectral modularity implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] n_clusters The desired number of clusters\n @param [in] vertices Vertex ids from the clustering result\n @param [in] clusters Cluster ids from the clustering result\n @param [out] score The modularity score for this clustering\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_analyze_clustering_modularity(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
n_clusters: usize,
vertices: *const cugraph_type_erased_device_array_view_t,
clusters: *const cugraph_type_erased_device_array_view_t,
score: *mut f64,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute edge cut of the specified clustering\n\n NOTE: This currently wraps the legacy spectral edge cut implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] n_clusters The desired number of clusters\n @param [in] vertices Vertex ids from the clustering result\n @param [in] clusters Cluster ids from the clustering result\n @param [out] score The edge cut score for this clustering\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_analyze_clustering_edge_cut(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
n_clusters: usize,
vertices: *const cugraph_type_erased_device_array_view_t,
clusters: *const cugraph_type_erased_device_array_view_t,
score: *mut f64,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute ratio cut of the specified clustering\n\n NOTE: This currently wraps the legacy spectral ratio cut implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] n_clusters The desired number of clusters\n @param [in] vertices Vertex ids from the clustering result\n @param [in] clusters Cluster ids from the clustering result\n @param [out] score The ratio cut score for this clustering\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_analyze_clustering_ratio_cut(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
n_clusters: usize,
vertices: *const cugraph_type_erased_device_array_view_t,
clusters: *const cugraph_type_erased_device_array_view_t,
score: *mut f64,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Get clustering vertices"]
pub fn cugraph_clustering_result_get_vertices(
result: *mut cugraph_clustering_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get clustering clusters"]
pub fn cugraph_clustering_result_get_clusters(
result: *mut cugraph_clustering_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Free a clustering result\n\n @param [in] result The result from a sampling algorithm"]
pub fn cugraph_clustering_result_free(result: *mut cugraph_clustering_result_t);
}
#[doc = " @brief Opaque core number result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_core_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_core_result_t"][::std::mem::size_of::<cugraph_core_result_t>() - 4usize];
["Alignment of cugraph_core_result_t"][::std::mem::align_of::<cugraph_core_result_t>() - 4usize];
["Offset of field: cugraph_core_result_t::align_"][::std::mem::offset_of!(cugraph_core_result_t, align_) - 0usize];
};
#[doc = " @brief Opaque k-core result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_k_core_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_k_core_result_t"][::std::mem::size_of::<cugraph_k_core_result_t>() - 4usize];
["Alignment of cugraph_k_core_result_t"][::std::mem::align_of::<cugraph_k_core_result_t>() - 4usize];
["Offset of field: cugraph_k_core_result_t::align_"]
[::std::mem::offset_of!(cugraph_k_core_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Create a core_number result (in case it was previously extracted)\n\n @param [in] handle Handle for accessing resources\n @param [in] vertices The result from core number\n @param [in] core_numbers The result from core number\n @param [out] result Opaque pointer to core number results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_core_result_create(
handle: *const cugraph_resource_handle_t,
vertices: *mut cugraph_type_erased_device_array_view_t,
core_numbers: *mut cugraph_type_erased_device_array_view_t,
core_result: *mut *mut cugraph_core_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Get the vertex ids from the core result\n\n @param [in] result The result from core number\n @return type erased array of vertex ids"]
pub fn cugraph_core_result_get_vertices(
result: *mut cugraph_core_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Get the core numbers from the core result\n\n @param [in] result The result from core number\n @return type erased array of core numbers"]
pub fn cugraph_core_result_get_core_numbers(
result: *mut cugraph_core_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Free core result\n\n @param [in] result The result from core number"]
pub fn cugraph_core_result_free(result: *mut cugraph_core_result_t);
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Get the src vertex ids from the k-core result\n\n @param [in] result The result from k-core\n @return type erased array of src vertex ids"]
pub fn cugraph_k_core_result_get_src_vertices(
result: *mut cugraph_k_core_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Get the dst vertex ids from the k-core result\n\n @param [in] result The result from k-core\n @return type erased array of dst vertex ids"]
pub fn cugraph_k_core_result_get_dst_vertices(
result: *mut cugraph_k_core_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Get the weights from the k-core result\n\n Returns NULL if the graph is unweighted\n\n @param [in] result The result from k-core\n @return type erased array of weights"]
pub fn cugraph_k_core_result_get_weights(
result: *mut cugraph_k_core_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup core\n @brief Free k-core result\n\n @param [in] result The result from k-core"]
pub fn cugraph_k_core_result_free(result: *mut cugraph_k_core_result_t);
}
pub const cugraph_k_core_degree_type_t_K_CORE_DEGREE_TYPE_IN: cugraph_k_core_degree_type_t = 0;
#[doc = " Compute core_number using incoming edges"]
pub const cugraph_k_core_degree_type_t_K_CORE_DEGREE_TYPE_OUT: cugraph_k_core_degree_type_t = 1;
#[doc = " Compute core_number using outgoing edges"]
pub const cugraph_k_core_degree_type_t_K_CORE_DEGREE_TYPE_INOUT: cugraph_k_core_degree_type_t = 2;
#[doc = " @ingroup core\n @brief Enumeration for computing core number"]
pub type cugraph_k_core_degree_type_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Perform core number.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] degree_type Compute core_number using in, out or both in and out edges\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to core number results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_core_number(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
degree_type: cugraph_k_core_degree_type_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_core_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform k_core using output from core_number\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] k The value of k to use\n @param [in] degree_type Compute core_number using in, out or both in and out edges.\n Ignored if core_result is specified.\n @param [in] core_result Result from calling cugraph_core_number, if NULL then\n call core_number inside this function call.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to k_core results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_k_core(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
k: usize,
degree_type: cugraph_k_core_degree_type_t,
core_result: *const cugraph_core_result_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_k_core_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque labeling result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_labeling_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_labeling_result_t"][::std::mem::size_of::<cugraph_labeling_result_t>() - 4usize];
["Alignment of cugraph_labeling_result_t"][::std::mem::align_of::<cugraph_labeling_result_t>() - 4usize];
["Offset of field: cugraph_labeling_result_t::align_"]
[::std::mem::offset_of!(cugraph_labeling_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup labeling\n @brief Get the vertex ids from the labeling result\n\n @param [in] result The result from a labeling algorithm\n @return type erased array of vertex ids"]
pub fn cugraph_labeling_result_get_vertices(
result: *mut cugraph_labeling_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup labeling\n @brief Get the label values from the labeling result\n\n @param [in] result The result from a labeling algorithm\n @return type erased array of label values"]
pub fn cugraph_labeling_result_get_labels(
result: *mut cugraph_labeling_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup labeling\n @brief Free labeling result\n\n @param [in] result The result from a labeling algorithm"]
pub fn cugraph_labeling_result_free(result: *mut cugraph_labeling_result_t);
}
unsafe extern "C" {
#[doc = " @brief Labels each vertex in the input graph with its (weakly-connected-)component ID\n\n The input graph must be symmetric. Component IDs can be arbitrary integers (they can be\n non-consecutive and are not ordered by component size or any other criterion).\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to labeling results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_weakly_connected_components(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_labeling_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Labels each vertex in the input graph with its (strongly-connected-)component ID\n\n The input graph may be asymmetric. Component IDs can be arbitrary integers (they can be\n non-consecutive and are not ordered by component size or any other criterion).\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to labeling results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_strongly_connected_components(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_labeling_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque src-dst lookup container type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_lookup_container_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_lookup_container_t"][::std::mem::size_of::<cugraph_lookup_container_t>() - 4usize];
["Alignment of cugraph_lookup_container_t"][::std::mem::align_of::<cugraph_lookup_container_t>() - 4usize];
["Offset of field: cugraph_lookup_container_t::align_"]
[::std::mem::offset_of!(cugraph_lookup_container_t, align_) - 0usize];
};
#[doc = " @brief Opaque src-dst lookup result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_lookup_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_lookup_result_t"][::std::mem::size_of::<cugraph_lookup_result_t>() - 4usize];
["Alignment of cugraph_lookup_result_t"][::std::mem::align_of::<cugraph_lookup_result_t>() - 4usize];
["Offset of field: cugraph_lookup_result_t::align_"]
[::std::mem::offset_of!(cugraph_lookup_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Build map to lookup source and destination using edge id and type\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [out] lookup_container Lookup map\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_build_edge_id_and_type_to_src_dst_lookup_map(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
lookup_container: *mut *mut cugraph_lookup_container_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Lookup edge sources and destinations using edge ids and a single edge type.\n\n Use this function to lookup endpoints of edges belonging to the same edge type.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] lookup_container Lookup map\n @param[in] edge_ids_to_lookup Edge ids to lookup\n @param[in] edge_type_to_lookup Edge types corresponding to edge ids in @p edge_ids_to_lookup\n @param [out] result Output from the lookup call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_lookup_endpoints_from_edge_ids_and_single_type(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
lookup_container: *const cugraph_lookup_container_t,
edge_ids_to_lookup: *const cugraph_type_erased_device_array_view_t,
edge_type_to_lookup: ::std::os::raw::c_int,
result: *mut *mut cugraph_lookup_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Lookup edge sources and destinations using edge ids and edge types.\n\n Use this function to lookup endpoints of edges belonging to different edge types.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] lookup_container Lookup map\n @param[in] edge_ids_to_lookup Edge ids to lookup\n @param[in] edge_types_to_lookup Edge types corresponding to the edge ids in @p\n edge_ids_to_lookup\n @param [out] result Output from the lookup call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_lookup_endpoints_from_edge_ids_and_types(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
lookup_container: *const cugraph_lookup_container_t,
edge_ids_to_lookup: *const cugraph_type_erased_device_array_view_t,
edge_types_to_lookup: *const cugraph_type_erased_device_array_view_t,
result: *mut *mut cugraph_lookup_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge sources from the lookup result\n\n @param [in] result The result from src-dst lookup using edge ids and type(s)\n @return type erased array pointing to the edge sources"]
pub fn cugraph_lookup_result_get_srcs(
result: *const cugraph_lookup_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge destinations from the lookup result\n\n @param [in] result The result from src-dst lookup using edge ids and type(s)\n @return type erased array pointing to the edge destinations"]
pub fn cugraph_lookup_result_get_dsts(
result: *const cugraph_lookup_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Free a src-dst lookup result\n\n @param [in] result The result from src-dst lookup using edge ids and type(s)"]
pub fn cugraph_lookup_result_free(result: *mut cugraph_lookup_result_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Free a sampling lookup map\n\n @param [in] container The sampling lookup map (a.k.a. container)."]
pub fn cugraph_lookup_container_free(container: *mut cugraph_lookup_container_t);
}
#[doc = " @brief Opaque COO definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_coo_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_coo_t"][::std::mem::size_of::<cugraph_coo_t>() - 4usize];
["Alignment of cugraph_coo_t"][::std::mem::align_of::<cugraph_coo_t>() - 4usize];
["Offset of field: cugraph_coo_t::align_"][::std::mem::offset_of!(cugraph_coo_t, align_) - 0usize];
};
#[doc = " @brief Opaque COO list definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_coo_list_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_coo_list_t"][::std::mem::size_of::<cugraph_coo_list_t>() - 4usize];
["Alignment of cugraph_coo_list_t"][::std::mem::align_of::<cugraph_coo_list_t>() - 4usize];
["Offset of field: cugraph_coo_list_t::align_"][::std::mem::offset_of!(cugraph_coo_list_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Get the source vertex ids\n\n @param [in] coo Opaque pointer to COO\n @return type erased array view of source vertex ids"]
pub fn cugraph_coo_get_sources(coo: *mut cugraph_coo_t) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the destination vertex ids\n\n @param [in] coo Opaque pointer to COO\n @return type erased array view of destination vertex ids"]
pub fn cugraph_coo_get_destinations(coo: *mut cugraph_coo_t) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge weights\n\n @param [in] coo Opaque pointer to COO\n @return type erased array view of edge weights, NULL if no edge weights in COO"]
pub fn cugraph_coo_get_edge_weights(coo: *mut cugraph_coo_t) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge id\n\n @param [in] coo Opaque pointer to COO\n @return type erased array view of edge id, NULL if no edge ids in COO"]
pub fn cugraph_coo_get_edge_id(coo: *mut cugraph_coo_t) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the edge type\n\n @param [in] coo Opaque pointer to COO\n @return type erased array view of edge type, NULL if no edge types in COO"]
pub fn cugraph_coo_get_edge_type(coo: *mut cugraph_coo_t) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @brief Get the number of coo object in the list\n\n @param [in] coo_list Opaque pointer to COO list\n @return number of elements"]
pub fn cugraph_coo_list_size(coo_list: *const cugraph_coo_list_t) -> usize;
}
unsafe extern "C" {
#[doc = " @brief Get a COO from the list\n\n @param [in] coo_list Opaque pointer to COO list\n @param [in] index Index of desired COO from list\n @return a cugraph_coo_t* object from the list"]
pub fn cugraph_coo_list_element(coo_list: *mut cugraph_coo_list_t, index: usize) -> *mut cugraph_coo_t;
}
unsafe extern "C" {
#[doc = " @brief Free coo object\n\n @param [in] coo Opaque pointer to COO"]
pub fn cugraph_coo_free(coo: *mut cugraph_coo_t);
}
unsafe extern "C" {
#[doc = " @brief Free coo list\n\n @param [in] coo_list Opaque pointer to list of COO objects"]
pub fn cugraph_coo_list_free(coo_list: *mut cugraph_coo_list_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_vertex_property_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_vertex_property_t"][::std::mem::size_of::<cugraph_vertex_property_t>() - 4usize];
["Alignment of cugraph_vertex_property_t"][::std::mem::align_of::<cugraph_vertex_property_t>() - 4usize];
["Offset of field: cugraph_vertex_property_t::align_"]
[::std::mem::offset_of!(cugraph_vertex_property_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_edge_property_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_edge_property_t"][::std::mem::size_of::<cugraph_edge_property_t>() - 4usize];
["Alignment of cugraph_edge_property_t"][::std::mem::align_of::<cugraph_edge_property_t>() - 4usize];
["Offset of field: cugraph_edge_property_t::align_"]
[::std::mem::offset_of!(cugraph_edge_property_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_vertex_property_view_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_vertex_property_view_t"][::std::mem::size_of::<cugraph_vertex_property_view_t>() - 4usize];
["Alignment of cugraph_vertex_property_view_t"][::std::mem::align_of::<cugraph_vertex_property_view_t>() - 4usize];
["Offset of field: cugraph_vertex_property_view_t::align_"]
[::std::mem::offset_of!(cugraph_vertex_property_view_t, align_) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_edge_property_view_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_edge_property_view_t"][::std::mem::size_of::<cugraph_edge_property_view_t>() - 4usize];
["Alignment of cugraph_edge_property_view_t"][::std::mem::align_of::<cugraph_edge_property_view_t>() - 4usize];
["Offset of field: cugraph_edge_property_view_t::align_"]
[::std::mem::offset_of!(cugraph_edge_property_view_t, align_) - 0usize];
};
#[doc = " @brief Opaque random walk result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_random_walk_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_random_walk_result_t"][::std::mem::size_of::<cugraph_random_walk_result_t>() - 4usize];
["Alignment of cugraph_random_walk_result_t"][::std::mem::align_of::<cugraph_random_walk_result_t>() - 4usize];
["Offset of field: cugraph_random_walk_result_t::align_"]
[::std::mem::offset_of!(cugraph_random_walk_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Compute uniform random walks\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start_vertices Array of source vertices\n @param [in] max_length Maximum length of the generated path\n @param [out] result Output from the node2vec call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_uniform_random_walks(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
max_length: usize,
result: *mut *mut cugraph_random_walk_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute biased random walks\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start_vertices Array of source vertices\n @param [in] max_length Maximum length of the generated path\n @param [out] result Output from the node2vec call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_biased_random_walks(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
max_length: usize,
result: *mut *mut cugraph_random_walk_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Compute random walks using the node2vec framework.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start_vertices Array of source vertices\n @param [in] max_length Maximum length of the generated path\n @param [in] compress_result If true, return the paths as a compressed sparse row matrix,\n otherwise return as a dense matrix\n @param [in] p The return parameter\n @param [in] q The in/out parameter\n @param [out] result Output from the node2vec call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_node2vec_random_walks(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
max_length: usize,
p: f64,
q: f64,
result: *mut *mut cugraph_random_walk_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the max path length from random walk result\n\n @param [in] result The result from random walks\n @return maximum path length"]
pub fn cugraph_random_walk_result_get_max_path_length(result: *mut cugraph_random_walk_result_t) -> usize;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the matrix (row major order) of vertices in the paths\n\n @param [in] result The result from a random walk algorithm\n @return type erased array pointing to the path matrix in device memory"]
pub fn cugraph_random_walk_result_get_paths(
result: *mut cugraph_random_walk_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the matrix (row major order) of edge weights in the paths\n\n @param [in] result The result from a random walk algorithm\n @return type erased array pointing to the path edge weights in device memory"]
pub fn cugraph_random_walk_result_get_weights(
result: *mut cugraph_random_walk_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief If the random walk result is compressed, get the path sizes\n @deprecated This call will no longer be relevant once the new node2vec are called\n\n @param [in] result The result from a random walk algorithm\n @return type erased array pointing to the path sizes in device memory"]
pub fn cugraph_random_walk_result_get_path_sizes(
result: *mut cugraph_random_walk_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Free random walks result\n\n @param [in] result The result from random walks"]
pub fn cugraph_random_walk_result_free(result: *mut cugraph_random_walk_result_t);
}
#[doc = " @brief Opaque neighborhood sampling result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_sample_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_sample_result_t"][::std::mem::size_of::<cugraph_sample_result_t>() - 4usize];
["Alignment of cugraph_sample_result_t"][::std::mem::align_of::<cugraph_sample_result_t>() - 4usize];
["Offset of field: cugraph_sample_result_t::align_"]
[::std::mem::offset_of!(cugraph_sample_result_t, align_) - 0usize];
};
#[doc = " @brief Opaque sampling options type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_sampling_options_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_sampling_options_t"][::std::mem::size_of::<cugraph_sampling_options_t>() - 4usize];
["Alignment of cugraph_sampling_options_t"][::std::mem::align_of::<cugraph_sampling_options_t>() - 4usize];
["Offset of field: cugraph_sampling_options_t::align_"]
[::std::mem::offset_of!(cugraph_sampling_options_t, align_) - 0usize];
};
pub const cugraph_prior_sources_behavior_t_DEFAULT: cugraph_prior_sources_behavior_t = 0;
#[doc = " Construct sources for hop k from destination vertices from hop k-1"]
pub const cugraph_prior_sources_behavior_t_CARRY_OVER: cugraph_prior_sources_behavior_t = 1;
#[doc = " Construct sources for hop k from destination vertices from hop k-1\nand sources from hop k-1"]
pub const cugraph_prior_sources_behavior_t_EXCLUDE: cugraph_prior_sources_behavior_t = 2;
#[doc = " @brief Enumeration for prior sources behavior"]
pub type cugraph_prior_sources_behavior_t = ::std::os::raw::c_uint;
pub const cugraph_temporal_sampling_comparison_t_STRICTLY_INCREASING: cugraph_temporal_sampling_comparison_t = 0;
#[doc = " Time strictly increasing (each time is after the previous one)"]
pub const cugraph_temporal_sampling_comparison_t_MONOTONICALLY_INCREASING: cugraph_temporal_sampling_comparison_t = 1;
#[doc = " Time monotonically increasing (could have multiple edges with same\ntime)"]
pub const cugraph_temporal_sampling_comparison_t_STRICTLY_DECREASING: cugraph_temporal_sampling_comparison_t = 2;
#[doc = " Time strictly decreasing (each time is before the previous one)"]
pub const cugraph_temporal_sampling_comparison_t_MONOTONICALLY_DECREASING: cugraph_temporal_sampling_comparison_t = 3;
#[doc = " Time monotonically decreasing (could have multiple edges with same\ntime)"]
pub const cugraph_temporal_sampling_comparison_t_LAST: cugraph_temporal_sampling_comparison_t = 4;
#[doc = " @brief Enumeration for temporal comparison options"]
pub type cugraph_temporal_sampling_comparison_t = ::std::os::raw::c_uint;
pub const cugraph_compression_type_t_COO: cugraph_compression_type_t = 0;
#[doc = " Outputs in COO format. Default."]
pub const cugraph_compression_type_t_CSR: cugraph_compression_type_t = 1;
#[doc = " Compresses in CSR format. This means the row (src) column\nis compressed into a row pointer."]
pub const cugraph_compression_type_t_CSC: cugraph_compression_type_t = 2;
#[doc = " Compresses in CSC format. This means the col (dst) column\nis compressed into a column pointer."]
pub const cugraph_compression_type_t_DCSR: cugraph_compression_type_t = 3;
#[doc = " Compresses in DCSR format. This outputs an additional index\nthat avoids empty entries in the row pointer."]
pub const cugraph_compression_type_t_DCSC: cugraph_compression_type_t = 4;
#[doc = " @brief Selects the type of compression to use for the output samples."]
pub type cugraph_compression_type_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Create sampling options object\n\n All sampling options set to FALSE\n\n @param [out] options Opaque pointer to the sampling options\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_sampling_options_create(
options: *mut *mut cugraph_sampling_options_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to retain seeds (original sources)\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_retain_seeds(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to renumber results\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_renumber_results(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set whether to compress per-hop (True) or globally (False)\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_compress_per_hop(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to sample with_replacement\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_with_replacement(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to sample return_hops\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_return_hops(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set compression type\n\n @param options - opaque pointer to the sampling options\n @param value - Enum defining the compresion type"]
pub fn cugraph_sampling_set_compression_type(
options: *mut cugraph_sampling_options_t,
value: cugraph_compression_type_t,
);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set prior sources behavior\n\n @param options - opaque pointer to the sampling options\n @param value - Enum defining prior sources behavior"]
pub fn cugraph_sampling_set_prior_sources_behavior(
options: *mut cugraph_sampling_options_t,
value: cugraph_prior_sources_behavior_t,
);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to sample dedupe_sources prior to sampling\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_dedupe_sources(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set temporal sampling to use associated comparision.\n\n @param options - opaque pointer to the sampling options\n @param comparison - Comparison value to assign to the option"]
pub fn cugraph_sampling_set_temporal_sampling_comparison(
options: *mut cugraph_sampling_options_t,
comparison: cugraph_temporal_sampling_comparison_t,
);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Set flag to perform disjoint sampling\n\n Note: This flag is not supported in the current implementation.\n\n @param options - opaque pointer to the sampling options\n @param value - Boolean value to assign to the option"]
pub fn cugraph_sampling_set_disjoint_sampling(options: *mut cugraph_sampling_options_t, value: bool_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Free sampling options object\n\n @param [in] options Opaque pointer to sampling object"]
pub fn cugraph_sampling_options_free(options: *mut cugraph_sampling_options_t);
}
unsafe extern "C" {
#[doc = " @brief Homogeneous Uniform Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n * @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_homogeneous_uniform_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Homogeneous Biased Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n * @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] edge_biases Device array of edge biases to use for sampling. If NULL\n use the edge weight as the bias. If set to NULL, edges will be sampled uniformly.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_homogeneous_biased_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
edge_biases: *const cugraph_edge_property_view_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Heterogeneous Uniform Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n * @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] vertex_type_offsets Device array of the offsets for each vertex type in the\n graph.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] num_edge_types Number of edge types where a value of 1 translates to homogeneous\n neighbor sample whereas a value greater than 1 translates to heterogeneous neighbor sample.\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_heterogeneous_uniform_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
vertex_type_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
num_edge_types: ::std::os::raw::c_int,
options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Heterogeneous Biased Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n * @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] edge_biases Device array of edge biases to use for sampling. If NULL\n use the edge weight as the bias. If set to NULL, edges will be sampled uniformly.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] vertex_type_offsets Device array of the offsets for each vertex type in the\n graph.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] num_edge_types Number of edge types where a value of 1 translates to homogeneous\n neighbor sample whereas a value greater than 1 translates to heterogeneous neighbor sample.\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_heterogeneous_biased_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
edge_biases: *const cugraph_edge_property_view_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
vertex_type_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
num_edge_types: ::std::os::raw::c_int,
options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Homogeneous Uniform Temporal Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n\n Temporal sampling considers the time associated with the edges. For example, if we start at\n vertex v1 and sample an edge that takes us to vertex v2 at time t1, when we sample in the next\n hop from vertex v2, we want to consider only edges that occur after time t1.\n\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] temporal_property_name Name associated with the edge property in the graph that\n should be used as the time. Currently unused.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_times Optional device span of times associated with each starting\n vertex for the sampling.\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_homogeneous_uniform_temporal_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
temporal_property_name: *const ::std::os::raw::c_char,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_times: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
sampling_options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Homogeneous Biased Temporal Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n\n Temporal sampling considers the time associated with the edges. For example, if we start at\n vertex v1 and sample an edge that takes us to vertex v2 at time t1, when we sample in the next\n hop from vertex v2, we want to consider only edges that occur after time t1.\n\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] temporal_property_name Name associated with the edge property in the graph that\n should be used as the time. Currently unused.\n @param [in] edge_biases Device array of edge biases to use for sampling. If NULL\n use the edge weight as the bias. If set to NULL, edges will be sampled uniformly.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_times Optional device span of times associated with each starting\n vertex for the sampling.\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_homogeneous_biased_temporal_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
temporal_property_name: *const ::std::os::raw::c_char,
edge_biases: *const cugraph_edge_property_view_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_times: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
sampling_options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Heterogeneous Uniform Temporal Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n\n Temporal sampling considers the time associated with the edges. For example, if we start at\n vertex v1 and sample an edge that takes us to vertex v2 at time t1, when we sample in the next\n hop from vertex v2, we want to consider only edges that occur after time t1.\n\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] temporal_property_name Name associated with the edge property in the graph that\n should be used as the time. Currently unused.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_times Optional device span of times associated with each starting\n vertex for the sampling.\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] vertex_type_offsets Device array of the offsets for each vertex type in the\n graph.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] num_edge_types Number of edge types where a value of 1 translates to homogeneous\n neighbor sample whereas a value greater than 1 translates to heterogeneous neighbor sample.\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_heterogeneous_uniform_temporal_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
temporal_property_name: *const ::std::os::raw::c_char,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_times: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
vertex_type_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
num_edge_types: ::std::os::raw::c_int,
sampling_options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Heterogeneous Biased Temporal Neighborhood Sampling\n\n Returns a sample of the neighborhood around specified start vertices and fan_out.\n The neighborhood is sampled uniformly.\n\n Temporal sampling considers the time associated with the edges. For example, if we start at\n vertex v1 and sample an edge that takes us to vertex v2 at time t1, when we sample in the next\n hop from vertex v2, we want to consider only edges that occur after time t1.\n\n Optionally, each start vertex can be associated with a label, allowing the caller to specify\n multiple batches of sampling requests in the same function call - which should improve GPU\n utilization.\n\n If label is NULL then all start vertices will be considered part of the same batch and the\n return value will not have a label column.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] temporal_property_name Name associated with the edge property in the graph that\n should be used as the time. Currently unused.\n @param [in] edge_biases Device array of edge biases to use for sampling. If NULL\n use the edge weight as the bias. If set to NULL, edges will be sampled uniformly.\n @param [in] start_vertices Device array of start vertices for the sampling\n @param [in] starting_vertex_times Optional device span of times associated with each starting\n vertex for the sampling.\n @param [in] starting_vertex_label_offsets Device array of the offsets for each label in\n the seed list. This parameter is only used with the retain_seeds option.\n @param [in] vertex_type_offsets Device array of the offsets for each vertex type in the\n graph.\n @param [in] fan_out Host array defining the fan out at each step in the sampling\n algorithm. We only support fan_out values of type INT32\n @param [in] num_edge_types Number of edge types where a value of 1 translates to homogeneous\n neighbor sample whereas a value greater than 1 translates to heterogeneous neighbor sample.\n @param [in] sampling_options\n Opaque pointer defining the sampling options.\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Output from the uniform_neighbor_sample call\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_heterogeneous_biased_temporal_neighbor_sample(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
temporal_property_name: *const ::std::os::raw::c_char,
edge_biases: *const cugraph_edge_property_view_t,
start_vertices: *const cugraph_type_erased_device_array_view_t,
starting_vertex_times: *const cugraph_type_erased_device_array_view_t,
starting_vertex_label_offsets: *const cugraph_type_erased_device_array_view_t,
vertex_type_offsets: *const cugraph_type_erased_device_array_view_t,
fan_out: *const cugraph_type_erased_host_array_view_t,
num_edge_types: ::std::os::raw::c_int,
sampling_options: *const cugraph_sampling_options_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @deprecated This call should be replaced with cugraph_sample_result_get_majors\n @brief Get the source vertices from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the source vertices in device memory"]
pub fn cugraph_sample_result_get_sources(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @deprecated This call should be replaced with cugraph_sample_result_get_minors\n @brief Get the destination vertices from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the destination vertices in device memory"]
pub fn cugraph_sample_result_get_destinations(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the major vertices from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the major vertices in device memory"]
pub fn cugraph_sample_result_get_majors(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the minor vertices from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the minor vertices in device memory"]
pub fn cugraph_sample_result_get_minors(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the major offsets from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the major offsets in device memory"]
pub fn cugraph_sample_result_get_major_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the start labels from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the start labels"]
pub fn cugraph_sample_result_get_start_labels(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge_id from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the edge_id"]
pub fn cugraph_sample_result_get_edge_id(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge_type from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the edge_type"]
pub fn cugraph_sample_result_get_edge_type(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge_weight from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the edge_weight"]
pub fn cugraph_sample_result_get_edge_weight(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge_start_time from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the edge_start_time"]
pub fn cugraph_sample_result_get_edge_start_time(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge_end_time from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the edge_end_time"]
pub fn cugraph_sample_result_get_edge_end_time(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the hop from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the hop"]
pub fn cugraph_sample_result_get_hop(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the label-hop offsets from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the label-hop offsets"]
pub fn cugraph_sample_result_get_label_hop_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the label-type-hop offsets from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the label-type-hop offsets"]
pub fn cugraph_sample_result_get_label_type_hop_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the index from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the index"]
pub fn cugraph_sample_result_get_index(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @deprecated This call should be replaced with cugraph_sample_get_get_label_hop_offsets\n @brief Get the result offsets from the sampling algorithm result\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the result offsets"]
pub fn cugraph_sample_result_get_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the renumber map\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the renumber map"]
pub fn cugraph_sample_result_get_renumber_map(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the renumber map offsets\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the renumber map offsets"]
pub fn cugraph_sample_result_get_renumber_map_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge renumber map\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the renumber map"]
pub fn cugraph_sample_result_get_edge_renumber_map(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Get the edge renumber map offets\n\n @param [in] result The result from a sampling algorithm\n @return type erased array pointing to the renumber map"]
pub fn cugraph_sample_result_get_edge_renumber_map_offsets(
result: *const cugraph_sample_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Free a sampling result\n\n @param [in] result The result from a sampling algorithm"]
pub fn cugraph_sample_result_free(result: *mut cugraph_sample_result_t);
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Create a sampling result (testing API)\n\n @param [in] handle Handle for accessing resources\n @param [in] srcs Device array view to populate srcs\n @param [in] dsts Device array view to populate dsts\n @param [in] edge_id Device array view to populate edge_id (can be NULL)\n @param [in] edge_type Device array view to populate edge_type (can be NULL)\n @param [in] wgt Device array view to populate wgt (can be NULL)\n @param [in] hop Device array view to populate hop\n @param [in] label Device array view to populate label (can be NULL)\n @param [out] result Pointer to the location to store the\n cugraph_sample_result_t*\n @param [out] error Pointer to an error object storing details of\n any error. Will be populated if error code is\n not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_test_sample_result_create(
handle: *const cugraph_resource_handle_t,
srcs: *const cugraph_type_erased_device_array_view_t,
dsts: *const cugraph_type_erased_device_array_view_t,
edge_id: *const cugraph_type_erased_device_array_view_t,
edge_type: *const cugraph_type_erased_device_array_view_t,
wgt: *const cugraph_type_erased_device_array_view_t,
hop: *const cugraph_type_erased_device_array_view_t,
label: *const cugraph_type_erased_device_array_view_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Create a sampling result (testing API)\n\n @param [in] handle Handle for accessing resources\n @param [in] srcs Device array view to populate srcs\n @param [in] dsts Device array view to populate dsts\n @param [in] edge_id Device array view to populate edge_id\n @param [in] edge_type Device array view to populate edge_type\n @param [in] weight Device array view to populate weight\n @param [in] hop Device array view to populate hop\n @param [in] label Device array view to populate label\n @param [out] result Pointer to the location to store the\n cugraph_sample_result_t*\n @param [out] error Pointer to an error object storing details of\n any error. Will be populated if error code is\n not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_test_uniform_neighborhood_sample_result_create(
handle: *const cugraph_resource_handle_t,
srcs: *const cugraph_type_erased_device_array_view_t,
dsts: *const cugraph_type_erased_device_array_view_t,
edge_id: *const cugraph_type_erased_device_array_view_t,
edge_type: *const cugraph_type_erased_device_array_view_t,
weight: *const cugraph_type_erased_device_array_view_t,
hop: *const cugraph_type_erased_device_array_view_t,
label: *const cugraph_type_erased_device_array_view_t,
result: *mut *mut cugraph_sample_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Select random vertices from the graph\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] num_vertices Number of vertices to sample\n @param [out] vertices Device array view to populate label\n @param [out] error Pointer to an error object storing details of\n any error. Will be populated if error code is\n not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_select_random_vertices(
handle: *const cugraph_resource_handle_t,
graph: *const cugraph_graph_t,
rng_state: *mut cugraph_rng_state_t,
num_vertices: usize,
vertices: *mut *mut cugraph_type_erased_device_array_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @ingroup samplingC\n @brief Perform negative sampling\n\n Negative sampling generates a COO structure defining edges according to the specified parameters\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each\n call\n @param [in] graph Pointer to graph\n @param [in] vertices Vertex ids for the source biases. If @p src_bias and\n @p dst_bias are not specified this is ignored. If\n @p vertices is specified then vertices[i] is the vertex\n id of src_biases[i] and dst_biases[i]. If @p vertices\n is not specified then i is the vertex id if src_biases[i]\n and dst_biases[i]\n @param [in] src_biases Bias for selecting source vertices. If NULL, do uniform\n sampling, if provided probability of vertex i will be\n src_bias[i] / (sum of all source biases)\n @param [in] dst_biases Bias for selecting destination vertices. If NULL, do\n uniform sampling, if provided probability of vertex i\n will be dst_bias[i] / (sum of all destination biases)\n @param [in] num_samples Number of negative samples to generate\n @param [in] remove_duplicates If true, remove duplicates from sampled edges\n @param [in] remove_existing_edges If true, remove sampled edges that actually exist in\n the graph\n @param [in] exact_number_of_samples If true, result should contain exactly @p num_samples. If\n false the code will generate @p num_samples and then do\n any filtering as specified\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if\n set to true)\n @param [out] result Opaque pointer to generated coo list\n @param [out] error Pointer to an error object storing details of any error.\n Will be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_negative_sampling(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
vertices: *const cugraph_type_erased_device_array_view_t,
src_biases: *const cugraph_type_erased_device_array_view_t,
dst_biases: *const cugraph_type_erased_device_array_view_t,
num_samples: usize,
remove_duplicates: bool_t,
remove_existing_edges: bool_t,
exact_number_of_samples: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_coo_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque similarity result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_similarity_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_similarity_result_t"][::std::mem::size_of::<cugraph_similarity_result_t>() - 4usize];
["Alignment of cugraph_similarity_result_t"][::std::mem::align_of::<cugraph_similarity_result_t>() - 4usize];
["Offset of field: cugraph_similarity_result_t::align_"]
[::std::mem::offset_of!(cugraph_similarity_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup similarity\n @brief Get vertex pair from the similarity result.\n\n @param [in] result The result from a similarity algorithm\n @return vertex pairs"]
pub fn cugraph_similarity_result_get_vertex_pairs(
result: *mut cugraph_similarity_result_t,
) -> *mut cugraph_vertex_pairs_t;
}
unsafe extern "C" {
#[doc = " @ingroup similarity\n @brief Get the similarity coefficient array\n\n @param [in] result The result from a similarity algorithm\n @return type erased array of similarity coefficients"]
pub fn cugraph_similarity_result_get_similarity(
result: *mut cugraph_similarity_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup similarity\n @brief Free similarity result\n\n @param [in] result The result from a similarity algorithm"]
pub fn cugraph_similarity_result_free(result: *mut cugraph_similarity_result_t);
}
unsafe extern "C" {
#[doc = " @brief Perform Jaccard similarity computation\n\n Compute the similarity for the specified vertex_pairs\n\n Note that Jaccard similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_pairs Vertex pair for input\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_jaccard_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_pairs: *const cugraph_vertex_pairs_t,
use_weight: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform Sorensen similarity computation\n\n Compute the similarity for the specified vertex_pairs\n\n Note that Sorensen similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_pairs Vertex pair for input\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_sorensen_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_pairs: *const cugraph_vertex_pairs_t,
use_weight: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform overlap similarity computation\n\n Compute the similarity for the specified vertex_pairs\n\n Note that overlap similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_pairs Vertex pair for input\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_overlap_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_pairs: *const cugraph_vertex_pairs_t,
use_weight: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform cosine similarity computation\n\n Compute the similarity for the specified vertex_pairs\n\n Note that cosine similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertex_pairs Vertex pair for input\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_cosine_similarity_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertex_pairs: *const cugraph_vertex_pairs_t,
use_weight: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform All-Pairs Jaccard similarity computation\n\n Compute the similarity for all vertex pairs derived from the two-hop neighbors\n of an optional specified vertex list. This function will identify the two-hop\n neighbors of the specified vertices (all vertices in the graph if not specified)\n and compute similarity for those vertices.\n\n If the topk parameter is specified then the result will only contain the top k\n highest scoring results.\n\n Note that Jaccard similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertices Vertex list for input. If null then compute based on\n all vertices in the graph.\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] topk Specify how many answers to return. Specifying SIZE_MAX\n will return all values.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_all_pairs_jaccard_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertices: *const cugraph_type_erased_device_array_view_t,
use_weight: bool_t,
topk: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform All Pairs Sorensen similarity computation\n\n Compute the similarity for all vertex pairs derived from the two-hop neighbors\n of an optional specified vertex list. This function will identify the two-hop\n neighbors of the specified vertices (all vertices in the graph if not specified)\n and compute similarity for those vertices.\n\n If the topk parameter is specified then the result will only contain the top k\n highest scoring results.\n\n Note that Sorensen similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertices Vertex list for input. If null then compute based on\n all vertices in the graph.\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] topk Specify how many answers to return. Specifying SIZE_MAX\n will return all values.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_all_pairs_sorensen_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertices: *const cugraph_type_erased_device_array_view_t,
use_weight: bool_t,
topk: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform All Pairs overlap similarity computation\n\n Compute the similarity for all vertex pairs derived from the two-hop neighbors\n of an optional specified vertex list. This function will identify the two-hop\n neighbors of the specified vertices (all vertices in the graph if not specified)\n and compute similarity for those vertices.\n\n If the topk parameter is specified then the result will only contain the top k\n highest scoring results.\n\n Note that overlap similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertices Vertex list for input. If null then compute based on\n all vertices in the graph.\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] topk Specify how many answers to return. Specifying SIZE_MAX\n will return all values.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_all_pairs_overlap_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertices: *const cugraph_type_erased_device_array_view_t,
use_weight: bool_t,
topk: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform All Pairs cosine similarity computation\n\n Compute the similarity for all vertex pairs derived from the two-hop neighbors\n of an optional specified vertex list. This function will identify the two-hop\n neighbors of the specified vertices (all vertices in the graph if not specified)\n and compute similarity for those vertices.\n\n If the topk parameter is specified then the result will only contain the top k\n highest scoring results.\n\n Note that cosine similarity must run on a symmetric graph.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] vertices Vertex list for input. If null then compute based on\n all vertices in the graph.\n @param [in] use_weight If true consider the edge weight in the graph, if false use an\n edge weight of 1\n @param [in] topk Specify how many answers to return. Specifying SIZE_MAX\n will return all values.\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to similarity results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_all_pairs_cosine_similarity_coefficients(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
vertices: *const cugraph_type_erased_device_array_view_t,
use_weight: bool_t,
topk: usize,
do_expensive_check: bool_t,
result: *mut *mut cugraph_similarity_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque paths result type\n\n Store the output of BFS or SSSP, computing predecessors and distances\n from a seed."]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_paths_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_paths_result_t"][::std::mem::size_of::<cugraph_paths_result_t>() - 4usize];
["Alignment of cugraph_paths_result_t"][::std::mem::align_of::<cugraph_paths_result_t>() - 4usize];
["Offset of field: cugraph_paths_result_t::align_"]
[::std::mem::offset_of!(cugraph_paths_result_t, align_) - 0usize];
};
#[doc = " @brief Opaque BFS predicate result type\n\n Store target-discovery metadata for cugraph_bfs_with_predicates."]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_bfs_predicate_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_bfs_predicate_result_t"][::std::mem::size_of::<cugraph_bfs_predicate_result_t>() - 4usize];
["Alignment of cugraph_bfs_predicate_result_t"][::std::mem::align_of::<cugraph_bfs_predicate_result_t>() - 4usize];
["Offset of field: cugraph_bfs_predicate_result_t::align_"]
[::std::mem::offset_of!(cugraph_bfs_predicate_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Get the vertex ids from the paths result\n\n @param [in] result The result from bfs or sssp\n @return type erased array of vertex ids"]
pub fn cugraph_paths_result_get_vertices(
result: *mut cugraph_paths_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Get the distances from the paths result\n\n @param [in] result The result from bfs or sssp\n @return type erased array of distances"]
pub fn cugraph_paths_result_get_distances(
result: *mut cugraph_paths_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Get the predecessors from the paths result\n\n @param [in] result The result from bfs or sssp\n @return type erased array of predecessors. Value will be NULL if\n compute_predecessors was FALSE in the call to bfs or sssp that\n produced this result."]
pub fn cugraph_paths_result_get_predecessors(
result: *mut cugraph_paths_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Free paths result\n\n @param [in] result The result from bfs or sssp"]
pub fn cugraph_paths_result_free(result: *mut cugraph_paths_result_t);
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Return whether a target was discovered.\n\n @param [in] result The predicate result from cugraph_bfs_with_predicates\n @return TRUE if a target was discovered, FALSE otherwise"]
pub fn cugraph_bfs_predicate_result_get_target_found(result: *mut cugraph_bfs_predicate_result_t) -> bool_t;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Return the BFS depth where a target was first discovered.\n\n The value is meaningful only when\n cugraph_bfs_predicate_result_get_target_found returns TRUE.\n\n @param [in] result The predicate result from cugraph_bfs_with_predicates\n @return target discovery distance"]
pub fn cugraph_bfs_predicate_result_get_target_distance(result: *mut cugraph_bfs_predicate_result_t) -> usize;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Free BFS predicate result\n\n @param [in] result The predicate result from cugraph_bfs_with_predicates"]
pub fn cugraph_bfs_predicate_result_free(result: *mut cugraph_bfs_predicate_result_t);
}
unsafe extern "C" {
#[doc = " @brief Perform a breadth first search from a set of seed vertices.\n\n This function computes the distances (minimum number of hops to reach the vertex) from the source\n vertex. If @p predecessors is not NULL, this function calculates the predecessor of each\n vertex (parent vertex in the breadth-first search tree) as well.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n FIXME: Make this just [in], copy it if I need to temporarily modify internally\n @param [in,out] sources Array of source vertices. NOTE: Array might be modified if\n renumbering is enabled for the graph\n @param [in] direction_optimizing If set to true, this algorithm switches between the push based\n breadth-first search and pull based breadth-first search depending on the size of the\n breadth-first search frontier (currently unsupported). This option is valid only for symmetric\n input graphs.\n @param depth_limit Sets the maximum number of breadth-first search iterations. Any vertices\n farther than @p depth_limit hops from @p source_vertex will be marked as unreachable.\n @param [in] compute_predecessors A flag to indicate whether to compute the predecessors in the\n result\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to paths results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_bfs(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
sources: *mut cugraph_type_erased_device_array_view_t,
direction_optimizing: bool_t,
depth_limit: usize,
compute_predecessors: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_paths_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform a breadth first search with optional edge, vertex, and target predicates.\n\n Vertex and target predicate inputs use external vertex IDs. Edge predicate input uses external\n edge IDs and requires the graph to have edge IDs. Passing both @p include_vertices and\n @p exclude_vertices is invalid. Source vertices rejected by the vertex predicate are invalid\n input. Target discovery is level-synchronous: when @p stop_on_first_target is TRUE, traversal\n stops after the first depth where a target is discovered.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] sources Array of source vertices\n @param [in] include_vertices Optional array of vertices allowed to be reached\n @param [in] exclude_vertices Optional array of vertices not allowed to be reached\n @param [in] target_vertices Optional array of target vertices for early termination metadata\n @param [in] include_edge_ids Optional array of edge IDs allowed to be traversed\n @param [in] direction_optimizing If set to true, enable direction-optimizing BFS\n @param depth_limit Sets the maximum number of breadth-first search iterations\n @param [in] compute_predecessors A flag to indicate whether to compute predecessors\n @param [in] stop_on_first_target A flag to stop after discovering a target depth\n @param [in] do_expensive_check A flag to run expensive checks for input arguments\n @param [out] result Opaque pointer to paths results\n @param [out] predicate_result Opaque pointer to target predicate metadata. May be NULL\n @param [out] error Pointer to an error object storing details of any error\n @return error code"]
pub fn cugraph_bfs_with_predicates(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
sources: *mut cugraph_type_erased_device_array_view_t,
include_vertices: *const cugraph_type_erased_device_array_view_t,
exclude_vertices: *const cugraph_type_erased_device_array_view_t,
target_vertices: *const cugraph_type_erased_device_array_view_t,
include_edge_ids: *const cugraph_type_erased_device_array_view_t,
direction_optimizing: bool_t,
depth_limit: usize,
compute_predecessors: bool_t,
stop_on_first_target: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_paths_result_t,
predicate_result: *mut *mut cugraph_bfs_predicate_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Perform single-source shortest-path to compute the minimum distances\n (and predecessors) from the source vertex.\n\n This function computes the distances (minimum edge weight sums) from the source\n vertex. If @p predecessors is not NULL, this function calculates the predecessor of each\n vertex (parent vertex in the breadth-first search tree) as well.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph\n @param [in] source Source vertex id\n @param [in] cutoff Maximum edge weight sum to consider\n @param [in] compute_predecessors A flag to indicate whether to compute the predecessors in the\n result\n @param [in] do_expensive_check A flag to run expensive checks for input arguments (if set to\n `true`).\n @param [out] result Opaque pointer to paths results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_sssp(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
source: usize,
cutoff: f64,
compute_predecessors: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_paths_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
#[doc = " @brief Opaque extract_paths result type"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_extract_paths_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_extract_paths_result_t"][::std::mem::size_of::<cugraph_extract_paths_result_t>() - 4usize];
["Alignment of cugraph_extract_paths_result_t"][::std::mem::align_of::<cugraph_extract_paths_result_t>() - 4usize];
["Offset of field: cugraph_extract_paths_result_t::align_"]
[::std::mem::offset_of!(cugraph_extract_paths_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Extract BFS or SSSP paths from a cugraph_paths_result_t\n\n This function extracts paths from the BFS or SSSP output. BFS and SSSP output\n distances and predecessors. The path from a vertex v back to the original\n source vertex can be extracted by recursively looking up the predecessor\n vertex until you arrive back at the original source vertex.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] sources Array of source vertices\n @param [in] result Output from the BFS call\n @param [in] destinations Array of destination vertices.\n @param [out] result Opaque pointer to extract_paths results\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_extract_paths(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
sources: *const cugraph_type_erased_device_array_view_t,
paths_result: *const cugraph_paths_result_t,
destinations: *const cugraph_type_erased_device_array_view_t,
result: *mut *mut cugraph_extract_paths_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Get the max path length from extract_paths result\n\n @param [in] result The result from extract_paths\n @return maximum path length"]
pub fn cugraph_extract_paths_result_get_max_path_length(result: *mut cugraph_extract_paths_result_t) -> usize;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Get the matrix (row major order) of paths\n\n @param [in] result The result from extract_paths\n @return type erased array pointing to the matrix in device memory"]
pub fn cugraph_extract_paths_result_get_paths(
result: *mut cugraph_extract_paths_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
#[doc = " @ingroup traversal\n @brief Free extract_paths result\n\n @param [in] result The result from extract_paths"]
pub fn cugraph_extract_paths_result_free(result: *mut cugraph_extract_paths_result_t);
}
#[doc = " @brief Opaque layout output"]
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct cugraph_layout_result_t {
pub align_: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of cugraph_layout_result_t"][::std::mem::size_of::<cugraph_layout_result_t>() - 4usize];
["Alignment of cugraph_layout_result_t"][::std::mem::align_of::<cugraph_layout_result_t>() - 4usize];
["Offset of field: cugraph_layout_result_t::align_"]
[::std::mem::offset_of!(cugraph_layout_result_t, align_) - 0usize];
};
unsafe extern "C" {
#[doc = " @brief Minimum Spanning Tree\n\n NOTE: This currently wraps the legacy minimum implementation and is only\n available in Single GPU implementation.\n\n @param [in] handle Handle for accessing resources\n @param [in] graph Pointer to graph. NOTE: Graph might be modified if the storage\n needs to be transposed\n @param [in] do_expensive_check\n A flag to run expensive checks for input arguments (if set to true)\n @param [out] result Opaque object containing the extracted subgraph\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_minimum_spanning_tree(
handle: *const cugraph_resource_handle_t,
graph: *mut cugraph_graph_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_induced_subgraph_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
pub const cugraph_generator_distribution_t_POWER_LAW: cugraph_generator_distribution_t = 0;
pub const cugraph_generator_distribution_t_UNIFORM: cugraph_generator_distribution_t = 1;
pub type cugraph_generator_distribution_t = ::std::os::raw::c_uint;
unsafe extern "C" {
#[doc = " @brief Generate RMAT edge list\n\n Returns a COO containing edges generated from the RMAT generator.\n\n Vertex types will be int32 if scale < 32 and int64 if scale >= 32\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] scale Scale factor to set the number of vertices in the graph. Vertex IDs have\n values in [0, V), where V = 1 << @p scale.\n @param [in] num_edges Number of edges to generate.\n @param [in] a a, b, c, d (= 1.0 - (a + b + c)) in the R-mat graph generator\n (vist https://graph500.org for additional details). a, b, c, d should be non-negative and a + b +\n c should be no larger than 1.0.\n @param [in] b a, b, c, d (= 1.0 - (a + b + c)) in the R-mat graph generator\n (vist https://graph500.org for additional details). a, b, c, d should be non-negative and a + b +\n c should be no larger than 1.0.\n @param [in] c a, b, c, d (= 1.0 - (a + b + c)) in the R-mat graph generator\n (vist https://graph500.org for additional details). a, b, c, d should be non-negative and a + b +\n c should be no larger than 1.0.\n @param [in] clip_and_flip Flag controlling whether to generate edges only in the lower\n triangular part (including the diagonal) of the graph adjacency matrix (if set to `true`) or not\n (if set to `false`).\n @param [in] scramble_vertex_ids Flag controlling whether to scramble vertex ID bits\n (if set to `true`) or not (if set to `false`); scrambling vertex ID bits breaks correlation\n between vertex ID values and vertex degrees.\n @param [out] result Opaque pointer to generated coo\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_generate_rmat_edgelist(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
scale: usize,
num_edges: usize,
a: f64,
b: f64,
c: f64,
clip_and_flip: bool_t,
scramble_vertex_ids: bool_t,
result: *mut *mut cugraph_coo_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Generate RMAT edge lists\n\n Returns a COO list containing edges generated from the RMAT generator.\n\n Vertex types will be int32 if scale < 32 and int64 if scale >= 32\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in] n_edgelists Number of edge lists (graphs) to generate\n @param [in] min_scale Scale factor to set the minimum number of verties in the graph.\n @param [in] max_scale Scale factor to set the maximum number of verties in the graph.\n @param [in] edge_factor Average number of edges per vertex to generate.\n @param [in] size_distribution Distribution of the graph sizes, impacts the scale parameter of\n the R-MAT generator\n @param [in] edge_distribution Edges distribution for each graph, impacts how R-MAT parameters\n a,b,c,d, are set.\n @param [in] clip_and_flip Flag controlling whether to generate edges only in the lower\n triangular part (including the diagonal) of the graph adjacency matrix (if set to `true`) or not\n (if set to `false`).\n @param [in] scramble_vertex_ids Flag controlling whether to scramble vertex ID bits\n (if set to `true`) or not (if set to `false`); scrambling vertex ID bits breaks correlation\n between vertex ID values and vertex degrees.\n @param [out] result Opaque pointer to generated coo list\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS\n @return error code"]
pub fn cugraph_generate_rmat_edgelists(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
n_edgelists: usize,
min_scale: usize,
max_scale: usize,
edge_factor: usize,
size_distribution: cugraph_generator_distribution_t,
edge_distribution: cugraph_generator_distribution_t,
clip_and_flip: bool_t,
scramble_vertex_ids: bool_t,
result: *mut *mut cugraph_coo_list_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Generate edge weights and add to an rmat edge list\n\n Updates a COO to contain random edge weights\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in,out] coo Opaque pointer to the coo, weights will be added (overwriting\n any existing weights)\n @param [in] dtype The type of weight to generate (FLOAT32 or FLOAT64), ignored\n unless include_weights is true\n @param [in] minimum_weight Minimum weight value to generate\n @param [in] maximum_weight Maximum weight value to generate\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_generate_edge_weights(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
coo: *mut cugraph_coo_t,
dtype: cugraph_data_type_id_t,
minimum_weight: f64,
maximum_weight: f64,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Add edge ids to an COO\n\n Updates a COO to contain edge ids. Edges will be numbered from 0 to n-1 where n is the number of\n edges\n\n @param [in] handle Handle for accessing resources\n @param [in,out] coo Opaque pointer to the coo, weights will be added (overwriting\n any existing weights)\n @param [in] multi_gpu Flag if the COO is being created on multiple GPUs\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_generate_edge_ids(
handle: *const cugraph_resource_handle_t,
coo: *mut cugraph_coo_t,
multi_gpu: bool_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
#[doc = " @brief Generate random edge types, add them to an COO\n\n Updates a COO to contain edge types. Edges types will be randomly generated.\n\n @param [in] handle Handle for accessing resources\n @param [in,out] rng_state State of the random number generator, updated with each call\n @param [in,out] coo Opaque pointer to the coo, weights will be added (overwriting\n any existing weights)\n @param [in] max_edge_type Edge types will be randomly generated between min_edge_type\n and max_edge_type\n @param [out] error Pointer to an error object storing details of any error. Will\n be populated if error code is not CUGRAPH_SUCCESS"]
pub fn cugraph_generate_edge_types(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
coo: *mut cugraph_coo_t,
min_edge_type: i32,
max_edge_type: i32,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
pub fn cugraph_force_atlas2(
handle: *const cugraph_resource_handle_t,
rng_state: *mut cugraph_rng_state_t,
graph: *mut cugraph_graph_t,
max_iter: ::std::os::raw::c_int,
start_vertices: *mut cugraph_type_erased_device_array_view_t,
x_start: *mut cugraph_type_erased_device_array_view_t,
y_start: *mut cugraph_type_erased_device_array_view_t,
outbound_attraction_distribution: bool_t,
lin_log_mode: bool_t,
prevent_overlapping: bool_t,
vertex_radius_vertices: *mut cugraph_type_erased_device_array_view_t,
vertex_radius_values: *mut cugraph_type_erased_device_array_view_t,
overlap_scaling_ratio: f64,
edge_weight_influence: f64,
jitter_tolerance: f64,
barnes_hut_optimize: bool_t,
barnes_hut_theta: f64,
scaling_ratio: f64,
strong_gravity_mode: bool_t,
gravity: f64,
vertex_mobility_vertices: *mut cugraph_type_erased_device_array_view_t,
vertex_mobility_values: *mut cugraph_type_erased_device_array_view_t,
vertex_mass_vertices: *mut cugraph_type_erased_device_array_view_t,
vertex_mass_values: *mut cugraph_type_erased_device_array_view_t,
verbose: bool_t,
do_expensive_check: bool_t,
result: *mut *mut cugraph_layout_result_t,
error: *mut *mut cugraph_error_t,
) -> cugraph_error_code_t;
}
unsafe extern "C" {
pub fn cugraph_layout_result_get_vertices(
result: *mut cugraph_layout_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
pub fn cugraph_layout_result_get_x_axis(
result: *mut cugraph_layout_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
pub fn cugraph_layout_result_get_y_axis(
result: *mut cugraph_layout_result_t,
) -> *mut cugraph_type_erased_device_array_view_t;
}
unsafe extern "C" {
pub fn cugraph_layout_result_free(result: *mut cugraph_layout_result_t);
}