From 3ce6df4706b56e81473edf1bf5b5b646971f71ae Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Mon, 6 Jul 2026 14:40:53 -0400 Subject: [PATCH 1/7] First draft of Rust wrapper --- .gitignore | 4 + rust/Cargo.lock | 231 +++++++++++++++++++++++++++++++ rust/Cargo.toml | 18 +++ rust/HOWTO.md | 59 ++++++++ rust/README.md | 80 +++++++++++ rust/bindgen.rs | 3 + rust/build.rs | 66 +++++++++ rust/examples/resource_handle.rs | 21 +++ rust/src/lib.rs | 24 ++++ rust/tests/abi_surface.rs | 26 ++++ rust/tests/runtime_smoke.rs | 21 +++ rust/wrapper.h | 20 +++ 12 files changed, 573 insertions(+) create mode 100644 rust/Cargo.lock create mode 100644 rust/Cargo.toml create mode 100644 rust/HOWTO.md create mode 100644 rust/README.md create mode 100644 rust/bindgen.rs create mode 100644 rust/build.rs create mode 100644 rust/examples/resource_handle.rs create mode 100644 rust/src/lib.rs create mode 100644 rust/tests/abi_surface.rs create mode 100644 rust/tests/runtime_smoke.rs create mode 100644 rust/wrapper.h diff --git a/.gitignore b/.gitignore index b7576bf072b..43eccdb3f68 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,10 @@ _skbuild/ cufile.log *.whl +## Rust code +rust/target/ + + ## Patching *.diff *.orig diff --git a/rust/Cargo.lock b/rust/Cargo.lock new file mode 100644 index 00000000000..65e520f510d --- /dev/null +++ b/rust/Cargo.lock @@ -0,0 +1,231 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", +] + +[[package]] +name = "bitflags" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "either" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libcugraph-c-sys" +version = "0.1.0" +dependencies = [ + "bindgen", + "static_assertions", +] + +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + +[[package]] +name = "memchr" +version = "2.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "syn" +version = "2.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" diff --git a/rust/Cargo.toml b/rust/Cargo.toml new file mode 100644 index 00000000000..b30ac987d47 --- /dev/null +++ b/rust/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "libcugraph-c-sys" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" +description = "Low-level Rust FFI bindings for libcugraph_c generated with bindgen" +links = "cugraph_c" +build = "build.rs" + +[features] +default = [] +runtime-link = [] + +[build-dependencies] +bindgen = { version = "=0.69.4", default-features = false, features = ["runtime"] } + +[dev-dependencies] +static_assertions = "1.1" diff --git a/rust/HOWTO.md b/rust/HOWTO.md new file mode 100644 index 00000000000..52a588251b3 --- /dev/null +++ b/rust/HOWTO.md @@ -0,0 +1,59 @@ +# How To Use libcugraph C API from Rust + +This guide is for generating and using low-level Rust FFI bindings to +`libcugraph_c` in this repository. + +## 1) Generate bindings with default header path + +From this directory: + +```bash +cargo check +``` + +This generates bindings in Cargo `OUT_DIR` and compiles the crate. + +## 2) Generate a single checked file named bindgen.rs + +If you want one file in this folder (for sharing or reuse), run: + +```bash +CUGRAPH_EXPORT_BINDINGS=$PWD/bindgen.rs cargo check +``` + +The generated file will be written to `rust/bindgen.rs`. + +## 3) Use a custom include directory + +```bash +CUGRAPH_INCLUDE_DIR=/custom/include/root cargo check +``` + +The include root must contain `cugraph_c/*.h`. + +## 4) Run runtime example (links to libcugraph_c) + +```bash +CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle --features runtime-link +``` + +## 5) Run tests + +Compile-time API tests: + +```bash +cargo test --test abi_surface +``` + +Runtime smoke test (requires `libcugraph_c.so`): + +```bash +CUGRAPH_LIB_DIR=/path/to/lib cargo test --test runtime_smoke --features runtime-link +``` + +## Notes + +- This is C API only. No C++ wrappers. +- No Cython. +- `tree_algorithms.h` and `layout_algorithms.h` are currently omitted from the + wrapper in this initial setup. diff --git a/rust/README.md b/rust/README.md new file mode 100644 index 00000000000..b9edbb892ec --- /dev/null +++ b/rust/README.md @@ -0,0 +1,80 @@ +# libcugraph C API Rust Bindings (bindgen) + +This folder contains a minimal Rust setup to generate FFI bindings for +`libcugraph_c` directly from the C API headers in this repository. + +It is intentionally low-level and does not provide a high-level Rust wrapper. + +## What this provides + +- `bindgen`-based generation from headers under `cpp/include/cugraph_c` +- A single Rust crate (`libcugraph-c-sys`) with generated raw FFI items +- Optional runtime linking support for smoke tests and examples +- Example + tests showing direct C API usage from Rust + +## Layout + +- `Cargo.toml` : crate manifest +- `build.rs` : runs bindgen and (optionally) emits linker directives +- `wrapper.h` : aggregation header including the full C API surface +- `src/lib.rs` : includes generated bindings and one small utility helper +- `examples/resource_handle.rs` : minimal runtime example +- `tests/abi_surface.rs` : compile-time shape checks +- `tests/runtime_smoke.rs` : runtime smoke test (feature-gated) + +## Requirements + +- Rust toolchain (`cargo`, `rustc`) +- `libclang` available to `bindgen` (for example, via conda or system install) +- C headers from this repository (defaults to `../cpp/include`) +- Optional runtime library for execution tests/examples: `libcugraph_c.so` + +## Generate bindings + +From this directory: + +```bash +cargo check +``` + +This runs `build.rs`, which generates `bindgen.rs` into Cargo `OUT_DIR`. + +## Environment variables + +- `CUGRAPH_INCLUDE_DIR` + - Optional include root for `cugraph_c/*.h` + - Default: `../cpp/include` +- `CUGRAPH_LIB_DIR` + - Optional directory containing `libcugraph_c.so` + - Used when `runtime-link` feature is enabled +- `CUGRAPH_EXPORT_BINDINGS` + - Optional output path for writing a single generated bindings file + - Example: `CUGRAPH_EXPORT_BINDINGS=$PWD/bindgen.rs cargo check` + +## Run example with runtime linking + +```bash +CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle --features runtime-link +``` + +## Run tests + +Compile-only API checks: + +```bash +cargo test --test abi_surface +``` + +Runtime smoke test (requires shared library): + +```bash +CUGRAPH_LIB_DIR=/path/to/lib cargo test --test runtime_smoke --features runtime-link +``` + +## Notes + +- This setup targets the C API only (`libcugraph_c`). +- No C++ wrappers and no Cython are used. +- Generated bindings are intentionally broad to expose the raw API surface. +- `tree_algorithms.h` and `layout_algorithms.h` are currently excluded from + `wrapper.h` for this initial Rust binding scope. diff --git a/rust/bindgen.rs b/rust/bindgen.rs new file mode 100644 index 00000000000..8e082caa163 --- /dev/null +++ b/rust/bindgen.rs @@ -0,0 +1,3 @@ +/* automatically generated by rust-bindgen 0.69.4 */ + +pub const cugraph_error_code__CUGRAPH_SUCCESS : cugraph_error_code_ = 0 ; pub const cugraph_error_code__CUGRAPH_UNKNOWN_ERROR : cugraph_error_code_ = 1 ; pub const cugraph_error_code__CUGRAPH_INVALID_HANDLE : cugraph_error_code_ = 2 ; pub const cugraph_error_code__CUGRAPH_ALLOC_ERROR : cugraph_error_code_ = 3 ; pub const cugraph_error_code__CUGRAPH_INVALID_INPUT : cugraph_error_code_ = 4 ; pub const cugraph_error_code__CUGRAPH_NOT_IMPLEMENTED : cugraph_error_code_ = 5 ; pub const cugraph_error_code__CUGRAPH_UNSUPPORTED_TYPE_COMBINATION : cugraph_error_code_ = 6 ; pub type cugraph_error_code_ = :: std :: os :: raw :: c_uint ; pub use self :: cugraph_error_code_ as cugraph_error_code_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_error_ { pub align_ : i32 , } pub type cugraph_error_t = cugraph_error_ ; 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 ; } 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) ; } pub const bool__FALSE : bool_ = 0 ; pub const bool__TRUE : bool_ = 1 ; pub type bool_ = :: std :: os :: raw :: c_uint ; pub use self :: bool_ as bool_t ; pub type byte_t = i8 ; pub const data_type_id__INT8 : data_type_id_ = 0 ; pub const data_type_id__INT16 : data_type_id_ = 1 ; pub const data_type_id__INT32 : data_type_id_ = 2 ; pub const data_type_id__INT64 : data_type_id_ = 3 ; pub const data_type_id__UINT8 : data_type_id_ = 4 ; pub const data_type_id__UINT16 : data_type_id_ = 5 ; pub const data_type_id__UINT32 : data_type_id_ = 6 ; pub const data_type_id__UINT64 : data_type_id_ = 7 ; pub const data_type_id__FLOAT32 : data_type_id_ = 8 ; pub const data_type_id__FLOAT64 : data_type_id_ = 9 ; pub const data_type_id__SIZE_T : data_type_id_ = 10 ; pub const data_type_id__BOOL : data_type_id_ = 11 ; pub const data_type_id__NTYPES : data_type_id_ = 12 ; pub type data_type_id_ = :: std :: os :: raw :: c_uint ; pub use self :: data_type_id_ as cugraph_data_type_id_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_resource_handle_ { pub align_ : i32 , } pub type cugraph_resource_handle_t = cugraph_resource_handle_ ; 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_view_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_graph_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_data_mask_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct cugraph_graph_properties_t { pub is_symmetric : bool_t , pub is_multigraph : bool_t , } impl Default for cugraph_graph_properties_t { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_rng_state_t { pub align_ : i32 , } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edge_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 , Default , Copy , Clone)] pub struct cugraph_hits_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } # [doc = " @brief Opaque vertex pair type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_pairs_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_induced_subgraph_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_degrees_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edgelist_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_triangle_count_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_hierarchical_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 COO definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_t { pub align_ : i32 , } # [doc = " @brief Opaque COO list definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_list_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [doc = " @brief Opaque core number result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_core_result_t { pub align_ : i32 , } # [doc = " @brief Opaque k-core result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_k_core_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } # [doc = " @brief Opaque labeling result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_labeling_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 layout output"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_layout_result_t { pub align_ : i32 , } extern "C" { # [doc = " @brief Force Atlas 2\n\n NOTE: This currently wraps the legacy force atlas 2 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] max_iter Maximum number of iterations. Initial vertex positioning\n @param [in] start_vertices Optionally send in an initial vertex positioning.\nThis defines the vertices for x_start and y_start.\n @param [in] x_start Optionally send in an initial vertex positioning (x-axis).\n Set to NULL if no value is passed. If NULL, the initial x-axis\n are selected randomly.\n @param [in] y_start Optionally send in an initial vertex positioning (y-axis).\n Set to NULL if no value is passed. If NULL, the initial y-axis\n are selected randomly.\n @param [in] outbound_attraction_distribution\n Distributes attraction along outbound edges\n Hubs attract less and thus are pushed to the borders.\n @param [in] lin_log_mode Switch Force Atlas model from lin-lin to lin-log.\n Makes clusters more tight.\n @param [in] prevent_overlapping\n Prevent nodes to overlap.\n @param [in] vertex_radius_vertices\n Vertex identities for vertex radius.\n @param [in] vertex_radius_values\n Radius of each vertex, used when prevent_overlapping is set.\n @param [in] overlap_scaling_ratio\n When prevent_overlapping is set, scales the repulsion force\n between two nodes that are overlapping.\n @param [in] edge_weight_influence\n How much influence you give to the edges weight.\n 0 is “no influence” and 1 is “normal”.\n @param [in] jitter_tolerance\n How much swinging you allow. Above 1 discouraged.\n Lower gives less speed and more precision.\n @param [in] barnes_hut_optimize\n Whether to use the Barnes Hut approximation or the slower exact\n version.\n @param [in] barnes_hut_theta\n Float between 0 and 1. Tradeoff for speed (1) vs accuracy (0) for\n Barnes Hut only.\n @param [in] scaling_ratio\n How much repulsion you want. More makes a more sparse graph.\n Switching from regular mode to LinLog mode needs a readjustment of\n the scaling parameter.\n @param [in] strong_gravity_mode\n Sets a force that attracts the nodes that are distant from the\n center more. It is so strong that it can sometimes dominate other\n forces.\n @param [in] gravity Attracts nodes to the center. Prevents islands from drifting away.\n @param [in] vertex_mobility_vertices\n Vertex identities for vertex mobility.\n @param [in] vertex_mobility_values\n Mobility of each vertex, used to scale the displacement at each\n iteration.\n @param [in] vertex_mass_vertices\n Vertex identities for vertex mass.\n @param [in] vertex_mass_values\n Mass of each vertex, which controls the attraction to other\n vertices. If not provided, the mass of each vertex will be its\n degree plus one.\n @param [in] verbose Output convergence info at each interation.\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 layout 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_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 ; } extern "C" { # [doc = " @brief Get layout vertices"] pub fn cugraph_layout_result_get_vertices (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout x-axis"] pub fn cugraph_layout_result_get_x_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout y-axis"] pub fn cugraph_layout_result_get_y_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Free a layout result\n\n @param [in] result The result from a layout algorithm"] pub fn cugraph_layout_result_free (result : * mut cugraph_layout_result_t) ; } # [doc = " @brief Opaque src-dst lookup container type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_container_t { pub align_ : i32 , } # [doc = " @brief Opaque src-dst lookup result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_view_t { pub align_ : i32 , } # [doc = " @brief Opaque random walk result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_random_walk_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_sample_result_t { pub align_ : i32 , } # [doc = " @brief Opaque sampling options type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_sampling_options_t { pub align_ : i32 , } 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 ; 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 ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_similarity_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_extract_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } \ No newline at end of file diff --git a/rust/build.rs b/rust/build.rs new file mode 100644 index 00000000000..5a892f14312 --- /dev/null +++ b/rust/build.rs @@ -0,0 +1,66 @@ +use std::env; +use std::path::{Path, PathBuf}; + +fn env_path(name: &str) -> Option { + env::var_os(name).map(PathBuf::from) +} + +fn default_include_dir(manifest_dir: &Path) -> PathBuf { + manifest_dir.join("..").join("cpp").join("include") +} + +fn main() { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is set")); + let include_dir = env_path("CUGRAPH_INCLUDE_DIR").unwrap_or_else(|| default_include_dir(&manifest_dir)); + + if !include_dir.exists() { + panic!( + "CUGRAPH include dir does not exist: {}. Set CUGRAPH_INCLUDE_DIR.", + include_dir.display() + ); + } + + let wrapper = manifest_dir.join("wrapper.h"); + let out_path = PathBuf::from(env::var("OUT_DIR").expect("OUT_DIR is set")).join("bindgen.rs"); + + println!("cargo:rerun-if-changed={}", wrapper.display()); + println!("cargo:rerun-if-env-changed=CUGRAPH_INCLUDE_DIR"); + println!("cargo:rerun-if-env-changed=CUGRAPH_LIB_DIR"); + println!("cargo:rerun-if-env-changed=CUGRAPH_EXPORT_BINDINGS"); + + let bindings = bindgen::Builder::default() + .header(wrapper.to_string_lossy()) + .clang_arg(format!("-I{}", include_dir.display())) + .allowlist_type("cugraph_.*") + .allowlist_type("bool_t") + .allowlist_type("byte_t") + .allowlist_var("CUGRAPH_.*") + .allowlist_var("FALSE|TRUE") + .allowlist_var("INT8|INT16|INT32|INT64|UINT8|UINT16|UINT32|UINT64|FLOAT32|FLOAT64|SIZE_T|BOOL|NTYPES") + .allowlist_function("cugraph_.*") + .derive_default(true) + .generate_comments(true) + .layout_tests(false) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) + .generate() + .expect("Unable to generate libcugraph_c bindings"); + + bindings + .write_to_file(&out_path) + .expect("Unable to write generated bindings"); + + if let Some(export_path) = env_path("CUGRAPH_EXPORT_BINDINGS") { + bindings + .write_to_file(&export_path) + .expect("Unable to export generated bindings"); + println!("cargo:warning=Exported bindings to {}", export_path.display()); + } + + if env::var_os("CARGO_FEATURE_RUNTIME_LINK").is_some() { + if let Some(lib_dir) = env_path("CUGRAPH_LIB_DIR") { + println!("cargo:rustc-link-search=native={}", lib_dir.display()); + } + + println!("cargo:rustc-link-lib=dylib=cugraph_c"); + } +} diff --git a/rust/examples/resource_handle.rs b/rust/examples/resource_handle.rs new file mode 100644 index 00000000000..a6d575e973c --- /dev/null +++ b/rust/examples/resource_handle.rs @@ -0,0 +1,21 @@ +#[cfg(feature = "runtime-link")] +fn main() { + unsafe { + let handle = libcugraph_c_sys::cugraph_create_resource_handle(std::ptr::null_mut()); + if handle.is_null() { + eprintln!("failed to create resource handle"); + std::process::exit(1); + } + + let rank = libcugraph_c_sys::cugraph_resource_handle_get_rank(handle); + let size = libcugraph_c_sys::cugraph_resource_handle_get_comm_size(handle); + println!("created resource handle (rank={rank}, size={size})"); + + libcugraph_c_sys::cugraph_free_resource_handle(handle); + } +} + +#[cfg(not(feature = "runtime-link"))] +fn main() { + println!("Enable feature runtime-link to run this example against libcugraph_c"); +} diff --git a/rust/src/lib.rs b/rust/src/lib.rs new file mode 100644 index 00000000000..310041aa37b --- /dev/null +++ b/rust/src/lib.rs @@ -0,0 +1,24 @@ +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] + +use std::ffi::CStr; + +include!(concat!(env!("OUT_DIR"), "/bindgen.rs")); + +/// Convert a cugraph error object into an owned Rust string. +/// +/// # Safety +/// The pointer must either be null or point to a valid `cugraph_error_t` object. +pub unsafe fn error_message_owned(error: *const cugraph_error_t) -> Option { + if error.is_null() { + return None; + } + + let ptr = cugraph_error_message(error); + if ptr.is_null() { + return None; + } + + Some(CStr::from_ptr(ptr).to_string_lossy().into_owned()) +} diff --git a/rust/tests/abi_surface.rs b/rust/tests/abi_surface.rs new file mode 100644 index 00000000000..a212a74c8d8 --- /dev/null +++ b/rust/tests/abi_surface.rs @@ -0,0 +1,26 @@ +use static_assertions::assert_type_eq_all; + +#[test] +fn exposes_expected_core_types() { + assert_type_eq_all!(libcugraph_c_sys::byte_t, i8); + assert_eq!( + std::mem::size_of::(), + std::mem::size_of::() + ); +} + +#[test] +fn exposes_expected_core_constants() { + assert_eq!( + libcugraph_c_sys::cugraph_error_code__CUGRAPH_SUCCESS as u32, + 0 + ); +} + +#[test] +fn can_reference_key_symbols() { + let _ = libcugraph_c_sys::cugraph_create_resource_handle as usize; + let _ = libcugraph_c_sys::cugraph_free_resource_handle as usize; + let _ = libcugraph_c_sys::cugraph_error_message as usize; + let _ = libcugraph_c_sys::cugraph_error_free as usize; +} diff --git a/rust/tests/runtime_smoke.rs b/rust/tests/runtime_smoke.rs new file mode 100644 index 00000000000..d80f123b171 --- /dev/null +++ b/rust/tests/runtime_smoke.rs @@ -0,0 +1,21 @@ +#[cfg(feature = "runtime-link")] +#[test] +fn create_and_free_resource_handle() { + unsafe { + let handle = libcugraph_c_sys::cugraph_create_resource_handle(std::ptr::null_mut()); + assert!(!handle.is_null(), "expected a non-null resource handle"); + + let rank = libcugraph_c_sys::cugraph_resource_handle_get_rank(handle); + let size = libcugraph_c_sys::cugraph_resource_handle_get_comm_size(handle); + assert!(rank >= 0); + assert!(size >= 1); + + libcugraph_c_sys::cugraph_free_resource_handle(handle); + } +} + +#[cfg(not(feature = "runtime-link"))] +#[test] +fn runtime_smoke_requires_runtime_link_feature() { + eprintln!("Skipping runtime smoke: run with --features runtime-link"); +} diff --git a/rust/wrapper.h b/rust/wrapper.h new file mode 100644 index 00000000000..702c06bcb82 --- /dev/null +++ b/rust/wrapper.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include From fb059549917619d449b16b35fcbe6a4fbf2d1252 Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Thu, 9 Jul 2026 13:44:39 -0400 Subject: [PATCH 2/7] updates --- rust/src/lib.rs | 2 + rust/src/safe.rs | 496 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 498 insertions(+) create mode 100644 rust/src/safe.rs diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 310041aa37b..bf542ecc959 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -6,6 +6,8 @@ use std::ffi::CStr; include!(concat!(env!("OUT_DIR"), "/bindgen.rs")); +pub mod safe; + /// Convert a cugraph error object into an owned Rust string. /// /// # Safety diff --git a/rust/src/safe.rs b/rust/src/safe.rs new file mode 100644 index 00000000000..2b7097b7d37 --- /dev/null +++ b/rust/src/safe.rs @@ -0,0 +1,496 @@ +use std::fmt; +use std::ptr; + +use crate::*; + +#[derive(Debug)] +pub struct CugraphError { + pub code: cugraph_error_code_t, + pub message: Option, +} + +impl fmt::Display for CugraphError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match &self.message { + Some(message) => write!(f, "cuGraph error {:?}: {}", self.code, message), + None => write!(f, "cuGraph error {:?}", self.code), + } + } +} + +impl std::error::Error for CugraphError {} + +type Result = std::result::Result; + +#[allow(non_upper_case_globals)] +const cugraph_error_code_enum__CUGRAPH_SUCCESS: cugraph_error_code_t = + cugraph_error_code__CUGRAPH_SUCCESS; +#[allow(non_upper_case_globals)] +const cugraph_error_code_enum__CUGRAPH_UNKNOWN_ERROR: cugraph_error_code_t = + cugraph_error_code__CUGRAPH_UNKNOWN_ERROR; +#[allow(non_upper_case_globals)] +const cugraph_error_code_enum__CUGRAPH_INVALID_INPUT: cugraph_error_code_t = + cugraph_error_code__CUGRAPH_INVALID_INPUT; + +fn status_ok(status: cugraph_error_code_t) -> bool { + status == cugraph_error_code_enum__CUGRAPH_SUCCESS +} + +fn bool_t_from_bool(value: bool) -> bool_t { + if value { + bool__TRUE + } else { + bool__FALSE + } +} + +fn check_status(status: cugraph_error_code_t, error: *mut cugraph_error_t) -> Result<()> { + if status_ok(status) { + return Ok(()); + } + + let message = unsafe { error_message_owned(error as *const cugraph_error_t) }; + if !error.is_null() { + unsafe { cugraph_error_free(error) }; + } + Err(CugraphError { code: status, message }) +} + +pub struct ResourceHandle { + raw: *mut cugraph_resource_handle_t, +} + +impl ResourceHandle { + pub fn new() -> Result { + let raw = unsafe { cugraph_create_resource_handle(ptr::null_mut()) }; + if raw.is_null() { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_UNKNOWN_ERROR, + message: Some("failed to create cugraph resource handle".to_string()), + }); + } + Ok(Self { raw }) + } + + pub fn as_ptr(&self) -> *const cugraph_resource_handle_t { + self.raw as *const cugraph_resource_handle_t + } +} + +impl Drop for ResourceHandle { + fn drop(&mut self) { + if !self.raw.is_null() { + unsafe { cugraph_free_resource_handle(self.raw) }; + } + } +} + +pub struct DeviceArray { + raw: *mut cugraph_type_erased_device_array_t, +} + +impl DeviceArray { + pub fn from_host_slice( + handle: &ResourceHandle, + data: &[T], + dtype: cugraph_data_type_id_t, + ) -> Result { + let mut array = ptr::null_mut(); + let mut error = ptr::null_mut(); + let status = unsafe { + cugraph_type_erased_device_array_create( + handle.as_ptr(), + data.len(), + dtype, + &mut array, + &mut error, + ) + }; + check_status(status, error)?; + + let view = unsafe { cugraph_type_erased_device_array_view(array) }; + if view.is_null() { + unsafe { cugraph_type_erased_device_array_free(array) }; + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_UNKNOWN_ERROR, + message: Some("failed to create device array view".to_string()), + }); + } + + let mut copy_error = ptr::null_mut(); + let copy_status = unsafe { + cugraph_type_erased_device_array_view_copy_from_host( + handle.as_ptr(), + view, + data.as_ptr() as *const byte_t, + &mut copy_error, + ) + }; + + unsafe { + cugraph_type_erased_device_array_view_free(view); + } + + check_status(copy_status, copy_error)?; + + Ok(Self { raw: array }) + } + + pub fn view(&self) -> *mut cugraph_type_erased_device_array_view_t { + unsafe { cugraph_type_erased_device_array_view(self.raw) } + } +} + +impl Drop for DeviceArray { + fn drop(&mut self) { + if !self.raw.is_null() { + unsafe { cugraph_type_erased_device_array_free(self.raw) }; + } + } +} + +pub struct Graph { + raw: *mut cugraph_graph_t, +} + +impl Graph { + pub fn as_ptr_mut(&mut self) -> *mut cugraph_graph_t { + self.raw + } +} + +impl Drop for Graph { + fn drop(&mut self) { + if !self.raw.is_null() { + unsafe { cugraph_graph_free(self.raw) }; + } + } +} + +#[derive(Clone, Copy, Debug)] +pub struct GraphBuildOptions { + pub is_symmetric: bool, + pub is_multigraph: bool, + pub store_transposed: bool, + pub renumber: bool, + pub drop_self_loops: bool, + pub drop_multi_edges: bool, + pub symmetrize: bool, + pub do_expensive_check: bool, +} + +impl Default for GraphBuildOptions { + fn default() -> Self { + Self { + is_symmetric: false, + is_multigraph: false, + store_transposed: false, + renumber: true, + drop_self_loops: false, + drop_multi_edges: false, + symmetrize: false, + do_expensive_check: false, + } + } +} + +#[derive(Clone, Debug)] +pub struct CscInput<'a, V, W> { + pub row: &'a [V], + pub colptr: &'a [V], + pub num_dst_vertices: usize, + pub weights: Option<&'a [W]>, +} + +impl<'a, V, W> CscInput<'a, V, W> +where + V: Copy + TryInto, +{ + pub fn validate(&self) -> Result<()> { + if self.colptr.len() != self.num_dst_vertices + 1 { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("colptr length must be num_dst_vertices + 1".to_string()), + }); + } + + let nnz = self + .colptr + .get(self.num_dst_vertices) + .and_then(|v| (*v).try_into().ok()) + .ok_or_else(|| CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("invalid terminal colptr value".to_string()), + })?; + + if self.row.len() != nnz { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("row length must equal colptr[num_dst_vertices]".to_string()), + }); + } + + if let Some(weights) = self.weights { + if weights.len() != nnz { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("weights length must equal nnz".to_string()), + }); + } + } + + Ok(()) + } +} + +pub fn expand_csc_to_coo_dst(colptr: &[V], num_dst_vertices: usize) -> Result> +where + V: Copy + TryInto + TryFrom, +{ + if colptr.len() != num_dst_vertices + 1 { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("colptr length must be num_dst_vertices + 1".to_string()), + }); + } + + let nnz = colptr[num_dst_vertices] + .try_into() + .map_err(|_| CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("invalid terminal colptr value".to_string()), + })?; + + let mut dst = Vec::with_capacity(nnz); + for j in 0..num_dst_vertices { + let start = colptr[j].try_into().map_err(|_| CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("invalid colptr start value".to_string()), + })?; + let end = colptr[j + 1].try_into().map_err(|_| CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("invalid colptr end value".to_string()), + })?; + if end < start { + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("colptr must be non-decreasing".to_string()), + }); + } + + let dst_id = V::try_from(j).map_err(|_| CugraphError { + code: cugraph_error_code_enum__CUGRAPH_INVALID_INPUT, + message: Some("failed to cast destination id to vertex dtype".to_string()), + })?; + + for _ in start..end { + dst.push(dst_id); + } + } + + Ok(dst) +} + +pub struct CscGraphArtifacts { + pub graph: Graph, + pub src: DeviceArray, + pub dst: DeviceArray, + pub weights: Option, +} + +pub fn build_graph_from_csc_as_edgelist( + handle: &ResourceHandle, + input: &CscInput<'_, V, W>, + vertex_dtype: cugraph_data_type_id_t, + weight_dtype: cugraph_data_type_id_t, + options: GraphBuildOptions, +) -> Result +where + V: Copy + TryInto + TryFrom, + W: Copy, +{ + input.validate()?; + + let dst_host = expand_csc_to_coo_dst(input.colptr, input.num_dst_vertices)?; + let src = DeviceArray::from_host_slice(handle, input.row, vertex_dtype)?; + let dst = DeviceArray::from_host_slice(handle, &dst_host, vertex_dtype)?; + let weights = match input.weights { + Some(w) => Some(DeviceArray::from_host_slice(handle, w, weight_dtype)?), + None => None, + }; + + let src_view = src.view(); + let dst_view = dst.view(); + let weights_view = match &weights { + Some(w) => w.view(), + None => ptr::null_mut(), + }; + + if src_view.is_null() || dst_view.is_null() || (weights.is_some() && weights_view.is_null()) { + unsafe { + if !src_view.is_null() { + cugraph_type_erased_device_array_view_free(src_view); + } + if !dst_view.is_null() { + cugraph_type_erased_device_array_view_free(dst_view); + } + if !weights_view.is_null() { + cugraph_type_erased_device_array_view_free(weights_view); + } + } + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_UNKNOWN_ERROR, + message: Some("failed to create one or more device views".to_string()), + }); + } + + let properties = cugraph_graph_properties_t { + is_symmetric: bool_t_from_bool(options.is_symmetric), + is_multigraph: bool_t_from_bool(options.is_multigraph), + }; + + let mut graph_ptr = ptr::null_mut(); + let mut error = ptr::null_mut(); + let status = unsafe { + cugraph_graph_create_sg( + handle.as_ptr(), + &properties, + ptr::null(), + src_view, + dst_view, + weights_view, + ptr::null(), + ptr::null(), + bool_t_from_bool(options.store_transposed), + bool_t_from_bool(options.renumber), + bool_t_from_bool(options.drop_self_loops), + bool_t_from_bool(options.drop_multi_edges), + bool_t_from_bool(options.symmetrize), + bool_t_from_bool(options.do_expensive_check), + &mut graph_ptr, + &mut error, + ) + }; + + unsafe { + cugraph_type_erased_device_array_view_free(src_view); + cugraph_type_erased_device_array_view_free(dst_view); + if !weights_view.is_null() { + cugraph_type_erased_device_array_view_free(weights_view); + } + } + + check_status(status, error)?; + + Ok(CscGraphArtifacts { + graph: Graph { raw: graph_ptr }, + src, + dst, + weights, + }) +} + +pub struct CsrGraphArtifacts { + pub graph: Graph, + pub offsets: DeviceArray, + pub indices: DeviceArray, + pub weights: Option, +} + +pub fn build_graph_from_csc_as_csr( + handle: &ResourceHandle, + input: &CscInput<'_, V, W>, + vertex_dtype: cugraph_data_type_id_t, + weight_dtype: cugraph_data_type_id_t, + options: GraphBuildOptions, +) -> Result +where + V: Copy + TryInto, + W: Copy, +{ + input.validate()?; + + let offsets = DeviceArray::from_host_slice(handle, input.colptr, vertex_dtype)?; + let indices = DeviceArray::from_host_slice(handle, input.row, vertex_dtype)?; + let weights = match input.weights { + Some(w) => Some(DeviceArray::from_host_slice(handle, w, weight_dtype)?), + None => None, + }; + + let offsets_view = offsets.view(); + let indices_view = indices.view(); + let weights_view = match &weights { + Some(w) => w.view(), + None => ptr::null_mut(), + }; + if offsets_view.is_null() + || indices_view.is_null() + || (weights.is_some() && weights_view.is_null()) + { + unsafe { + if !offsets_view.is_null() { + cugraph_type_erased_device_array_view_free(offsets_view); + } + if !indices_view.is_null() { + cugraph_type_erased_device_array_view_free(indices_view); + } + if !weights_view.is_null() { + cugraph_type_erased_device_array_view_free(weights_view); + } + } + return Err(CugraphError { + code: cugraph_error_code_enum__CUGRAPH_UNKNOWN_ERROR, + message: Some("failed to create one or more device views".to_string()), + }); + } + + let properties = cugraph_graph_properties_t { + is_symmetric: bool_t_from_bool(options.is_symmetric), + is_multigraph: bool_t_from_bool(options.is_multigraph), + }; + + let mut graph_ptr = ptr::null_mut(); + let mut error = ptr::null_mut(); + let status = unsafe { + cugraph_graph_create_sg_from_csr( + handle.as_ptr(), + &properties, + offsets_view, + indices_view, + weights_view, + ptr::null(), + ptr::null(), + bool_t_from_bool(options.store_transposed), + bool_t_from_bool(options.renumber), + bool_t_from_bool(options.symmetrize), + bool_t_from_bool(options.do_expensive_check), + &mut graph_ptr, + &mut error, + ) + }; + + unsafe { + cugraph_type_erased_device_array_view_free(offsets_view); + cugraph_type_erased_device_array_view_free(indices_view); + if !weights_view.is_null() { + cugraph_type_erased_device_array_view_free(weights_view); + } + } + + check_status(status, error)?; + + Ok(CsrGraphArtifacts { + graph: Graph { raw: graph_ptr }, + offsets, + indices, + weights, + }) +} + +pub fn default_vertex_dtype_i64() -> cugraph_data_type_id_t { + data_type_id__INT64 +} + +pub fn default_weight_dtype_f32() -> cugraph_data_type_id_t { + data_type_id__FLOAT32 +} From d93012fc3398897a27dfb3eb9d45d884106110f3 Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Wed, 15 Jul 2026 10:38:30 -0400 Subject: [PATCH 3/7] working on better text --- rust/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/README.md b/rust/README.md index b9edbb892ec..c7729fa0a2c 100644 --- a/rust/README.md +++ b/rust/README.md @@ -5,6 +5,13 @@ This folder contains a minimal Rust setup to generate FFI bindings for It is intentionally low-level and does not provide a high-level Rust wrapper. +## Not a library +This collection of code provides C API headers and illustrative examples for users seeking to take advantage of the performance capabilities of GPU-accelerated cuGraph. It is not intended to serve as a standalone library; rather, it comprises components that developers may incorporate into their own codebases. +This code is provided on an “as is” basis and should be regarded as a foundation for further development, adaptation, and customization. + + + + ## What this provides - `bindgen`-based generation from headers under `cpp/include/cugraph_c` From 5587b9a578cbdad5aea2ce119e2f7aedaf6fb495 Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Fri, 17 Jul 2026 08:53:40 -0400 Subject: [PATCH 4/7] adding a PageRank example --- rust/Cargo.lock | 1374 +++++++++++++++++++++- rust/Cargo.toml | 6 + rust/HOWTO.md | 2 +- rust/README.md | 4 +- rust/examples/pagerank_example.rs | 304 +++++ rust/examples/resource_handle.rs | 21 - rust/examples/resource_handle_example.rs | 20 + rust/examples/utils/datareader.rs | 85 ++ rust/examples/utils/mod.rs | 10 + rust/examples/utils/paths.rs | 8 + rust/examples/utils/resource_handle.rs | 27 + 11 files changed, 1814 insertions(+), 47 deletions(-) create mode 100644 rust/examples/pagerank_example.rs delete mode 100644 rust/examples/resource_handle.rs create mode 100644 rust/examples/resource_handle_example.rs create mode 100644 rust/examples/utils/datareader.rs create mode 100644 rust/examples/utils/mod.rs create mode 100644 rust/examples/utils/paths.rs create mode 100644 rust/examples/utils/resource_handle.rs diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 65e520f510d..9619f158083 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -2,6 +2,19 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.4" @@ -11,6 +24,67 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "argminmax" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f13d10a41ac8d2ec79ee34178d61e6f47a29c2edfe7ef1721c7383b0359e65" +dependencies = [ + "num-traits", +] + +[[package]] +name = "array-init-cursor" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed51fe0f224d1d4ea768be38c51f9f831dee9d05c163c11fba0b8c44387b1fc3" + +[[package]] +name = "arrow-format" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07884ea216994cdc32a2d5f8274a8bee979cfe90274b83f86f440866ee3132c7" +dependencies = [ + "planus", + "serde", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atoi_simd" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae037714f313c1353189ead58ef9eec30a8e8dc101b2622d461418fd59e28a9" + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + [[package]] name = "bindgen" version = "0.69.4" @@ -27,8 +101,8 @@ dependencies = [ "quote", "regex", "rustc-hash", - "shlex", - "syn", + "shlex 1.3.0", + "syn 2.0.118", ] [[package]] @@ -37,6 +111,50 @@ version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "bytemuck" +version = "1.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6aedf8ae72766347502cf3cb4f41cf5e9cc37d28bee90f1fdaaae15f9cf9424" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f65693059b6b9c588b9f62fed1cedbf0a8b805631457ea162d68f0de186f3de5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex 2.0.1", +] + [[package]] name = "cexpr" version = "0.6.0" @@ -52,6 +170,17 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "num-traits", + "windows-link", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -63,18 +192,241 @@ dependencies = [ "libloading", ] +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "ethnum" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0198b9d0078e0f30dedc7acbb21c974e838fc8fae3ee170128658a98cb2c1c04" + +[[package]] +name = "fast-float" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "foreign_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee1b05cbd864bcaecbd3455d6d967862d446e4ebfc3c2e5e5b9841e53cba6673" + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + [[package]] name = "glob" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", + "rayon", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "indexmap" +version = "2.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", +] + [[package]] name = "itertools" version = "0.12.1" @@ -84,6 +436,33 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -107,6 +486,12 @@ name = "libcugraph-c-sys" version = "0.1.0" dependencies = [ "bindgen", + "ethnum", + "home", + "indexmap", + "polars", + "rayon", + "rayon-core", "static_assertions", ] @@ -120,18 +505,80 @@ dependencies = [ "windows-link", ] +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "lz4" +version = "1.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20b523e860d03443e98350ceaac5e71c6ba89aea7d960769ec3ce37f4de5af4" +dependencies = [ + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.11.1+lz4-1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "memchr" version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" +[[package]] +name = "memmap2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" +dependencies = [ + "libc", +] + [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "multiversion" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4851161a11d3ad0bf9402d90ffc3967bf231768bfd7aeb61755ad06dbf1a142" +dependencies = [ + "multiversion-macros", + "target-features", +] + +[[package]] +name = "multiversion-macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79a74ddee9e0c27d2578323c13905793e91622148f138ba29738f9dddb835e90" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "target-features", +] + [[package]] name = "nom" version = "7.1.3" @@ -143,43 +590,460 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.106" +name = "now" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "6d89e9874397a1f0a52fc1f197a8effd9735223cb2390e9dcc83ac6cd02923d0" dependencies = [ - "unicode-ident", + "chrono", ] [[package]] -name = "quote" -version = "1.0.46" +name = "ntapi" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +checksum = "c3b335231dfd352ffb0f8017f3b6027a4917f7df785ea2143d8af2adc66980ae" dependencies = [ - "proc-macro2", + "winapi", ] [[package]] -name = "regex" -version = "1.12.4" +name = "num-traits" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "autocfg", + "libm", ] [[package]] -name = "regex-automata" -version = "0.4.14" +name = "once_cell" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "planus" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1691dd09e82f428ce8d6310bd6d5da2557c82ff17694d2a32cad7242aea89f" +dependencies = [ + "array-init-cursor", +] + +[[package]] +name = "polars" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8e52f9236eb722da0990a70bbb1216dcc7a77bcb00c63439d2d982823e90d5" +dependencies = [ + "getrandom 0.2.17", + "polars-core", + "polars-io", + "polars-lazy", + "polars-ops", + "polars-sql", + "version_check", +] + +[[package]] +name = "polars-arrow" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd503430a6d9779b07915d858865fe998317ef3cfef8973881f578ac5d4baae7" +dependencies = [ + "ahash", + "arrow-format", + "atoi_simd", + "bytemuck", + "chrono", + "dyn-clone", + "either", + "ethnum", + "fast-float", + "foreign_vec", + "getrandom 0.2.17", + "hashbrown 0.14.5", + "itoa", + "lz4", + "multiversion", + "num-traits", + "polars-error", + "polars-utils", + "rustc_version", + "ryu", + "simdutf8", + "streaming-iterator", + "strength_reduce", + "zstd", +] + +[[package]] +name = "polars-core" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae73d5b8e55decde670caba1cc82b61f14bfb9a72503198f0997d657a98dcfd6" +dependencies = [ + "ahash", + "bitflags", + "bytemuck", + "chrono", + "either", + "hashbrown 0.14.5", + "indexmap", + "num-traits", + "once_cell", + "polars-arrow", + "polars-error", + "polars-row", + "polars-utils", + "rand", + "rand_distr", + "rayon", + "regex", + "smartstring", + "thiserror", + "version_check", + "xxhash-rust", +] + +[[package]] +name = "polars-error" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb0520d68eaa9993ae0c741409d1526beff5b8f48e1d73e4381616f8152cf488" +dependencies = [ + "arrow-format", + "regex", + "simdutf8", + "thiserror", +] + +[[package]] +name = "polars-io" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96e10a0745acd6009db64bef0ceb9e23a70b1c27b26a0a6517c91f3e6363bc06" +dependencies = [ + "ahash", + "atoi_simd", + "bytes", + "fast-float", + "home", + "itoa", + "memchr", + "memmap2", + "num-traits", + "once_cell", + "percent-encoding", + "polars-arrow", + "polars-core", + "polars-error", + "polars-utils", + "rayon", + "regex", + "ryu", + "simdutf8", + "smartstring", +] + +[[package]] +name = "polars-lazy" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3555f759705be6dd0d3762d16a0b8787b2dc4da73b57465f3b2bf1a070ba8f20" +dependencies = [ + "ahash", + "bitflags", + "glob", + "once_cell", + "polars-arrow", + "polars-core", + "polars-io", + "polars-ops", + "polars-pipe", + "polars-plan", + "polars-time", + "polars-utils", + "rayon", + "smartstring", + "version_check", +] + +[[package]] +name = "polars-ops" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a7eb218296aaa7f79945f08288ca32ca3cf25fa505649eeee689ec21eebf636" +dependencies = [ + "ahash", + "argminmax", + "bytemuck", + "either", + "hashbrown 0.14.5", + "indexmap", + "memchr", + "num-traits", + "polars-arrow", + "polars-core", + "polars-error", + "polars-utils", + "rayon", + "regex", + "smartstring", + "version_check", +] + +[[package]] +name = "polars-pipe" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66094e7df64c932a9a7bdfe7df0c65efdcb192096e11a6a765a9778f78b4bdec" +dependencies = [ + "crossbeam-channel", + "crossbeam-queue", + "enum_dispatch", + "hashbrown 0.14.5", + "num-traits", + "polars-arrow", + "polars-core", + "polars-io", + "polars-ops", + "polars-plan", + "polars-row", + "polars-utils", + "rayon", + "smartstring", + "version_check", +] + +[[package]] +name = "polars-plan" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10e32a0958ef854b132bad7f8369cb3237254635d5e864c99505bc0bc1035fbc" +dependencies = [ + "ahash", + "bytemuck", + "once_cell", + "percent-encoding", + "polars-arrow", + "polars-core", + "polars-io", + "polars-ops", + "polars-time", + "polars-utils", + "rayon", + "regex", + "smartstring", + "strum_macros", + "version_check", +] + +[[package]] +name = "polars-row" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135ab81cac2906ba74ea8984c7e6025d081ae5867615bcefb4d84dfdb456dac" +dependencies = [ + "polars-arrow", + "polars-error", + "polars-utils", +] + +[[package]] +name = "polars-sql" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dbd7786849a5e3ad1fde188bf38141632f626e3a57319b0bbf7a5f1d75519e" +dependencies = [ + "polars-arrow", + "polars-core", + "polars-error", + "polars-lazy", + "polars-plan", + "rand", + "serde", + "serde_json", + "sqlparser", +] + +[[package]] +name = "polars-time" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae56f79e9cedd617773c1c8f5ca84a31a8b1d593714959d5f799e7bdd98fe51" +dependencies = [ + "atoi", + "chrono", + "now", + "once_cell", + "polars-arrow", + "polars-core", + "polars-error", + "polars-ops", + "polars-utils", + "regex", + "smartstring", +] + +[[package]] +name = "polars-utils" +version = "0.35.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da6ce68169fe61d46958c8eab7447360f30f2f23f6e24a0ce703a14b0a3cfbfc" +dependencies = [ + "ahash", + "bytemuck", + "hashbrown 0.14.5", + "indexmap", + "num-traits", + "once_cell", + "polars-error", + "rayon", + "smartstring", + "sysinfo", + "version_check", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] @@ -195,18 +1059,162 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + +[[package]] +name = "sqlparser" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743b4dc2cbde11890ccb254a8fc9d537fa41b36da00de2a1c5e9848c9bc42bd7" +dependencies = [ + "log", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" + +[[package]] +name = "strength_reduce" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe895eb47f22e2ddd4dabc02bce419d2e643c8e3b585c78158b349195bc24d82" + +[[package]] +name = "strum_macros" +version = "0.25.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.118", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.118" @@ -218,14 +1226,334 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sysinfo" +version = "0.29.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "libc", + "ntapi", + "once_cell", + "winapi", +] + +[[package]] +name = "target-features" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.118", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "windows-link" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "xxhash-rust" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985eec839aaf2a1270af8f4ebcf63cf9401cfd90f0902f97c28d9f104ffbde72" + +[[package]] +name = "zerocopy" +version = "0.8.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index b30ac987d47..8040a385ed4 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -16,3 +16,9 @@ bindgen = { version = "=0.69.4", default-features = false, features = ["runtime" [dev-dependencies] static_assertions = "1.1" +polars = { version = "=0.35.4", default-features = false, features = ["csv"] } +home = "=0.5.9" +indexmap = "=2.11.4" +rayon = "=1.10.0" +rayon-core = "=1.12.1" +ethnum = "=1.3.2" diff --git a/rust/HOWTO.md b/rust/HOWTO.md index 52a588251b3..1c1a8fb8a5f 100644 --- a/rust/HOWTO.md +++ b/rust/HOWTO.md @@ -34,7 +34,7 @@ The include root must contain `cugraph_c/*.h`. ## 4) Run runtime example (links to libcugraph_c) ```bash -CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle --features runtime-link +CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle_example --features runtime-link ``` ## 5) Run tests diff --git a/rust/README.md b/rust/README.md index c7729fa0a2c..b04c3c4725e 100644 --- a/rust/README.md +++ b/rust/README.md @@ -25,7 +25,7 @@ This code is provided on an “as is” basis and should be regarded as a founda - `build.rs` : runs bindgen and (optionally) emits linker directives - `wrapper.h` : aggregation header including the full C API surface - `src/lib.rs` : includes generated bindings and one small utility helper -- `examples/resource_handle.rs` : minimal runtime example +- `examples/resource_handle_example.rs` : minimal runtime example - `tests/abi_surface.rs` : compile-time shape checks - `tests/runtime_smoke.rs` : runtime smoke test (feature-gated) @@ -61,7 +61,7 @@ This runs `build.rs`, which generates `bindgen.rs` into Cargo `OUT_DIR`. ## Run example with runtime linking ```bash -CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle --features runtime-link +CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle_example --features runtime-link ``` ## Run tests diff --git a/rust/examples/pagerank_example.rs b/rust/examples/pagerank_example.rs new file mode 100644 index 00000000000..85f07b27b49 --- /dev/null +++ b/rust/examples/pagerank_example.rs @@ -0,0 +1,304 @@ +mod utils; + +#[cfg(feature = "runtime-link")] +fn main() { + use libcugraph_c_sys::{ + cugraph_centrality_result_free, cugraph_centrality_result_get_values, + cugraph_centrality_result_get_vertices, cugraph_centrality_result_t, cugraph_error_free, + cugraph_error_t, cugraph_graph_create_sg, cugraph_graph_free, cugraph_graph_properties_t, + cugraph_graph_t, cugraph_pagerank, cugraph_type_erased_device_array_create, + cugraph_type_erased_device_array_free, cugraph_type_erased_device_array_t, + cugraph_type_erased_device_array_view, cugraph_type_erased_device_array_view_copy_from_host, + cugraph_type_erased_device_array_view_copy_to_host, cugraph_type_erased_device_array_view_size, + cugraph_error_code__CUGRAPH_SUCCESS, data_type_id__FLOAT32, data_type_id__INT32, + }; + use polars::prelude::DataType; + use std::ptr; + + fn free_error(err: &mut *mut cugraph_error_t) { + if !(*err).is_null() { + unsafe { + cugraph_error_free(*err); + } + *err = ptr::null_mut(); + } + } + + fn check_status( + code: libcugraph_c_sys::cugraph_error_code_t, + err: &mut *mut cugraph_error_t, + context: &str, + ) -> Result<(), String> { + if code == cugraph_error_code__CUGRAPH_SUCCESS { + return Ok(()); + } + + let msg = unsafe { libcugraph_c_sys::error_message_owned(*err) } + .unwrap_or_else(|| "no libcugraph error message available".to_string()); + free_error(err); + Err(format!("{context} failed: {msg}")) + } + + fn series_to_i32(series: &polars::prelude::Series, name: &str) -> Result, String> { + let casted = series + .cast(&DataType::Int32) + .map_err(|e| format!("failed casting {name} to Int32: {e}"))?; + Ok(casted.i32().map_err(|e| format!("failed reading {name}: {e}"))?.into_no_null_iter().collect()) + } + + fn series_to_f32(series: &polars::prelude::Series, name: &str) -> Result, String> { + let casted = series + .cast(&DataType::Float32) + .map_err(|e| format!("failed casting {name} to Float32: {e}"))?; + Ok(casted + .f32() + .map_err(|e| format!("failed reading {name}: {e}"))? + .into_no_null_iter() + .collect()) + } + + let mut err: *mut cugraph_error_t = ptr::null_mut(); + let mut src_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut dst_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut wt_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut graph: *mut cugraph_graph_t = ptr::null_mut(); + let mut result: *mut cugraph_centrality_result_t = ptr::null_mut(); + + let handle = match utils::create_resource_handle() { + Ok(h) => h, + Err(e) => { + eprintln!("{e}"); + std::process::exit(1); + } + }; + + let run_result = (|| -> Result<(), String> { + let (src_df, dst_df, wt_df) = + utils::read_triplet_dataframes("karate.csv", Some("../datasets")).map_err(|e| e.to_string())?; + + let src = series_to_i32( + src_df + .column("src") + .map_err(|e| format!("missing src column: {e}"))?, + "src", + )?; + let dst = series_to_i32( + dst_df + .column("dst") + .map_err(|e| format!("missing dst column: {e}"))?, + "dst", + )?; + let wt = series_to_f32( + wt_df + .column("wt") + .map_err(|e| format!("missing wt column: {e}"))?, + "wt", + )?; + + if src.len() != dst.len() || src.len() != wt.len() { + return Err("src, dst, wt column lengths must match".to_string()); + } + + let (vertices_host, pagerank_host, n) = unsafe { + check_status( + cugraph_type_erased_device_array_create( + handle, + src.len(), + data_type_id__INT32, + &mut src_dev, + &mut err, + ), + &mut err, + "create src device array", + )?; + + check_status( + cugraph_type_erased_device_array_create( + handle, + dst.len(), + data_type_id__INT32, + &mut dst_dev, + &mut err, + ), + &mut err, + "create dst device array", + )?; + + check_status( + cugraph_type_erased_device_array_create( + handle, + wt.len(), + data_type_id__FLOAT32, + &mut wt_dev, + &mut err, + ), + &mut err, + "create wt device array", + )?; + + let src_view = cugraph_type_erased_device_array_view(src_dev); + let dst_view = cugraph_type_erased_device_array_view(dst_dev); + let wt_view = cugraph_type_erased_device_array_view(wt_dev); + + check_status( + cugraph_type_erased_device_array_view_copy_from_host( + handle, + src_view, + src.as_ptr() as *const libcugraph_c_sys::byte_t, + &mut err, + ), + &mut err, + "copy src to device", + )?; + + check_status( + cugraph_type_erased_device_array_view_copy_from_host( + handle, + dst_view, + dst.as_ptr() as *const libcugraph_c_sys::byte_t, + &mut err, + ), + &mut err, + "copy dst to device", + )?; + + check_status( + cugraph_type_erased_device_array_view_copy_from_host( + handle, + wt_view, + wt.as_ptr() as *const libcugraph_c_sys::byte_t, + &mut err, + ), + &mut err, + "copy wt to device", + )?; + + let properties = cugraph_graph_properties_t { + is_symmetric: libcugraph_c_sys::bool__FALSE, + is_multigraph: libcugraph_c_sys::bool__FALSE, + }; + + check_status( + cugraph_graph_create_sg( + handle, + &properties, + ptr::null(), + src_view, + dst_view, + wt_view, + ptr::null(), + ptr::null(), + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__TRUE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + &mut graph, + &mut err, + ), + &mut err, + "create graph", + )?; + + check_status( + cugraph_pagerank( + handle, + graph, + ptr::null(), + ptr::null(), + ptr::null(), + ptr::null(), + 0.85, + 1e-6, + 100, + libcugraph_c_sys::bool__FALSE, + &mut result, + &mut err, + ), + &mut err, + "run pagerank", + )?; + + let vertices_view = cugraph_centrality_result_get_vertices(result); + let pagerank_view = cugraph_centrality_result_get_values(result); + let n = cugraph_type_erased_device_array_view_size(vertices_view); + + let mut vertices_host = vec![0i32; n]; + let mut pagerank_host = vec![0.0f32; n]; + + check_status( + cugraph_type_erased_device_array_view_copy_to_host( + handle, + vertices_host.as_mut_ptr() as *mut libcugraph_c_sys::byte_t, + vertices_view, + &mut err, + ), + &mut err, + "copy pagerank vertices to host", + )?; + + check_status( + cugraph_type_erased_device_array_view_copy_to_host( + handle, + pagerank_host.as_mut_ptr() as *mut libcugraph_c_sys::byte_t, + pagerank_view, + &mut err, + ), + &mut err, + "copy pagerank scores to host", + )?; + + (vertices_host, pagerank_host, n) + }; + + println!("Computed PageRank for {} vertices", n); + for (v, pr) in vertices_host.iter().zip(pagerank_host.iter()).take(10) { + println!("vertex={} pagerank={:.6}", v, pr); + } + + Ok(()) + })(); + + { + if !result.is_null() { + unsafe { + cugraph_centrality_result_free(result); + } + } + if !graph.is_null() { + unsafe { + cugraph_graph_free(graph); + } + } + if !src_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(src_dev); + } + } + if !dst_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(dst_dev); + } + } + if !wt_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(wt_dev); + } + } + free_error(&mut err); + } + utils::free_resource_handle(handle); + + if let Err(e) = run_result { + eprintln!("{e}"); + std::process::exit(1); + } +} + +#[cfg(not(feature = "runtime-link"))] +fn main() { + println!( + "Enable feature runtime-link to run this example against libcugraph_c (pagerank example)" + ); +} diff --git a/rust/examples/resource_handle.rs b/rust/examples/resource_handle.rs deleted file mode 100644 index a6d575e973c..00000000000 --- a/rust/examples/resource_handle.rs +++ /dev/null @@ -1,21 +0,0 @@ -#[cfg(feature = "runtime-link")] -fn main() { - unsafe { - let handle = libcugraph_c_sys::cugraph_create_resource_handle(std::ptr::null_mut()); - if handle.is_null() { - eprintln!("failed to create resource handle"); - std::process::exit(1); - } - - let rank = libcugraph_c_sys::cugraph_resource_handle_get_rank(handle); - let size = libcugraph_c_sys::cugraph_resource_handle_get_comm_size(handle); - println!("created resource handle (rank={rank}, size={size})"); - - libcugraph_c_sys::cugraph_free_resource_handle(handle); - } -} - -#[cfg(not(feature = "runtime-link"))] -fn main() { - println!("Enable feature runtime-link to run this example against libcugraph_c"); -} diff --git a/rust/examples/resource_handle_example.rs b/rust/examples/resource_handle_example.rs new file mode 100644 index 00000000000..c84872161ad --- /dev/null +++ b/rust/examples/resource_handle_example.rs @@ -0,0 +1,20 @@ +mod utils; + +#[cfg(feature = "runtime-link")] +fn main() { + match utils::create_resource_handle() { + Ok(handle) => { + println!("resource handle created"); + utils::free_resource_handle(handle); + } + Err(err) => { + eprintln!("{err}"); + std::process::exit(1); + } + } +} + +#[cfg(not(feature = "runtime-link"))] +fn main() { + println!("Enable feature runtime-link to run this example against libcugraph_c"); +} diff --git a/rust/examples/utils/datareader.rs b/rust/examples/utils/datareader.rs new file mode 100644 index 00000000000..cda41edc7e7 --- /dev/null +++ b/rust/examples/utils/datareader.rs @@ -0,0 +1,85 @@ +use polars::prelude::*; +use std::fs::File; +use std::io::{BufRead, BufReader}; +use std::path::Path; + +use super::paths::resolve_dataset_path; + +fn infer_separator(path: &Path) -> PolarsResult { + let file = File::open(path).map_err(|e| { + PolarsError::ComputeError( + format!("failed to open dataset file '{}': {e}", path.display()).into(), + ) + })?; + + let reader = BufReader::new(file); + for line in reader.lines() { + let line = line.map_err(|e| { + PolarsError::ComputeError( + format!("failed reading dataset file '{}': {e}", path.display()).into(), + ) + })?; + + let trimmed = line.trim(); + if trimmed.is_empty() { + continue; + } + + if trimmed.contains(',') { + return Ok(b','); + } + if trimmed.contains('\t') { + return Ok(b'\t'); + } + return Ok(b' '); + } + + Err(PolarsError::ComputeError( + format!("dataset file '{}' is empty", path.display()).into(), + )) +} + +/// Read an edge dataset and split it into src, dst, wt DataFrames. +/// +/// The dataset is expected to contain at least three columns in this order: +/// source vertex, destination vertex, and edge weight. +/// +/// `directory` defaults to ../datasets when `None`. +pub fn read_triplet_dataframes( + file_name: &str, + directory: Option<&str>, +) -> PolarsResult<(DataFrame, DataFrame, DataFrame)> { + let dataset_path = resolve_dataset_path(file_name, directory); + let separator = infer_separator(&dataset_path)?; + + let df = CsvReader::from_path(&dataset_path)? + .has_header(false) + .with_separator(separator) + .finish()?; + + if df.width() < 3 { + return Err(PolarsError::ComputeError( + format!( + "dataset '{}' must contain at least 3 columns (src, dst, wt), found {}", + dataset_path.display(), + df.width() + ) + .into(), + )); + } + + let src_name = df.get_columns()[0].name().to_owned(); + let dst_name = df.get_columns()[1].name().to_owned(); + let wt_name = df.get_columns()[2].name().to_owned(); + + let mut src_df = df.select([src_name.as_str()])?; + src_df.set_column_names(&["src"])?; + + let mut dst_df = df.select([dst_name.as_str()])?; + dst_df.set_column_names(&["dst"])?; + + let mut wt_df = df.select([wt_name.as_str()])?; + wt_df.set_column_names(&["wt"])?; + + Ok((src_df, dst_df, wt_df)) +} diff --git a/rust/examples/utils/mod.rs b/rust/examples/utils/mod.rs new file mode 100644 index 00000000000..de2997938fe --- /dev/null +++ b/rust/examples/utils/mod.rs @@ -0,0 +1,10 @@ +#![allow(dead_code)] +#![allow(unused_imports)] + +pub mod datareader; +pub mod paths; +pub mod resource_handle; + +pub use datareader::read_triplet_dataframes; +pub use paths::DEFAULT_DATASET_DIR; +pub use resource_handle::{create_resource_handle, free_resource_handle}; diff --git a/rust/examples/utils/paths.rs b/rust/examples/utils/paths.rs new file mode 100644 index 00000000000..adb4ae6dc8d --- /dev/null +++ b/rust/examples/utils/paths.rs @@ -0,0 +1,8 @@ +use std::path::PathBuf; + +pub const DEFAULT_DATASET_DIR: &str = "../datasets"; + +pub fn resolve_dataset_path(file_name: &str, directory: Option<&str>) -> PathBuf { + let base_dir = PathBuf::from(directory.unwrap_or(DEFAULT_DATASET_DIR)); + base_dir.join(file_name) +} diff --git a/rust/examples/utils/resource_handle.rs b/rust/examples/utils/resource_handle.rs new file mode 100644 index 00000000000..c18c8c35243 --- /dev/null +++ b/rust/examples/utils/resource_handle.rs @@ -0,0 +1,27 @@ +use libcugraph_c_sys::cugraph_resource_handle_t; + +/// Create a libcugraph resource handle. +/// +/// Returns an error string if libcugraph returns a null pointer. +pub fn create_resource_handle() -> Result<*mut cugraph_resource_handle_t, String> { + let handle = unsafe { libcugraph_c_sys::cugraph_create_resource_handle(std::ptr::null_mut()) }; + + if handle.is_null() { + return Err("failed to create resource handle".to_string()); + } + + Ok(handle) +} + +/// Free a resource handle created by `create_resource_handle`. +/// +/// Safe to call with null. +pub fn free_resource_handle(handle: *mut cugraph_resource_handle_t) { + if handle.is_null() { + return; + } + + unsafe { + libcugraph_c_sys::cugraph_free_resource_handle(handle); + } +} From 0ccebe8646e61a75ff24857e039fd73dd630a0eb Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Mon, 20 Jul 2026 13:48:24 -0400 Subject: [PATCH 5/7] style update --- rust/bindgen.rs | 7 ++++++- rust/build.rs | 5 +++++ rust/examples/pagerank_example.rs | 5 +++++ rust/examples/resource_handle_example.rs | 5 +++++ rust/examples/utils/datareader.rs | 5 +++++ rust/examples/utils/mod.rs | 5 +++++ rust/examples/utils/paths.rs | 5 +++++ rust/examples/utils/resource_handle.rs | 5 +++++ rust/src/lib.rs | 5 +++++ rust/src/safe.rs | 5 +++++ rust/tests/abi_surface.rs | 5 +++++ rust/tests/runtime_smoke.rs | 5 +++++ rust/wrapper.h | 5 +++++ 13 files changed, 66 insertions(+), 1 deletion(-) diff --git a/rust/bindgen.rs b/rust/bindgen.rs index 8e082caa163..a942ecf77ee 100644 --- a/rust/bindgen.rs +++ b/rust/bindgen.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + /* automatically generated by rust-bindgen 0.69.4 */ -pub const cugraph_error_code__CUGRAPH_SUCCESS : cugraph_error_code_ = 0 ; pub const cugraph_error_code__CUGRAPH_UNKNOWN_ERROR : cugraph_error_code_ = 1 ; pub const cugraph_error_code__CUGRAPH_INVALID_HANDLE : cugraph_error_code_ = 2 ; pub const cugraph_error_code__CUGRAPH_ALLOC_ERROR : cugraph_error_code_ = 3 ; pub const cugraph_error_code__CUGRAPH_INVALID_INPUT : cugraph_error_code_ = 4 ; pub const cugraph_error_code__CUGRAPH_NOT_IMPLEMENTED : cugraph_error_code_ = 5 ; pub const cugraph_error_code__CUGRAPH_UNSUPPORTED_TYPE_COMBINATION : cugraph_error_code_ = 6 ; pub type cugraph_error_code_ = :: std :: os :: raw :: c_uint ; pub use self :: cugraph_error_code_ as cugraph_error_code_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_error_ { pub align_ : i32 , } pub type cugraph_error_t = cugraph_error_ ; 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 ; } 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) ; } pub const bool__FALSE : bool_ = 0 ; pub const bool__TRUE : bool_ = 1 ; pub type bool_ = :: std :: os :: raw :: c_uint ; pub use self :: bool_ as bool_t ; pub type byte_t = i8 ; pub const data_type_id__INT8 : data_type_id_ = 0 ; pub const data_type_id__INT16 : data_type_id_ = 1 ; pub const data_type_id__INT32 : data_type_id_ = 2 ; pub const data_type_id__INT64 : data_type_id_ = 3 ; pub const data_type_id__UINT8 : data_type_id_ = 4 ; pub const data_type_id__UINT16 : data_type_id_ = 5 ; pub const data_type_id__UINT32 : data_type_id_ = 6 ; pub const data_type_id__UINT64 : data_type_id_ = 7 ; pub const data_type_id__FLOAT32 : data_type_id_ = 8 ; pub const data_type_id__FLOAT64 : data_type_id_ = 9 ; pub const data_type_id__SIZE_T : data_type_id_ = 10 ; pub const data_type_id__BOOL : data_type_id_ = 11 ; pub const data_type_id__NTYPES : data_type_id_ = 12 ; pub type data_type_id_ = :: std :: os :: raw :: c_uint ; pub use self :: data_type_id_ as cugraph_data_type_id_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_resource_handle_ { pub align_ : i32 , } pub type cugraph_resource_handle_t = cugraph_resource_handle_ ; 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_view_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_graph_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_data_mask_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct cugraph_graph_properties_t { pub is_symmetric : bool_t , pub is_multigraph : bool_t , } impl Default for cugraph_graph_properties_t { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_rng_state_t { pub align_ : i32 , } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edge_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 , Default , Copy , Clone)] pub struct cugraph_hits_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } # [doc = " @brief Opaque vertex pair type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_pairs_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_induced_subgraph_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_degrees_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edgelist_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_triangle_count_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_hierarchical_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 COO definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_t { pub align_ : i32 , } # [doc = " @brief Opaque COO list definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_list_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [doc = " @brief Opaque core number result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_core_result_t { pub align_ : i32 , } # [doc = " @brief Opaque k-core result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_k_core_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } # [doc = " @brief Opaque labeling result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_labeling_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 layout output"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_layout_result_t { pub align_ : i32 , } extern "C" { # [doc = " @brief Force Atlas 2\n\n NOTE: This currently wraps the legacy force atlas 2 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] max_iter Maximum number of iterations. Initial vertex positioning\n @param [in] start_vertices Optionally send in an initial vertex positioning.\nThis defines the vertices for x_start and y_start.\n @param [in] x_start Optionally send in an initial vertex positioning (x-axis).\n Set to NULL if no value is passed. If NULL, the initial x-axis\n are selected randomly.\n @param [in] y_start Optionally send in an initial vertex positioning (y-axis).\n Set to NULL if no value is passed. If NULL, the initial y-axis\n are selected randomly.\n @param [in] outbound_attraction_distribution\n Distributes attraction along outbound edges\n Hubs attract less and thus are pushed to the borders.\n @param [in] lin_log_mode Switch Force Atlas model from lin-lin to lin-log.\n Makes clusters more tight.\n @param [in] prevent_overlapping\n Prevent nodes to overlap.\n @param [in] vertex_radius_vertices\n Vertex identities for vertex radius.\n @param [in] vertex_radius_values\n Radius of each vertex, used when prevent_overlapping is set.\n @param [in] overlap_scaling_ratio\n When prevent_overlapping is set, scales the repulsion force\n between two nodes that are overlapping.\n @param [in] edge_weight_influence\n How much influence you give to the edges weight.\n 0 is “no influence” and 1 is “normal”.\n @param [in] jitter_tolerance\n How much swinging you allow. Above 1 discouraged.\n Lower gives less speed and more precision.\n @param [in] barnes_hut_optimize\n Whether to use the Barnes Hut approximation or the slower exact\n version.\n @param [in] barnes_hut_theta\n Float between 0 and 1. Tradeoff for speed (1) vs accuracy (0) for\n Barnes Hut only.\n @param [in] scaling_ratio\n How much repulsion you want. More makes a more sparse graph.\n Switching from regular mode to LinLog mode needs a readjustment of\n the scaling parameter.\n @param [in] strong_gravity_mode\n Sets a force that attracts the nodes that are distant from the\n center more. It is so strong that it can sometimes dominate other\n forces.\n @param [in] gravity Attracts nodes to the center. Prevents islands from drifting away.\n @param [in] vertex_mobility_vertices\n Vertex identities for vertex mobility.\n @param [in] vertex_mobility_values\n Mobility of each vertex, used to scale the displacement at each\n iteration.\n @param [in] vertex_mass_vertices\n Vertex identities for vertex mass.\n @param [in] vertex_mass_values\n Mass of each vertex, which controls the attraction to other\n vertices. If not provided, the mass of each vertex will be its\n degree plus one.\n @param [in] verbose Output convergence info at each interation.\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 layout 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_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 ; } extern "C" { # [doc = " @brief Get layout vertices"] pub fn cugraph_layout_result_get_vertices (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout x-axis"] pub fn cugraph_layout_result_get_x_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout y-axis"] pub fn cugraph_layout_result_get_y_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Free a layout result\n\n @param [in] result The result from a layout algorithm"] pub fn cugraph_layout_result_free (result : * mut cugraph_layout_result_t) ; } # [doc = " @brief Opaque src-dst lookup container type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_container_t { pub align_ : i32 , } # [doc = " @brief Opaque src-dst lookup result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_view_t { pub align_ : i32 , } # [doc = " @brief Opaque random walk result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_random_walk_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_sample_result_t { pub align_ : i32 , } # [doc = " @brief Opaque sampling options type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_sampling_options_t { pub align_ : i32 , } 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 ; 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 ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_similarity_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_extract_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } \ No newline at end of file +pub const cugraph_error_code__CUGRAPH_SUCCESS : cugraph_error_code_ = 0 ; pub const cugraph_error_code__CUGRAPH_UNKNOWN_ERROR : cugraph_error_code_ = 1 ; pub const cugraph_error_code__CUGRAPH_INVALID_HANDLE : cugraph_error_code_ = 2 ; pub const cugraph_error_code__CUGRAPH_ALLOC_ERROR : cugraph_error_code_ = 3 ; pub const cugraph_error_code__CUGRAPH_INVALID_INPUT : cugraph_error_code_ = 4 ; pub const cugraph_error_code__CUGRAPH_NOT_IMPLEMENTED : cugraph_error_code_ = 5 ; pub const cugraph_error_code__CUGRAPH_UNSUPPORTED_TYPE_COMBINATION : cugraph_error_code_ = 6 ; pub type cugraph_error_code_ = :: std :: os :: raw :: c_uint ; pub use self :: cugraph_error_code_ as cugraph_error_code_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_error_ { pub align_ : i32 , } pub type cugraph_error_t = cugraph_error_ ; 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 ; } 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) ; } pub const bool__FALSE : bool_ = 0 ; pub const bool__TRUE : bool_ = 1 ; pub type bool_ = :: std :: os :: raw :: c_uint ; pub use self :: bool_ as bool_t ; pub type byte_t = i8 ; pub const data_type_id__INT8 : data_type_id_ = 0 ; pub const data_type_id__INT16 : data_type_id_ = 1 ; pub const data_type_id__INT32 : data_type_id_ = 2 ; pub const data_type_id__INT64 : data_type_id_ = 3 ; pub const data_type_id__UINT8 : data_type_id_ = 4 ; pub const data_type_id__UINT16 : data_type_id_ = 5 ; pub const data_type_id__UINT32 : data_type_id_ = 6 ; pub const data_type_id__UINT64 : data_type_id_ = 7 ; pub const data_type_id__FLOAT32 : data_type_id_ = 8 ; pub const data_type_id__FLOAT64 : data_type_id_ = 9 ; pub const data_type_id__SIZE_T : data_type_id_ = 10 ; pub const data_type_id__BOOL : data_type_id_ = 11 ; pub const data_type_id__NTYPES : data_type_id_ = 12 ; pub type data_type_id_ = :: std :: os :: raw :: c_uint ; pub use self :: data_type_id_ as cugraph_data_type_id_t ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_resource_handle_ { pub align_ : i32 , } pub type cugraph_resource_handle_t = cugraph_resource_handle_ ; 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_device_array_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_type_erased_host_array_view_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_graph_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_data_mask_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct cugraph_graph_properties_t { pub is_symmetric : bool_t , pub is_multigraph : bool_t , } impl Default for cugraph_graph_properties_t { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_rng_state_t { pub align_ : i32 , } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edge_centrality_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 , Default , Copy , Clone)] pub struct cugraph_hits_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } # [doc = " @brief Opaque vertex pair type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_pairs_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_induced_subgraph_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_degrees_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_edgelist_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_triangle_count_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_hierarchical_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_clustering_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 COO definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_t { pub align_ : i32 , } # [doc = " @brief Opaque COO list definition"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_coo_list_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [doc = " @brief Opaque core number result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_core_result_t { pub align_ : i32 , } # [doc = " @brief Opaque k-core result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_k_core_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } # [doc = " @brief Opaque labeling result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_labeling_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 layout output"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_layout_result_t { pub align_ : i32 , } extern "C" { # [doc = " @brief Force Atlas 2\n\n NOTE: This currently wraps the legacy force atlas 2 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] max_iter Maximum number of iterations. Initial vertex positioning\n @param [in] start_vertices Optionally send in an initial vertex positioning.\nThis defines the vertices for x_start and y_start.\n @param [in] x_start Optionally send in an initial vertex positioning (x-axis).\n Set to NULL if no value is passed. If NULL, the initial x-axis\n are selected randomly.\n @param [in] y_start Optionally send in an initial vertex positioning (y-axis).\n Set to NULL if no value is passed. If NULL, the initial y-axis\n are selected randomly.\n @param [in] outbound_attraction_distribution\n Distributes attraction along outbound edges\n Hubs attract less and thus are pushed to the borders.\n @param [in] lin_log_mode Switch Force Atlas model from lin-lin to lin-log.\n Makes clusters more tight.\n @param [in] prevent_overlapping\n Prevent nodes to overlap.\n @param [in] vertex_radius_vertices\n Vertex identities for vertex radius.\n @param [in] vertex_radius_values\n Radius of each vertex, used when prevent_overlapping is set.\n @param [in] overlap_scaling_ratio\n When prevent_overlapping is set, scales the repulsion force\n between two nodes that are overlapping.\n @param [in] edge_weight_influence\n How much influence you give to the edges weight.\n 0 is “no influence” and 1 is “normal”.\n @param [in] jitter_tolerance\n How much swinging you allow. Above 1 discouraged.\n Lower gives less speed and more precision.\n @param [in] barnes_hut_optimize\n Whether to use the Barnes Hut approximation or the slower exact\n version.\n @param [in] barnes_hut_theta\n Float between 0 and 1. Tradeoff for speed (1) vs accuracy (0) for\n Barnes Hut only.\n @param [in] scaling_ratio\n How much repulsion you want. More makes a more sparse graph.\n Switching from regular mode to LinLog mode needs a readjustment of\n the scaling parameter.\n @param [in] strong_gravity_mode\n Sets a force that attracts the nodes that are distant from the\n center more. It is so strong that it can sometimes dominate other\n forces.\n @param [in] gravity Attracts nodes to the center. Prevents islands from drifting away.\n @param [in] vertex_mobility_vertices\n Vertex identities for vertex mobility.\n @param [in] vertex_mobility_values\n Mobility of each vertex, used to scale the displacement at each\n iteration.\n @param [in] vertex_mass_vertices\n Vertex identities for vertex mass.\n @param [in] vertex_mass_values\n Mass of each vertex, which controls the attraction to other\n vertices. If not provided, the mass of each vertex will be its\n degree plus one.\n @param [in] verbose Output convergence info at each interation.\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 layout 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_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 ; } extern "C" { # [doc = " @brief Get layout vertices"] pub fn cugraph_layout_result_get_vertices (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout x-axis"] pub fn cugraph_layout_result_get_x_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Get layout y-axis"] pub fn cugraph_layout_result_get_y_axis (result : * mut cugraph_layout_result_t) -> * mut cugraph_type_erased_device_array_view_t ; } extern "C" { # [doc = " @brief Free a layout result\n\n @param [in] result The result from a layout algorithm"] pub fn cugraph_layout_result_free (result : * mut cugraph_layout_result_t) ; } # [doc = " @brief Opaque src-dst lookup container type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_container_t { pub align_ : i32 , } # [doc = " @brief Opaque src-dst lookup result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_lookup_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_vertex_property_view_t { pub align_ : i32 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_edge_property_view_t { pub align_ : i32 , } # [doc = " @brief Opaque random walk result type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_random_walk_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_sample_result_t { pub align_ : i32 , } # [doc = " @brief Opaque sampling options type"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct cugraph_sampling_options_t { pub align_ : i32 , } 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 ; 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 ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_similarity_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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) ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } 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 ; } 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 , Default , Copy , Clone)] pub struct cugraph_extract_paths_result_t { pub align_ : i32 , } 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 ; } 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 ; } 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 ; } 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) ; } diff --git a/rust/build.rs b/rust/build.rs index 5a892f14312..b1b4c7b4f39 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use std::env; use std::path::{Path, PathBuf}; diff --git a/rust/examples/pagerank_example.rs b/rust/examples/pagerank_example.rs index 85f07b27b49..ed41026d20b 100644 --- a/rust/examples/pagerank_example.rs +++ b/rust/examples/pagerank_example.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + mod utils; #[cfg(feature = "runtime-link")] diff --git a/rust/examples/resource_handle_example.rs b/rust/examples/resource_handle_example.rs index c84872161ad..d68eb48c77f 100644 --- a/rust/examples/resource_handle_example.rs +++ b/rust/examples/resource_handle_example.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + mod utils; #[cfg(feature = "runtime-link")] diff --git a/rust/examples/utils/datareader.rs b/rust/examples/utils/datareader.rs index cda41edc7e7..5a97b0ff842 100644 --- a/rust/examples/utils/datareader.rs +++ b/rust/examples/utils/datareader.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use polars::prelude::*; use std::fs::File; use std::io::{BufRead, BufReader}; diff --git a/rust/examples/utils/mod.rs b/rust/examples/utils/mod.rs index de2997938fe..d68f18c4d62 100644 --- a/rust/examples/utils/mod.rs +++ b/rust/examples/utils/mod.rs @@ -1,4 +1,9 @@ #![allow(dead_code)] +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + #![allow(unused_imports)] pub mod datareader; diff --git a/rust/examples/utils/paths.rs b/rust/examples/utils/paths.rs index adb4ae6dc8d..d75ae59b9f6 100644 --- a/rust/examples/utils/paths.rs +++ b/rust/examples/utils/paths.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use std::path::PathBuf; pub const DEFAULT_DATASET_DIR: &str = "../datasets"; diff --git a/rust/examples/utils/resource_handle.rs b/rust/examples/utils/resource_handle.rs index c18c8c35243..db744ce5b6f 100644 --- a/rust/examples/utils/resource_handle.rs +++ b/rust/examples/utils/resource_handle.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use libcugraph_c_sys::cugraph_resource_handle_t; /// Create a libcugraph resource handle. diff --git a/rust/src/lib.rs b/rust/src/lib.rs index bf542ecc959..1a84605a081 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,4 +1,9 @@ #![allow(non_camel_case_types)] +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + #![allow(non_snake_case)] #![allow(non_upper_case_globals)] diff --git a/rust/src/safe.rs b/rust/src/safe.rs index 2b7097b7d37..76333f4840d 100644 --- a/rust/src/safe.rs +++ b/rust/src/safe.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use std::fmt; use std::ptr; diff --git a/rust/tests/abi_surface.rs b/rust/tests/abi_surface.rs index a212a74c8d8..09da3571e29 100644 --- a/rust/tests/abi_surface.rs +++ b/rust/tests/abi_surface.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + use static_assertions::assert_type_eq_all; #[test] diff --git a/rust/tests/runtime_smoke.rs b/rust/tests/runtime_smoke.rs index d80f123b171..3387beb3429 100644 --- a/rust/tests/runtime_smoke.rs +++ b/rust/tests/runtime_smoke.rs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + #[cfg(feature = "runtime-link")] #[test] fn create_and_free_resource_handle() { diff --git a/rust/wrapper.h b/rust/wrapper.h index 702c06bcb82..7ec4a737658 100644 --- a/rust/wrapper.h +++ b/rust/wrapper.h @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + #pragma once #include From 2ce049218c6d8438a54dab030edf4c15fcdb01fd Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Tue, 21 Jul 2026 15:48:01 -0400 Subject: [PATCH 6/7] First How-To draft --- rust/HOWTO.md | 162 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 156 insertions(+), 6 deletions(-) diff --git a/rust/HOWTO.md b/rust/HOWTO.md index 1c1a8fb8a5f..66f222e4a97 100644 --- a/rust/HOWTO.md +++ b/rust/HOWTO.md @@ -1,9 +1,16 @@ # How To Use libcugraph C API from Rust +This How-To is broken into two sections + 1) Generating the Rust bindgen binding + 2) Using the new binding to run PageRank from libcugraph C + + +## __Generating low-level Rust FFI bindings__ + This guide is for generating and using low-level Rust FFI bindings to `libcugraph_c` in this repository. -## 1) Generate bindings with default header path +### 1) Generate bindings with default header path From this directory: @@ -13,7 +20,7 @@ cargo check This generates bindings in Cargo `OUT_DIR` and compiles the crate. -## 2) Generate a single checked file named bindgen.rs +### 2) Generate a single checked file named bindgen.rs If you want one file in this folder (for sharing or reuse), run: @@ -23,7 +30,7 @@ CUGRAPH_EXPORT_BINDINGS=$PWD/bindgen.rs cargo check The generated file will be written to `rust/bindgen.rs`. -## 3) Use a custom include directory +### 3) Use a custom include directory ```bash CUGRAPH_INCLUDE_DIR=/custom/include/root cargo check @@ -31,13 +38,13 @@ CUGRAPH_INCLUDE_DIR=/custom/include/root cargo check The include root must contain `cugraph_c/*.h`. -## 4) Run runtime example (links to libcugraph_c) +### 4) Run runtime example (links to libcugraph_c) ```bash CUGRAPH_LIB_DIR=/path/to/lib cargo run --example resource_handle_example --features runtime-link ``` -## 5) Run tests +### 5) Run tests Compile-time API tests: @@ -51,9 +58,152 @@ Runtime smoke test (requires `libcugraph_c.so`): CUGRAPH_LIB_DIR=/path/to/lib cargo test --test runtime_smoke --features runtime-link ``` -## Notes +### Binding Notes - This is C API only. No C++ wrappers. - No Cython. - `tree_algorithms.h` and `layout_algorithms.h` are currently omitted from the wrapper in this initial setup. + +
+
+ +## Creating a PageRank example + +The code example is under _examples/pagerank_exmple.rs_ + +### Step 1: Create a CUDA Context Resource Handle +A standard step for all CUDA application is to create a resource handle. +A simple resource creation utility function is available for use +```eamples/utils/resourcehandle.rx``` + * create_resource_handle() - returns the resource handle + * free_resource_handle(handle) - frees up the resource + +### Step 2: Data Format - Not always Needed +cuGraph expects column-based data in either COO, CSR, or CSC format. If your data is row-based, then it is up to you to first convert it. Likewise, it is up to you to get the data into COO, CSR, or CSC format. + +Using a package like [__Polars__](https://docs.pola.rs/) can help with getting the data in columar-format. Additional Polars supports the ability to read data directly into the GPU. Lastely, Polars also has the ability to support data organized by the as defined by the [Arrow](https://arrow.apache.org/) specifiction. + +Assuming COO format, the needed GPU data variables would be +``` + let mut src_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut dst_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut wt_dev: *mut cugraph_type_erased_device_array_t = ptr::null_mut(); + let mut graph: *mut cugraph_graph_t = ptr::null_mut(); +``` + +The next step is to get your data from host-base memory into the GPU. + +Example using just the `src` data. First let get the data in the correct format. +``` +let src = series_to_i32( + src_df + .column("src") + .map_err(|e| format!("missing src column: {e}"))?, + "src", + )?; +``` + +Now move the data to the GPU: +``` +check_status( + cugraph_type_erased_device_array_create( + handle, + src.len(), + data_type_id__INT32, + &mut src_dev, + &mut err, + ), + &mut err, + "create src device array", + )?; +``` +Repeat the above for all the columns. +Once the data is ready, the next step is to get the data into the GPU and a cuGraph Graph created. + +### Step 3: Create a cuGraph Graph +Before any graph algorithm can be executed, a _Graph_ needs to be created. Now that data is on the GPU it can be passed to the graph creation function. + +``` + check_status( + cugraph_graph_create_sg( + handle, + &properties, + ptr::null(), + src_view, + dst_view, + wt_view, + ptr::null(), + ptr::null(), + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__TRUE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + libcugraph_c_sys::bool__FALSE, + &mut graph, + &mut err, + ), + &mut err, + "create graph", + )?; +``` + +### Step 4: Run PageRank +The next step is to run the PageRank algorithm. + +``` + check_status( + cugraph_pagerank( + handle, + graph, + ptr::null(), + ptr::null(), + ptr::null(), + ptr::null(), + 0.85, + 1e-6, + 100, + libcugraph_c_sys::bool__FALSE, + &mut result, + &mut err, + ), + &mut err, + "run pagerank", + )?; +``` + + +### Step 5: Cleanup + +``` + { + if !result.is_null() { + unsafe { + cugraph_centrality_result_free(result); + } + } + if !graph.is_null() { + unsafe { + cugraph_graph_free(graph); + } + } + if !src_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(src_dev); + } + } + if !dst_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(dst_dev); + } + } + if !wt_dev.is_null() { + unsafe { + cugraph_type_erased_device_array_free(wt_dev); + } + } + free_error(&mut err); + } + utils::free_resource_handle(handle); +``` \ No newline at end of file From 37155a04cf0001c59f57371ad452196dee0e1dcf Mon Sep 17 00:00:00 2001 From: BradReesWork Date: Mon, 3 Aug 2026 13:47:57 -0400 Subject: [PATCH 7/7] style check update --- rust/HOWTO.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/HOWTO.md b/rust/HOWTO.md index 66f222e4a97..7c6328b3f01 100644 --- a/rust/HOWTO.md +++ b/rust/HOWTO.md @@ -73,7 +73,7 @@ CUGRAPH_LIB_DIR=/path/to/lib cargo test --test runtime_smoke --features runtime- The code example is under _examples/pagerank_exmple.rs_ ### Step 1: Create a CUDA Context Resource Handle -A standard step for all CUDA application is to create a resource handle. +A standard step for all CUDA application is to create a resource handle. A simple resource creation utility function is available for use ```eamples/utils/resourcehandle.rx``` * create_resource_handle() - returns the resource handle @@ -119,10 +119,10 @@ check_status( )?; ``` Repeat the above for all the columns. -Once the data is ready, the next step is to get the data into the GPU and a cuGraph Graph created. +Once the data is ready, the next step is to get the data into the GPU and a cuGraph Graph created. ### Step 3: Create a cuGraph Graph -Before any graph algorithm can be executed, a _Graph_ needs to be created. Now that data is on the GPU it can be passed to the graph creation function. +Before any graph algorithm can be executed, a _Graph_ needs to be created. Now that data is on the GPU it can be passed to the graph creation function. ``` check_status( @@ -206,4 +206,4 @@ The next step is to run the PageRank algorithm. free_error(&mut err); } utils::free_resource_handle(handle); -``` \ No newline at end of file +```