diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8ff284210b7..3687562b48e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,7 +68,7 @@ repos: types: [python] language: python pass_filenames: false - additional_dependencies: ["networkx>=3.3"] + additional_dependencies: ["networkx>=3.4"] - repo: local hooks: - id: nx-cugraph-readme-update @@ -78,4 +78,4 @@ repos: types_or: [python, markdown] language: python pass_filenames: false - additional_dependencies: ["networkx>=3.3"] + additional_dependencies: ["networkx>=3.4"] diff --git a/benchmarks/nx-cugraph/pytest-based/README.md b/benchmarks/nx-cugraph/pytest-based/README.md index 781550fa560..5d2406bfcd5 100644 --- a/benchmarks/nx-cugraph/pytest-based/README.md +++ b/benchmarks/nx-cugraph/pytest-based/README.md @@ -21,7 +21,9 @@ Our current benchmarks provide the following datasets: #### 1. `run-main-benchmarks.sh` This script allows users to run a small set of commonly-used algorithms across multiple datasets and backends. All results are stored inside a sub-directory (`logs/`) and output files are named based on the combination of parameters for that benchmark. -NOTE: If running with all algorithms and datasets using NetworkX without an accelerated backend, this script may take a few hours to finish running. +NOTE: + - If running with all algorithms and datasets using NetworkX without an accelerated backend, this script may take a few hours to finish running. + - The `betweenness_centrality` benchmark will run with values `[10, 20, 50, 100, 500, 1000]` by default. You can specify only specific k-values to be run by editing `bc_k_values` (line 46) to be passed as a [pytest keyword object](https://docs.pytest.org/en/6.2.x/usage.html#specifying-tests-selecting-tests). **Usage:** - Run with `--cpu-only`: diff --git a/benchmarks/nx-cugraph/pytest-based/bench_algos.py b/benchmarks/nx-cugraph/pytest-based/bench_algos.py index f88d93c3f17..8852ed2a875 100644 --- a/benchmarks/nx-cugraph/pytest-based/bench_algos.py +++ b/benchmarks/nx-cugraph/pytest-based/bench_algos.py @@ -37,6 +37,40 @@ iterations = 1 warmup_rounds = 1 +# FIXME: Add this to cugraph.datasets. This is done here so these benchmarks +# can be run without requiring an updated cugraph install. This temporarily +# adds a dataset based on an Amazon product co-purchasing network. +amazon0302_metadata = """ +name: amazon0302 +description: + Network was collected by crawling Amazon website. It is based on Customers Who Bought This Item Also Bought feature of the Amazon website. If a product i is frequently co-purchased with product j, the graph contains a directed edge from i to j. The data was collected in March 02 2003. +author: J. Leskovec, L. Adamic and B. Adamic +refs: J. Leskovec, L. Adamic and B. Adamic. The Dynamics of Viral Marketing. ACM Transactions on the Web (ACM TWEB), 1(1), 2007. +delim: "\t" +header: 3 +col_names: + - FromNodeId + - ToNodeId +col_types: + - int32 + - int32 +has_loop: false +is_directed: true +is_multigraph: false +is_symmetric: false +number_of_edges: 1234877 +number_of_nodes: 262111 +url: https://snap.stanford.edu/data/amazon0302.txt.gz +""" +amazon0302_metadata_file_name = datasets.default_download_dir.path / "amazon0302.yaml" +if not amazon0302_metadata_file_name.exists(): + amazon0302_metadata_file_name.parent.mkdir(parents=True, exist_ok=True) + with open(amazon0302_metadata_file_name, "w") as f: + f.write(amazon0302_metadata) + +amazon0302_dataset = datasets.Dataset(amazon0302_metadata_file_name) +amazon0302_dataset.metadata["file_type"] = ".gz" + dataset_param_values = [ # name: karate, nodes: 34, edges: 156 pytest.param(datasets.karate, marks=[pytest.mark.small, pytest.mark.undirected]), @@ -46,6 +80,8 @@ pytest.param( datasets.email_Eu_core, marks=[pytest.mark.small, pytest.mark.directed] ), + # name: amazon0302, nodes: 262111, edges: 1234877 + pytest.param(amazon0302_dataset, marks=[pytest.mark.medium, pytest.mark.directed]), # name: cit-Patents, nodes: 3774768, edges: 16518948 pytest.param( datasets.cit_patents, marks=[pytest.mark.medium, pytest.mark.directed] @@ -113,19 +149,7 @@ def nx_graph_from_dataset(dataset_obj): """ create_using = nx.DiGraph if dataset_obj.metadata["is_directed"] else nx.Graph names = dataset_obj.metadata["col_names"] - dtypes = dataset_obj.metadata["col_types"] - if isinstance(dataset_obj.metadata["header"], int): - header = dataset_obj.metadata["header"] - else: - header = None - - pandas_edgelist = pd.read_csv( - dataset_obj.get_path(), - delimiter=dataset_obj.metadata["delim"], - names=names, - dtype=dict(zip(names, dtypes)), - header=header, - ) + pandas_edgelist = dataset_obj.get_edgelist(download=True, reader="pandas") G = nx.from_pandas_edgelist( pandas_edgelist, source=names[0], target=names[1], create_using=create_using ) @@ -272,7 +296,7 @@ def bench_from_networkx(benchmark, graph_obj): # normalized_param_values = [True, False] normalized_param_values = [True] -k_param_values = [10, 100, 1000] +k_param_values = [10, 20, 50, 100, 500, 1000] @pytest.mark.parametrize( @@ -281,7 +305,6 @@ def bench_from_networkx(benchmark, graph_obj): @pytest.mark.parametrize("k", k_param_values, ids=lambda k: f"{k=}") def bench_betweenness_centrality(benchmark, graph_obj, backend_wrapper, normalized, k): G = get_graph_obj_for_benchmark(graph_obj, backend_wrapper) - if k > G.number_of_nodes(): pytest.skip(reason=f"{k=} > {G.number_of_nodes()=}") diff --git a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py index f1cc4b06ccc..df4031e0f61 100644 --- a/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py +++ b/benchmarks/nx-cugraph/pytest-based/create_results_summary_page.py @@ -166,6 +166,7 @@ def get_system_info(): ordered_datasets = [ "netscience", "email_Eu_core", + "amazon0302", "cit-patents", "hollywood", "soc-livejournal1", @@ -174,6 +175,7 @@ def get_system_info(): dataset_meta = { "netscience": ["1,461", "5,484", "Yes"], "email_Eu_core": ["1,005", "25,571", "Yes"], + "amazon0302": ["262,111", "1,234,877", "Yes"], "cit-patents": ["3,774,768", "16,518,948", "Yes"], "hollywood": ["1,139,905", "57,515,616", "No"], "soc-livejournal1": ["4,847,571", "68,993,773", "Yes"], diff --git a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py b/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py deleted file mode 100644 index 5a0a15da8ee..00000000000 --- a/benchmarks/nx-cugraph/pytest-based/get_graph_bench_dataset.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Checks if a particular dataset has been downloaded inside the datasets dir -(RAPIDS_DATAEST_ROOT_DIR). If not, the file will be downloaded using the -datasets API. - -Positional Arguments: - 1) dataset name (e.g. 'email_Eu_core', 'cit-patents') - available datasets can be found here: `python/cugraph/cugraph/datasets/__init__.py` -""" - -import sys - -import cugraph.datasets as cgds - - -if __name__ == "__main__": - # download and store dataset (csv) by using the Datasets API - dataset = sys.argv[1].replace("-", "_") - dataset_obj = getattr(cgds, dataset) - - if not dataset_obj.get_path().exists(): - dataset_obj.get_edgelist(download=True) diff --git a/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh b/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh index 3059e3d4bdf..73c85000b0f 100755 --- a/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh +++ b/benchmarks/nx-cugraph/pytest-based/run-main-benchmarks.sh @@ -14,7 +14,7 @@ # location to store datasets used for benchmarking -export RAPIDS_DATASET_ROOT_DIR=/datasets/cugraph +export RAPIDS_DATASET_ROOT_DIR=${RAPIDS_DATASET_ROOT_DIR:-/datasets/cugraph} mkdir -p logs # list of algos, datasets, and back-ends to use in combinations @@ -30,6 +30,7 @@ algos=" datasets=" netscience email_Eu_core + amazon0302 cit-patents hollywood soc-livejournal @@ -40,6 +41,11 @@ backends=" None cugraph-preconverted " + +# edit this directly to for pytest +# e.g. -k "and not 100 and not 1000" +bc_k_values="" + # check for --cpu-only or --gpu-only args if [[ "$#" -eq 1 ]]; then case $1 in @@ -58,15 +64,15 @@ fi for algo in $algos; do for dataset in $datasets; do - # this script can be used to download benchmarking datasets by name via cugraph.datasets - python get_graph_bench_dataset.py $dataset for backend in $backends; do name="${backend}__${algo}__${dataset}" echo "Running: $backend, $dataset, bench_$algo" - # command to preproduce test - # echo "RUNNING: \"pytest -sv -k \"$backend and $dataset and bench_$algo and not 1000\" --benchmark-json=\"logs/${name}.json\" bench_algos.py" + + # uncomment to get command for reproducing test + # echo "RUNNING: \"pytest -sv -k \"$backend and $dataset and bench_$algo $bc_k_values\" --benchmark-json=\"logs/${name}.json\" bench_algos.py" + pytest -sv \ - -k "$backend and $dataset and bench_$algo and not 1000" \ + -k "$backend and $dataset and bench_$algo $bc_k_values" \ --benchmark-json="logs/${name}.json" \ bench_algos.py 2>&1 | tee "logs/${name}.out" done diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index e3690dfde6e..dfba25bbe1a 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -4,7 +4,6 @@ set -eoxu pipefail package_name=$1 -package_dir=$2 python_package_name=$(echo ${package_name}|sed 's/-/_/g') diff --git a/ci/test_wheel_cugraph-dgl.sh b/ci/test_wheel_cugraph-dgl.sh index 688c58026bd..d7558d43b6d 100755 --- a/ci/test_wheel_cugraph-dgl.sh +++ b/ci/test_wheel_cugraph-dgl.sh @@ -4,24 +4,16 @@ set -eoxu pipefail package_name="cugraph-dgl" -package_dir="python/cugraph-dgl" - -python_package_name=$(echo ${package_name}|sed 's/-/_/g') mkdir -p ./dist RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# Download wheels built during this job. +# Download the pylibcugraph, cugraph, and cugraph-dgl built in the previous step RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps RAPIDS_PY_WHEEL_NAME="cugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps -python -m pip install ./local-deps/*.whl - -# use 'ls' to expand wildcard before adding `[extra]` requires for pip RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist -# pip creates wheels using python package names -python -m pip install $(ls ./dist/${python_package_name}*.whl)[test] - +# determine pytorch and DGL sources PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')" PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2} if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then @@ -32,8 +24,15 @@ fi PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}" DGL_URL="https://data.dgl.ai/wheels/torch-2.3/cu${PYTORCH_CUDA_VER}/repo.html" -rapids-logger "Installing PyTorch and DGL" -rapids-retry python -m pip install torch==2.3.0 --index-url ${PYTORCH_URL} -rapids-retry python -m pip install dgl==2.4.0 --find-links ${DGL_URL} +# echo to expand wildcard before adding `[extra]` requires for pip +python -m pip install \ + -v \ + --extra-index-url "${PYTORCH_URL}" \ + --find-links "${DGL_URL}" \ + "$(echo ./local-deps/pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ + "$(echo ./local-deps/cugraph_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ + "$(echo ./dist/cugraph_dgl_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ + 'dgl==2.4.0' \ + 'torch>=2.3.0,<2.4' python -m pytest python/cugraph-dgl/tests diff --git a/ci/test_wheel_cugraph-equivariant.sh b/ci/test_wheel_cugraph-equivariant.sh index cb952055f06..3be1d578964 100755 --- a/ci/test_wheel_cugraph-equivariant.sh +++ b/ci/test_wheel_cugraph-equivariant.sh @@ -4,19 +4,14 @@ set -eoxu pipefail package_name="cugraph-equivariant" -package_dir="python/cugraph-equivariant" - -python_package_name=$(echo ${package_name}|sed 's/-/_/g') mkdir -p ./dist RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# use 'ls' to expand wildcard before adding `[extra]` requires for pip +# Download the cugraph-equivariant built in the previous step RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist -# pip creates wheels using python package names -python -m pip install $(ls ./dist/${python_package_name}*.whl)[test] - +# determine pytorch source PKG_CUDA_VER="$(echo ${CUDA_VERSION} | cut -d '.' -f1,2 | tr -d '.')" PKG_CUDA_VER_MAJOR=${PKG_CUDA_VER:0:2} if [[ "${PKG_CUDA_VER_MAJOR}" == "12" ]]; then @@ -26,8 +21,12 @@ else fi PYTORCH_URL="https://download.pytorch.org/whl/cu${PYTORCH_CUDA_VER}" -rapids-logger "Installing PyTorch and e3nn" -rapids-retry python -m pip install torch --index-url ${PYTORCH_URL} -rapids-retry python -m pip install e3nn +# echo to expand wildcard before adding `[extra]` requires for pip +python -m pip install \ + -v \ + --extra-index-url "${PYTORCH_URL}" \ + "$(echo ./dist/cugraph_equivariant_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ + 'e3nn' \ + 'torch>=2.3.0,<2.4' python -m pytest python/cugraph-equivariant/cugraph_equivariant/tests diff --git a/ci/test_wheel_cugraph-pyg.sh b/ci/test_wheel_cugraph-pyg.sh index 8f4b16a2dec..2f508ee830b 100755 --- a/ci/test_wheel_cugraph-pyg.sh +++ b/ci/test_wheel_cugraph-pyg.sh @@ -4,29 +4,16 @@ set -eoxu pipefail package_name="cugraph-pyg" -package_dir="python/cugraph-pyg" - -python_package_name=$(echo ${package_name}|sed 's/-/_/g') mkdir -p ./dist RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -# Download wheels built during this job. +# Download the pylibcugraph, cugraph, and cugraph-pyg built in the previous step RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps RAPIDS_PY_WHEEL_NAME="cugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps -python -m pip install ./local-deps/*.whl - -# use 'ls' to expand wildcard before adding `[extra]` requires for pip RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" RAPIDS_PY_WHEEL_PURE="1" rapids-download-wheels-from-s3 ./dist -# pip creates wheels using python package names -python -m pip install $(ls ./dist/${python_package_name}*.whl)[test] - -# RAPIDS_DATASET_ROOT_DIR is used by test scripts -export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" - -# Used to skip certain examples in CI due to memory limitations -export CI_RUN=1 +# determine pytorch and pyg sources if [[ "${CUDA_VERSION}" == "11.8.0" ]]; then PYTORCH_URL="https://download.pytorch.org/whl/cu118" PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu118.html" @@ -34,15 +21,27 @@ else PYTORCH_URL="https://download.pytorch.org/whl/cu121" PYG_URL="https://data.pyg.org/whl/torch-2.3.0+cu121.html" fi -rapids-logger "Installing PyTorch and PyG dependencies" -rapids-retry python -m pip install torch==2.3.0 --index-url ${PYTORCH_URL} -rapids-retry python -m pip install "torch-geometric>=2.5,<2.6" -rapids-retry python -m pip install \ - ogb \ - pyg_lib \ - torch_scatter \ - torch_sparse \ - -f ${PYG_URL} + +# echo to expand wildcard before adding `[extra]` requires for pip +python -m pip install \ + -v \ + --extra-index-url "${PYTORCH_URL}" \ + --find-links "${PYG_URL}" \ + "$(echo ./local-deps/pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ + "$(echo ./local-deps/cugraph_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ + "$(echo ./dist/cugraph_pyg_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" \ + 'ogb' \ + 'pyg_lib' \ + 'torch>=2.3.0,<2.4' \ + 'torch-geometric>=2.5,<2.6' \ + 'torch_scatter' \ + 'torch_sparse' + +# RAPIDS_DATASET_ROOT_DIR is used by test scripts +export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" + +# Used to skip certain examples in CI due to memory limitations +export CI_RUN=1 rapids-logger "pytest cugraph-pyg (single GPU)" pushd python/cugraph-pyg/cugraph_pyg diff --git a/ci/test_wheel_cugraph.sh b/ci/test_wheel_cugraph.sh index d351ea21624..295cec7cb10 100755 --- a/ci/test_wheel_cugraph.sh +++ b/ci/test_wheel_cugraph.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -eoxu pipefail @@ -8,4 +8,4 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-pylibcugraph-dep python -m pip install --no-deps ./local-pylibcugraph-dep/pylibcugraph*.whl -./ci/test_wheel.sh cugraph python/cugraph +./ci/test_wheel.sh cugraph diff --git a/ci/test_wheel_nx-cugraph.sh b/ci/test_wheel_nx-cugraph.sh index b5adfbcb9d3..024169ae698 100755 --- a/ci/test_wheel_nx-cugraph.sh +++ b/ci/test_wheel_nx-cugraph.sh @@ -8,4 +8,4 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" RAPIDS_PY_WHEEL_NAME="pylibcugraph_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-deps python -m pip install ./local-deps/*.whl -./ci/test_wheel.sh nx-cugraph python/nx-cugraph +./ci/test_wheel.sh nx-cugraph diff --git a/ci/test_wheel_pylibcugraph.sh b/ci/test_wheel_pylibcugraph.sh index d04cb358d21..ddc9976308b 100755 --- a/ci/test_wheel_pylibcugraph.sh +++ b/ci/test_wheel_pylibcugraph.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -eoxu pipefail -./ci/test_wheel.sh pylibcugraph python/pylibcugraph +./ci/test_wheel.sh pylibcugraph diff --git a/cpp/include/cugraph_c/graph.h b/cpp/include/cugraph_c/graph.h index d812b503778..c5ce9c9fbeb 100644 --- a/cpp/include/cugraph_c/graph.h +++ b/cpp/include/cugraph_c/graph.h @@ -35,48 +35,6 @@ typedef struct { bool_t is_multigraph; } cugraph_graph_properties_t; -/** - * @brief Construct an SG graph - * - * @deprecated This API will be deleted, use cugraph_graph_create_sg instead - * - * @param [in] handle Handle for accessing resources - * @param [in] properties Properties of the constructed graph - * @param [in] src Device array containing the source vertex ids. - * @param [in] dst Device array containing the destination vertex ids - * @param [in] weights Device array containing the edge weights. Note that an unweighted - * graph can be created by passing weights == NULL. - * @param [in] edge_ids Device array containing the edge ids for each edge. Optional - argument that can be NULL if edge ids are not used. - * @param [in] edge_type_ids Device array containing the edge types for each edge. Optional - argument that can be NULL if edge types are not used. - * @param [in] store_transposed If true create the graph initially in transposed format - * @param [in] renumber If true, renumber vertices to make an efficient data structure. - * If false, do not renumber. Renumbering enables some significant optimizations within - * the graph primitives library, so it is strongly encouraged. Renumbering is required if - * the vertices are not sequential integer values from 0 to num_vertices. - * @param [in] do_expensive_check If true, do expensive checks to validate the input data - * is consistent with software assumptions. If false bypass these checks. - * @param [out] graph A pointer to the graph object - * @param [out] error Pointer to an error object storing details of any error. Will - * be populated if error code is not CUGRAPH_SUCCESS - * - * @return error code - */ -cugraph_error_code_t cugraph_sg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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, - bool_t store_transposed, - bool_t renumber, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error); - /** * @brief Construct an SG graph * @@ -133,51 +91,6 @@ cugraph_error_code_t cugraph_graph_create_sg( cugraph_graph_t** graph, cugraph_error_t** error); -/** - * @brief Construct an SG graph from a CSR input - * - * @deprecated This API will be deleted, use cugraph_graph_create_sg_from_csr instead - * - * @param [in] handle Handle for accessing resources - * @param [in] properties Properties of the constructed graph - * @param [in] offsets Device array containing the CSR offsets array - * @param [in] indices Device array containing the destination vertex ids - * @param [in] weights Device array containing the edge weights. Note that an unweighted - * graph can be created by passing weights == NULL. - * @param [in] edge_ids Device array containing the edge ids for each edge. Optional - argument that can be NULL if edge ids are not used. - * @param [in] edge_type_ids Device array containing the edge types for each edge. Optional - argument that can be NULL if edge types are not used. - * @param [in] store_transposed If true create the graph initially in transposed format - * @param [in] renumber If true, renumber vertices to make an efficient data structure. - * If false, do not renumber. Renumbering enables some significant optimizations within - * the graph primitives library, so it is strongly encouraged. Renumbering is required if - * the vertices are not sequential integer values from 0 to num_vertices. - * @param [in] symmetrize If true, symmetrize the edgelist. The symmetrization of edges - * with edge_ids and/or edge_type_ids is currently not supported. - * @param [in] do_expensive_check If true, do expensive checks to validate the input data - * is consistent with software assumptions. If false bypass these checks. - * @param [out] graph A pointer to the graph object - * @param [out] error Pointer to an error object storing details of any error. Will - * be populated if error code is not CUGRAPH_SUCCESS - * - * @return error code - */ -cugraph_error_code_t cugraph_sg_graph_create_from_csr( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - const cugraph_type_erased_device_array_view_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, - bool_t store_transposed, - bool_t renumber, - bool_t symmetrize, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error); - /** * @brief Construct an SG graph from a CSR input * @@ -221,47 +134,6 @@ cugraph_error_code_t cugraph_graph_create_sg_from_csr( cugraph_graph_t** graph, cugraph_error_t** error); -/** - * @brief Construct an MG graph - * - * @deprecated This API will be deleted, use cugraph_graph_create_mg instead - * - * @param [in] handle Handle for accessing resources - * @param [in] properties Properties of the constructed graph - * @param [in] src Device array containing the source vertex ids - * @param [in] dst Device array containing the destination vertex ids - * @param [in] weights Device array containing the edge weights. Note that an unweighted - * graph can be created by passing weights == NULL. If a weighted - * graph is to be created, the weights device array should be created - * on each rank, but the pointer can be NULL and the size 0 - * if there are no inputs provided by this rank - * @param [in] edge_ids Device array containing the edge ids for each edge. Optional - argument that can be NULL if edge ids are not used. - * @param [in] edge_type_ids Device array containing the edge types for each edge. Optional - argument that can be NULL if edge types are not used. - * @param [in] store_transposed If true create the graph initially in transposed format - * @param [in] num_edges Number of edges - * @param [in] do_expensive_check If true, do expensive checks to validate the input data - * is consistent with software assumptions. If false bypass these checks. - * @param [out] graph A pointer to the graph object - * @param [out] error Pointer to an error object storing details of any error. Will - * be populated if error code is not CUGRAPH_SUCCESS - * @return error code - */ -cugraph_error_code_t cugraph_mg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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, - bool_t store_transposed, - size_t num_edges, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error); - /** * @brief Construct an MG graph * @@ -332,24 +204,6 @@ cugraph_error_code_t cugraph_graph_create_mg( */ void cugraph_graph_free(cugraph_graph_t* graph); -/** - * @brief Destroy an SG graph - * - * @deprecated This API will be deleted, use cugraph_graph_free instead - * - * @param [in] graph A pointer to the graph object to destroy - */ -void cugraph_sg_graph_free(cugraph_graph_t* graph); - -/** - * @brief Destroy an MG graph - * - * @deprecated This API will be deleted, use cugraph_graph_free instead - * - * @param [in] graph A pointer to the graph object to destroy - */ -void cugraph_mg_graph_free(cugraph_graph_t* graph); - /** * @brief Create a data mask * diff --git a/cpp/src/c_api/graph_mg.cpp b/cpp/src/c_api/graph_mg.cpp index fc8014a5dd8..2057448dbe5 100644 --- a/cpp/src/c_api/graph_mg.cpp +++ b/cpp/src/c_api/graph_mg.cpp @@ -536,40 +536,3 @@ extern "C" cugraph_error_code_t cugraph_graph_create_mg( return CUGRAPH_SUCCESS; } - -extern "C" cugraph_error_code_t cugraph_mg_graph_create( - cugraph_resource_handle_t const* handle, - cugraph_graph_properties_t const* properties, - cugraph_type_erased_device_array_view_t const* src, - cugraph_type_erased_device_array_view_t const* dst, - cugraph_type_erased_device_array_view_t const* weights, - cugraph_type_erased_device_array_view_t const* edge_ids, - cugraph_type_erased_device_array_view_t const* edge_type_ids, - bool_t store_transposed, - size_t num_edges, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error) -{ - return cugraph_graph_create_mg(handle, - properties, - NULL, - &src, - &dst, - (weights == nullptr) ? nullptr : &weights, - (edge_ids == nullptr) ? nullptr : &edge_ids, - (edge_type_ids == nullptr) ? nullptr : &edge_type_ids, - store_transposed, - 1, - FALSE, - FALSE, - FALSE, - do_expensive_check, - graph, - error); -} - -extern "C" void cugraph_mg_graph_free(cugraph_graph_t* ptr_graph) -{ - if (ptr_graph != NULL) { cugraph_graph_free(ptr_graph); } -} diff --git a/cpp/src/c_api/graph_sg.cpp b/cpp/src/c_api/graph_sg.cpp index f6ea8e4142e..ea598b902ae 100644 --- a/cpp/src/c_api/graph_sg.cpp +++ b/cpp/src/c_api/graph_sg.cpp @@ -680,38 +680,6 @@ extern "C" cugraph_error_code_t cugraph_graph_create_sg( return CUGRAPH_SUCCESS; } -extern "C" cugraph_error_code_t cugraph_sg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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, - bool_t store_transposed, - bool_t renumber, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error) -{ - return cugraph_graph_create_sg(handle, - properties, - NULL, - src, - dst, - weights, - edge_ids, - edge_type_ids, - store_transposed, - renumber, - FALSE, - FALSE, - FALSE, - do_expensive_check, - graph, - error); -} - cugraph_error_code_t cugraph_graph_create_sg_from_csr( const cugraph_resource_handle_t* handle, const cugraph_graph_properties_t* properties, @@ -819,36 +787,6 @@ cugraph_error_code_t cugraph_graph_create_sg_from_csr( return CUGRAPH_SUCCESS; } -cugraph_error_code_t cugraph_sg_graph_create_from_csr( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - const cugraph_type_erased_device_array_view_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, - bool_t store_transposed, - bool_t renumber, - bool_t symmetrize, - bool_t do_expensive_check, - cugraph_graph_t** graph, - cugraph_error_t** error) -{ - return cugraph_graph_create_sg_from_csr(handle, - properties, - offsets, - indices, - weights, - edge_ids, - edge_type_ids, - store_transposed, - renumber, - symmetrize, - do_expensive_check, - graph, - error); -} - extern "C" void cugraph_graph_free(cugraph_graph_t* ptr_graph) { if (ptr_graph != NULL) { @@ -871,5 +809,3 @@ extern "C" void cugraph_graph_free(cugraph_graph_t* ptr_graph) delete internal_pointer; } } - -extern "C" void cugraph_sg_graph_free(cugraph_graph_t* ptr_graph) { cugraph_graph_free(ptr_graph); } diff --git a/cpp/src/detail/graph_partition_utils.cuh b/cpp/src/detail/graph_partition_utils.cuh index 00931780266..b10d2e788f4 100644 --- a/cpp/src/detail/graph_partition_utils.cuh +++ b/cpp/src/detail/graph_partition_utils.cuh @@ -43,7 +43,7 @@ struct compute_gpu_id_from_ext_vertex_t { __host__ __device__ int operator()(vertex_t v) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; auto vertex_partition_id = static_cast(hash_func(v) % comm_size); return partition_manager::compute_global_comm_rank_from_vertex_partition_id( major_comm_size, minor_comm_size, vertex_partition_id); @@ -58,7 +58,7 @@ struct compute_gpu_id_from_ext_edge_id_t { __host__ __device__ int operator()(edge_t e) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; auto vertex_partition_id = static_cast(hash_func(e) % comm_size); return partition_manager::compute_global_comm_rank_from_vertex_partition_id( major_comm_size, minor_comm_size, vertex_partition_id); @@ -88,7 +88,7 @@ struct compute_vertex_partition_id_from_ext_vertex_t { __host__ __device__ int operator()(vertex_t v) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return hash_func(v) % comm_size; } }; @@ -114,7 +114,7 @@ struct compute_gpu_id_from_ext_edge_endpoints_t { __host__ __device__ int operator()(vertex_t major, vertex_t minor) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; auto major_vertex_partition_id = static_cast(hash_func(major) % comm_size); auto minor_vertex_partition_id = static_cast(hash_func(minor) % comm_size); auto major_comm_rank = major_vertex_partition_id % major_comm_size; @@ -126,7 +126,7 @@ struct compute_gpu_id_from_ext_edge_endpoints_t { __host__ __device__ int operator()( thrust::tuple pair /* major, minor */) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; auto major_vertex_partition_id = static_cast(hash_func(thrust::get<0>(pair)) % comm_size); auto minor_vertex_partition_id = static_cast(hash_func(thrust::get<1>(pair)) % comm_size); auto major_comm_rank = major_vertex_partition_id % major_comm_size; @@ -192,7 +192,7 @@ struct compute_edge_partition_id_from_ext_edge_endpoints_t { __host__ __device__ int operator()(vertex_t major, vertex_t minor) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return (hash_func(major) % comm_size) * minor_comm_size + (hash_func(minor) % comm_size) / major_comm_size; } @@ -200,7 +200,7 @@ struct compute_edge_partition_id_from_ext_edge_endpoints_t { __host__ __device__ int operator()( thrust::tuple pair /* major, minor */) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return (hash_func(thrust::get<0>(pair)) % comm_size) * minor_comm_size + (hash_func(thrust::get<1>(pair)) % comm_size) / major_comm_size; } diff --git a/cpp/src/structure/remove_multi_edges_impl.cuh b/cpp/src/structure/remove_multi_edges_impl.cuh index ce83fdcb66a..7e266ab2caf 100644 --- a/cpp/src/structure/remove_multi_edges_impl.cuh +++ b/cpp/src/structure/remove_multi_edges_impl.cuh @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -53,8 +54,8 @@ struct hash_src_dst_pair { vertex_t pair[2]; pair[0] = thrust::get<0>(t); pair[1] = thrust::get<1>(t); - cuco::detail::MurmurHash3_32 hash_func{}; - return hash_func.compute_hash(reinterpret_cast(pair), 2 * sizeof(vertex_t)) % + cuco::murmurhash3_32 hash_func{}; + return hash_func.compute_hash(reinterpret_cast(pair), 2 * sizeof(vertex_t)) % num_groups; } }; diff --git a/cpp/tests/c_api/betweenness_centrality_test.c b/cpp/tests/c_api/betweenness_centrality_test.c index cc37a10798e..7fec78eaffd 100644 --- a/cpp/tests/c_api/betweenness_centrality_test.c +++ b/cpp/tests/c_api/betweenness_centrality_test.c @@ -122,7 +122,7 @@ int generic_betweenness_centrality_test(vertex_t* h_src, cugraph_type_erased_device_array_view_free(seeds_view); cugraph_type_erased_device_array_free(seeds); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/bfs_test.c b/cpp/tests/c_api/bfs_test.c index 8feb426a853..b61051d8f90 100644 --- a/cpp/tests/c_api/bfs_test.c +++ b/cpp/tests/c_api/bfs_test.c @@ -109,7 +109,7 @@ int generic_bfs_test(vertex_t* h_src, cugraph_type_erased_device_array_free(p_sources); cugraph_paths_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/biased_neighbor_sample_test.c b/cpp/tests/c_api/biased_neighbor_sample_test.c index fe80514c825..0ccb236f7fc 100644 --- a/cpp/tests/c_api/biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/biased_neighbor_sample_test.c @@ -461,7 +461,7 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } @@ -680,7 +680,7 @@ int test_biased_neighbor_sample_with_labels(const cugraph_resource_handle_t* han cugraph_sampling_options_free(sampling_options); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } diff --git a/cpp/tests/c_api/core_number_test.c b/cpp/tests/c_api/core_number_test.c index ca0bbf7134f..c9c85694db5 100644 --- a/cpp/tests/c_api/core_number_test.c +++ b/cpp/tests/c_api/core_number_test.c @@ -81,7 +81,7 @@ int generic_core_number_test(vertex_t* h_src, } cugraph_core_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/create_graph_test.c b/cpp/tests/c_api/create_graph_test.c index 104787e4c7b..a07f31fce57 100644 --- a/cpp/tests/c_api/create_graph_test.c +++ b/cpp/tests/c_api/create_graph_test.c @@ -204,7 +204,7 @@ int test_create_sg_graph_csr() handle, wgt_view, (byte_t*)h_wgt, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_sg_graph_create_from_csr(handle, + ret_code = cugraph_graph_create_sg_from_csr(handle, &properties, offsets_view, indices_view, @@ -669,7 +669,7 @@ int test_create_sg_graph_csr_with_isolated() handle, wgt_view, (byte_t*)h_wgt, &ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_sg_graph_create_from_csr(handle, + ret_code = cugraph_graph_create_sg_from_csr(handle, &properties, offsets_view, indices_view, diff --git a/cpp/tests/c_api/ecg_test.c b/cpp/tests/c_api/ecg_test.c index 4d4dd64572f..4f4c29b97b9 100644 --- a/cpp/tests/c_api/ecg_test.c +++ b/cpp/tests/c_api/ecg_test.c @@ -121,7 +121,7 @@ int generic_ecg_test(vertex_t* h_src, cugraph_hierarchical_clustering_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/edge_betweenness_centrality_test.c b/cpp/tests/c_api/edge_betweenness_centrality_test.c index 95b875b21af..8b9167778d9 100644 --- a/cpp/tests/c_api/edge_betweenness_centrality_test.c +++ b/cpp/tests/c_api/edge_betweenness_centrality_test.c @@ -128,7 +128,7 @@ int generic_edge_betweenness_centrality_test(vertex_t* h_src, } cugraph_edge_centrality_result_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/egonet_test.c b/cpp/tests/c_api/egonet_test.c index b4d27935ce1..1bde50afbad 100644 --- a/cpp/tests/c_api/egonet_test.c +++ b/cpp/tests/c_api/egonet_test.c @@ -165,7 +165,7 @@ int generic_egonet_test(vertex_t* h_src, cugraph_induced_subgraph_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(resource_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/eigenvector_centrality_test.c b/cpp/tests/c_api/eigenvector_centrality_test.c index ded505aeedc..d42745917d2 100644 --- a/cpp/tests/c_api/eigenvector_centrality_test.c +++ b/cpp/tests/c_api/eigenvector_centrality_test.c @@ -83,7 +83,7 @@ int generic_eigenvector_centrality_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/extract_paths_test.c b/cpp/tests/c_api/extract_paths_test.c index 5b87c3151c7..46e23112742 100644 --- a/cpp/tests/c_api/extract_paths_test.c +++ b/cpp/tests/c_api/extract_paths_test.c @@ -124,7 +124,7 @@ int generic_bfs_test_with_extract_paths(vertex_t* h_src, cugraph_type_erased_device_array_free(p_destinations); cugraph_extract_paths_result_free(p_extract_paths_result); cugraph_paths_result_free(p_paths_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/hits_test.c b/cpp/tests/c_api/hits_test.c index a9dbbb4f224..db63b0366b5 100644 --- a/cpp/tests/c_api/hits_test.c +++ b/cpp/tests/c_api/hits_test.c @@ -153,7 +153,7 @@ int generic_hits_test(vertex_t* h_src, } cugraph_hits_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/k_core_test.c b/cpp/tests/c_api/k_core_test.c index 81c1973d051..c60001fc8e7 100644 --- a/cpp/tests/c_api/k_core_test.c +++ b/cpp/tests/c_api/k_core_test.c @@ -142,7 +142,7 @@ int generic_k_core_test(vertex_t* h_src, cugraph_k_core_result_free(k_core_result); cugraph_core_result_free(core_result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(resource_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/k_truss_test.c b/cpp/tests/c_api/k_truss_test.c index 9aa90f66480..1ebacfead9f 100644 --- a/cpp/tests/c_api/k_truss_test.c +++ b/cpp/tests/c_api/k_truss_test.c @@ -150,7 +150,7 @@ int generic_k_truss_test(vertex_t* h_src, cugraph_induced_subgraph_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(resource_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/katz_test.c b/cpp/tests/c_api/katz_test.c index 4ee61b2b806..33bb6a5a9af 100644 --- a/cpp/tests/c_api/katz_test.c +++ b/cpp/tests/c_api/katz_test.c @@ -93,7 +93,7 @@ int generic_katz_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/legacy_spectral_test.c b/cpp/tests/c_api/legacy_spectral_test.c index ecb61e47ae6..ad695dd0883 100644 --- a/cpp/tests/c_api/legacy_spectral_test.c +++ b/cpp/tests/c_api/legacy_spectral_test.c @@ -141,7 +141,7 @@ int generic_spectral_test(vertex_t* h_src, cugraph_clustering_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); @@ -272,7 +272,7 @@ int generic_balanced_cut_test(vertex_t* h_src, cugraph_clustering_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/leiden_test.c b/cpp/tests/c_api/leiden_test.c index df206ebd1ed..57e6e921cce 100644 --- a/cpp/tests/c_api/leiden_test.c +++ b/cpp/tests/c_api/leiden_test.c @@ -114,7 +114,7 @@ int generic_leiden_test(vertex_t* h_src, cugraph_hierarchical_clustering_result_free(p_result); } - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/louvain_test.c b/cpp/tests/c_api/louvain_test.c index 41d777545b2..c083dbaa676 100644 --- a/cpp/tests/c_api/louvain_test.c +++ b/cpp/tests/c_api/louvain_test.c @@ -114,7 +114,7 @@ int generic_louvain_test(vertex_t* h_src, cugraph_hierarchical_clustering_result_free(p_result); } - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/mg_betweenness_centrality_test.c b/cpp/tests/c_api/mg_betweenness_centrality_test.c index 6a3cb69dd57..6f45792200e 100644 --- a/cpp/tests/c_api/mg_betweenness_centrality_test.c +++ b/cpp/tests/c_api/mg_betweenness_centrality_test.c @@ -118,7 +118,7 @@ int generic_betweenness_centrality_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_view_free(seeds_view); cugraph_type_erased_device_array_free(seeds); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_bfs_test.c b/cpp/tests/c_api/mg_bfs_test.c index 026d8f0796c..db24a180774 100644 --- a/cpp/tests/c_api/mg_bfs_test.c +++ b/cpp/tests/c_api/mg_bfs_test.c @@ -106,7 +106,7 @@ int generic_bfs_test(const cugraph_resource_handle_t* p_handle, } cugraph_paths_result_free(paths_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c index ce96fc6f5f7..ead86f22ad3 100644 --- a/cpp/tests/c_api/mg_biased_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_biased_neighbor_sample_test.c @@ -432,7 +432,7 @@ int generic_biased_neighbor_sample_test(const cugraph_resource_handle_t* handle, cugraph_sample_result_free(result); #endif - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } @@ -678,7 +678,7 @@ int test_biased_neighbor_from_alex(const cugraph_resource_handle_t* handle) cugraph_sample_result_free(result); cugraph_type_erased_host_array_view_free(h_fan_out_view); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); cugraph_sampling_options_free(sampling_options); @@ -941,7 +941,7 @@ int test_biased_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handle cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } @@ -1221,7 +1221,7 @@ int test_biased_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* han cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } diff --git a/cpp/tests/c_api/mg_core_number_test.c b/cpp/tests/c_api/mg_core_number_test.c index 68c69a83c4f..a588c1997b1 100644 --- a/cpp/tests/c_api/mg_core_number_test.c +++ b/cpp/tests/c_api/mg_core_number_test.c @@ -79,7 +79,7 @@ int generic_core_number_test(const cugraph_resource_handle_t* p_handle, } cugraph_core_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_ecg_test.c b/cpp/tests/c_api/mg_ecg_test.c index b14ebda2959..626cb6025f5 100644 --- a/cpp/tests/c_api/mg_ecg_test.c +++ b/cpp/tests/c_api/mg_ecg_test.c @@ -100,7 +100,7 @@ int generic_ecg_test(const cugraph_resource_handle_t* handle, cugraph_hierarchical_clustering_result_free(result); } - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_edge_betweenness_centrality_test.c b/cpp/tests/c_api/mg_edge_betweenness_centrality_test.c index 319d4fb789b..cc3cc4c94c5 100644 --- a/cpp/tests/c_api/mg_edge_betweenness_centrality_test.c +++ b/cpp/tests/c_api/mg_edge_betweenness_centrality_test.c @@ -130,7 +130,7 @@ int generic_edge_betweenness_centrality_test(const cugraph_resource_handle_t* ha } cugraph_edge_centrality_result_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_egonet_test.c b/cpp/tests/c_api/mg_egonet_test.c index 6a308102ebe..41328f1f908 100644 --- a/cpp/tests/c_api/mg_egonet_test.c +++ b/cpp/tests/c_api/mg_egonet_test.c @@ -161,7 +161,7 @@ int generic_egonet_test(const cugraph_resource_handle_t* resource_handle, cugraph_induced_subgraph_result_free(result); } - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_eigenvector_centrality_test.c b/cpp/tests/c_api/mg_eigenvector_centrality_test.c index 37bf2afca3c..cdf2387fdb3 100644 --- a/cpp/tests/c_api/mg_eigenvector_centrality_test.c +++ b/cpp/tests/c_api/mg_eigenvector_centrality_test.c @@ -84,7 +84,7 @@ int generic_eigenvector_centrality_test(const cugraph_resource_handle_t* handle, } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_hits_test.c b/cpp/tests/c_api/mg_hits_test.c index 3e10bfc05d6..201718417a7 100644 --- a/cpp/tests/c_api/mg_hits_test.c +++ b/cpp/tests/c_api/mg_hits_test.c @@ -154,7 +154,7 @@ int generic_hits_test(const cugraph_resource_handle_t* p_handle, } cugraph_hits_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_induced_subgraph_test.c b/cpp/tests/c_api/mg_induced_subgraph_test.c index 018b308688e..39eefb9258c 100644 --- a/cpp/tests/c_api/mg_induced_subgraph_test.c +++ b/cpp/tests/c_api/mg_induced_subgraph_test.c @@ -153,7 +153,7 @@ int generic_induced_subgraph_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_free(subgraph_offsets); cugraph_type_erased_device_array_free(subgraph_vertices); cugraph_induced_subgraph_result_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } diff --git a/cpp/tests/c_api/mg_k_core_test.c b/cpp/tests/c_api/mg_k_core_test.c index 1218475481b..45aa1283679 100644 --- a/cpp/tests/c_api/mg_k_core_test.c +++ b/cpp/tests/c_api/mg_k_core_test.c @@ -110,7 +110,7 @@ int generic_k_core_test(const cugraph_resource_handle_t* resource_handle, cugraph_k_core_result_free(k_core_result); cugraph_core_result_free(core_result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_k_truss_test.c b/cpp/tests/c_api/mg_k_truss_test.c index e406eb330a7..ed385c6ca76 100644 --- a/cpp/tests/c_api/mg_k_truss_test.c +++ b/cpp/tests/c_api/mg_k_truss_test.c @@ -16,6 +16,7 @@ #include "mg_test_utils.h" /* RUN_TEST */ +#include #include #include @@ -99,7 +100,7 @@ int generic_k_truss_test(const cugraph_resource_handle_t* handle, } cugraph_induced_subgraph_result_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } diff --git a/cpp/tests/c_api/mg_katz_test.c b/cpp/tests/c_api/mg_katz_test.c index 2efb5d50539..6d000c335da 100644 --- a/cpp/tests/c_api/mg_katz_test.c +++ b/cpp/tests/c_api/mg_katz_test.c @@ -94,7 +94,7 @@ int generic_katz_test(const cugraph_resource_handle_t* handle, } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_leiden_test.c b/cpp/tests/c_api/mg_leiden_test.c index 72719b4d515..231c021c467 100644 --- a/cpp/tests/c_api/mg_leiden_test.c +++ b/cpp/tests/c_api/mg_leiden_test.c @@ -105,7 +105,7 @@ int generic_leiden_test(const cugraph_resource_handle_t* p_handle, cugraph_hierarchical_clustering_result_free(p_result); } - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_lookup_src_dst_test.c b/cpp/tests/c_api/mg_lookup_src_dst_test.c index 0cffffeb425..8c85d245acc 100644 --- a/cpp/tests/c_api/mg_lookup_src_dst_test.c +++ b/cpp/tests/c_api/mg_lookup_src_dst_test.c @@ -206,7 +206,7 @@ int generic_lookup_src_dst_test(const cugraph_resource_handle_t* handle, cugraph_lookup_result_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_louvain_test.c b/cpp/tests/c_api/mg_louvain_test.c index 858783614e5..54331fd8c66 100644 --- a/cpp/tests/c_api/mg_louvain_test.c +++ b/cpp/tests/c_api/mg_louvain_test.c @@ -96,7 +96,7 @@ int generic_louvain_test(const cugraph_resource_handle_t* p_handle, cugraph_hierarchical_clustering_result_free(p_result); } - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_negative_sampling_test.c b/cpp/tests/c_api/mg_negative_sampling_test.c index 3289206d8db..274bad35dfb 100644 --- a/cpp/tests/c_api/mg_negative_sampling_test.c +++ b/cpp/tests/c_api/mg_negative_sampling_test.c @@ -203,7 +203,7 @@ int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_free(d_src_bias); cugraph_type_erased_device_array_free(d_dst_bias); cugraph_coo_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } diff --git a/cpp/tests/c_api/mg_pagerank_test.c b/cpp/tests/c_api/mg_pagerank_test.c index 8bd02e70181..4616db3f704 100644 --- a/cpp/tests/c_api/mg_pagerank_test.c +++ b/cpp/tests/c_api/mg_pagerank_test.c @@ -94,7 +94,7 @@ int generic_pagerank_test(const cugraph_resource_handle_t* handle, } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; @@ -169,7 +169,7 @@ int generic_pagerank_nonconverging_test(const cugraph_resource_handle_t* handle, } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; @@ -278,7 +278,7 @@ int generic_personalized_pagerank_test(const cugraph_resource_handle_t* handle, } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; @@ -387,7 +387,7 @@ int generic_personalized_pagerank_nonconverging_test(const cugraph_resource_hand } cugraph_centrality_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_random_walks_test.c b/cpp/tests/c_api/mg_random_walks_test.c index 1c3e4ac0d38..13252e0f1dc 100644 --- a/cpp/tests/c_api/mg_random_walks_test.c +++ b/cpp/tests/c_api/mg_random_walks_test.c @@ -130,7 +130,7 @@ int generic_uniform_random_walks_test(const cugraph_resource_handle_t* handle, } cugraph_random_walk_result_free(result); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; @@ -232,7 +232,7 @@ int generic_biased_random_walks_test(const cugraph_resource_handle_t* handle, cugraph_random_walk_result_free(result); #endif - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; @@ -338,7 +338,7 @@ int generic_node2vec_random_walks_test(const cugraph_resource_handle_t* handle, cugraph_random_walk_result_free(result); #endif - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_similarity_test.c b/cpp/tests/c_api/mg_similarity_test.c index 486ca34aaca..637f66e40ed 100644 --- a/cpp/tests/c_api/mg_similarity_test.c +++ b/cpp/tests/c_api/mg_similarity_test.c @@ -189,7 +189,7 @@ int generic_similarity_test(const cugraph_resource_handle_t* handle, if (result != NULL) cugraph_similarity_result_free(result); if (vertex_pairs != NULL) cugraph_vertex_pairs_free(vertex_pairs); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_sssp_test.c b/cpp/tests/c_api/mg_sssp_test.c index 1158885aed2..3103b7331f4 100644 --- a/cpp/tests/c_api/mg_sssp_test.c +++ b/cpp/tests/c_api/mg_sssp_test.c @@ -94,7 +94,7 @@ int generic_sssp_test(const cugraph_resource_handle_t* p_handle, cugraph_type_erased_device_array_view_free(distances); cugraph_type_erased_device_array_view_free(predecessors); cugraph_paths_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; @@ -167,7 +167,7 @@ int generic_sssp_test_double(const cugraph_resource_handle_t* p_handle, cugraph_type_erased_device_array_view_free(distances); cugraph_type_erased_device_array_view_free(predecessors); cugraph_paths_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_strongly_connected_components_test.c b/cpp/tests/c_api/mg_strongly_connected_components_test.c index 38b2691c784..95777cc86fe 100644 --- a/cpp/tests/c_api/mg_strongly_connected_components_test.c +++ b/cpp/tests/c_api/mg_strongly_connected_components_test.c @@ -100,7 +100,7 @@ int generic_scc_test(const cugraph_resource_handle_t* handle, cugraph_labeling_result_free(p_result); #endif - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_test_utils.cpp b/cpp/tests/c_api/mg_test_utils.cpp index 58c5e59c16f..98b64014726 100644 --- a/cpp/tests/c_api/mg_test_utils.cpp +++ b/cpp/tests/c_api/mg_test_utils.cpp @@ -191,16 +191,20 @@ extern "C" int create_mg_test_graph(const cugraph_resource_handle_t* handle, handle, wgt_view, (byte_t*)h_wgt, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_mg_graph_create(handle, + ret_code = cugraph_graph_create_mg(handle, &properties, - src_view, - dst_view, - wgt_view, + NULL, + &src_view, + &dst_view, + &wgt_view, NULL, NULL, store_transposed, original_num_edges, // UNUSED FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -285,16 +289,20 @@ extern "C" int create_mg_test_graph_double(const cugraph_resource_handle_t* hand handle, wgt_view, (byte_t*)h_wgt, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_mg_graph_create(handle, + ret_code = cugraph_graph_create_mg(handle, &properties, - src_view, - dst_view, - wgt_view, + NULL, + &src_view, + &dst_view, + &wgt_view, NULL, NULL, store_transposed, original_num_edges, // UNUSED FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -373,16 +381,20 @@ extern "C" int create_mg_test_graph_with_edge_ids(const cugraph_resource_handle_ handle, idx_view, (byte_t*)h_idx, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_mg_graph_create(handle, + ret_code = cugraph_graph_create_mg(handle, &properties, - src_view, - dst_view, NULL, - idx_view, + &src_view, + &dst_view, + NULL, + &idx_view, NULL, store_transposed, original_num_edges, // UNUSED FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -496,16 +508,20 @@ extern "C" int create_mg_test_graph_with_properties(const cugraph_resource_handl TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); } - ret_code = cugraph_mg_graph_create(handle, + ret_code = cugraph_graph_create_mg(handle, &properties, - src_view, - dst_view, - wgt_view, - idx_view, - type_view, + NULL, + &src_view, + &dst_view, + &wgt_view, + &idx_view, + &type_view, store_transposed, original_num_edges, // UNUSED FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -625,16 +641,20 @@ int create_mg_test_graph_new(const cugraph_resource_handle_t* handle, TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "edge_id copy_from_host failed."); } - ret_code = cugraph_mg_graph_create(handle, + ret_code = cugraph_graph_create_mg(handle, &properties, - src_view, - dst_view, - wgt_view, - edge_id_view, - edge_type_view, + NULL, + &src_view, + &dst_view, + &wgt_view, + &edge_id_view, + &edge_type_view, store_transposed, original_num_edges, // UNUSED FALSE, + FALSE, + FALSE, + FALSE, graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); diff --git a/cpp/tests/c_api/mg_triangle_count_test.c b/cpp/tests/c_api/mg_triangle_count_test.c index d6eec6aad25..149c42046f5 100644 --- a/cpp/tests/c_api/mg_triangle_count_test.c +++ b/cpp/tests/c_api/mg_triangle_count_test.c @@ -105,7 +105,7 @@ int generic_triangle_count_test(const cugraph_resource_handle_t* handle, cugraph_triangle_count_result_free(p_result); } - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_two_hop_neighbors_test.c b/cpp/tests/c_api/mg_two_hop_neighbors_test.c index 056da2bcc45..31d5d535c8d 100644 --- a/cpp/tests/c_api/mg_two_hop_neighbors_test.c +++ b/cpp/tests/c_api/mg_two_hop_neighbors_test.c @@ -110,7 +110,7 @@ int generic_two_hop_nbr_test(const cugraph_resource_handle_t* resource_handle, cugraph_vertex_pairs_free(result); cugraph_type_erased_device_array_view_free(start_vertices_view); cugraph_type_erased_device_array_free(start_vertices); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c index 3d8fb02ed46..b046b453c1c 100644 --- a/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/mg_uniform_neighbor_sample_test.c @@ -431,7 +431,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle cugraph_sample_result_free(result); #endif - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } @@ -676,7 +676,7 @@ int test_uniform_neighbor_from_alex(const cugraph_resource_handle_t* handle) cugraph_sample_result_free(result); cugraph_type_erased_host_array_view_free(h_fan_out_view); - cugraph_mg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); cugraph_sampling_options_free(sampling_options); @@ -938,7 +938,7 @@ int test_uniform_neighbor_sample_alex_bug(const cugraph_resource_handle_t* handl cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } @@ -1217,7 +1217,7 @@ int test_uniform_neighbor_sample_sort_by_hop(const cugraph_resource_handle_t* ha cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } diff --git a/cpp/tests/c_api/mg_weakly_connected_components_test.c b/cpp/tests/c_api/mg_weakly_connected_components_test.c index 3410c6dfd69..9b9dcfd6d5a 100644 --- a/cpp/tests/c_api/mg_weakly_connected_components_test.c +++ b/cpp/tests/c_api/mg_weakly_connected_components_test.c @@ -93,7 +93,7 @@ int generic_wcc_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_view_free(components); cugraph_type_erased_device_array_view_free(vertices); cugraph_labeling_result_free(p_result); - cugraph_mg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_error_free(ret_error); return test_ret_value; diff --git a/cpp/tests/c_api/negative_sampling_test.c b/cpp/tests/c_api/negative_sampling_test.c index 5e8d3f7e765..52360d622dd 100644 --- a/cpp/tests/c_api/negative_sampling_test.c +++ b/cpp/tests/c_api/negative_sampling_test.c @@ -194,7 +194,7 @@ int generic_negative_sampling_test(const cugraph_resource_handle_t* handle, cugraph_type_erased_device_array_free(d_vertices); cugraph_type_erased_device_array_free(d_src_bias); cugraph_coo_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } diff --git a/cpp/tests/c_api/pagerank_test.c b/cpp/tests/c_api/pagerank_test.c index 0d55852dbb2..b0caef58eee 100644 --- a/cpp/tests/c_api/pagerank_test.c +++ b/cpp/tests/c_api/pagerank_test.c @@ -93,7 +93,7 @@ int generic_pagerank_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); @@ -168,7 +168,7 @@ int generic_pagerank_nonconverging_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); @@ -277,7 +277,7 @@ int generic_personalized_pagerank_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); @@ -386,7 +386,7 @@ int generic_personalized_pagerank_nonconverging_test(vertex_t* h_src, } cugraph_centrality_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/sg_random_walks_test.c b/cpp/tests/c_api/sg_random_walks_test.c index a4a77b5775a..05d77a0b3b2 100644 --- a/cpp/tests/c_api/sg_random_walks_test.c +++ b/cpp/tests/c_api/sg_random_walks_test.c @@ -141,7 +141,7 @@ int generic_uniform_random_walks_test(vertex_t* h_src, } cugraph_random_walk_result_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); @@ -258,7 +258,7 @@ int generic_biased_random_walks_test(vertex_t* h_src, cugraph_random_walk_result_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); @@ -377,7 +377,7 @@ int generic_node2vec_random_walks_test(vertex_t* h_src, cugraph_random_walk_result_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/similarity_test.c b/cpp/tests/c_api/similarity_test.c index 70e0cb6fb95..ac4dff850fa 100644 --- a/cpp/tests/c_api/similarity_test.c +++ b/cpp/tests/c_api/similarity_test.c @@ -128,7 +128,7 @@ int generic_similarity_test(vertex_t* h_src, if (result != NULL) cugraph_similarity_result_free(result); if (vertex_pairs != NULL) cugraph_vertex_pairs_free(vertex_pairs); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); @@ -238,7 +238,7 @@ int generic_all_pairs_similarity_test(vertex_t* h_src, } if (result != NULL) cugraph_similarity_result_free(result); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/sssp_test.c b/cpp/tests/c_api/sssp_test.c index 48039fcb43c..290542b1f9d 100644 --- a/cpp/tests/c_api/sssp_test.c +++ b/cpp/tests/c_api/sssp_test.c @@ -94,7 +94,7 @@ int generic_sssp_test(vertex_t* h_src, cugraph_type_erased_device_array_view_free(distances); cugraph_type_erased_device_array_view_free(predecessors); cugraph_paths_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); @@ -168,7 +168,7 @@ int generic_sssp_test_double(vertex_t* h_src, cugraph_type_erased_device_array_view_free(distances); cugraph_type_erased_device_array_view_free(predecessors); cugraph_paths_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/strongly_connected_components_test.c b/cpp/tests/c_api/strongly_connected_components_test.c index 24dd24c3fcd..0706c33a0bb 100644 --- a/cpp/tests/c_api/strongly_connected_components_test.c +++ b/cpp/tests/c_api/strongly_connected_components_test.c @@ -95,7 +95,7 @@ int generic_scc_test(vertex_t* h_src, cugraph_type_erased_device_array_view_free(vertices); cugraph_labeling_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/test_utils.cpp b/cpp/tests/c_api/test_utils.cpp index 193251917a4..2df62345784 100644 --- a/cpp/tests/c_api/test_utils.cpp +++ b/cpp/tests/c_api/test_utils.cpp @@ -98,8 +98,9 @@ extern "C" int create_test_graph(const cugraph_resource_handle_t* p_handle, p_handle, wgt_view, (byte_t*)h_wgt, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_sg_graph_create(p_handle, + ret_code = cugraph_graph_create_sg(p_handle, &properties, + nullptr, src_view, dst_view, wgt_view, @@ -108,6 +109,9 @@ extern "C" int create_test_graph(const cugraph_resource_handle_t* p_handle, store_transposed, renumber, FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -180,8 +184,9 @@ extern "C" int create_test_graph_double(const cugraph_resource_handle_t* p_handl p_handle, wgt_view, (byte_t*)h_wgt, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt copy_from_host failed."); - ret_code = cugraph_sg_graph_create(p_handle, + ret_code = cugraph_graph_create_sg(p_handle, &properties, + nullptr, src_view, dst_view, wgt_view, @@ -190,6 +195,9 @@ extern "C" int create_test_graph_double(const cugraph_resource_handle_t* p_handl store_transposed, renumber, FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -355,8 +363,9 @@ int create_sg_test_graph(const cugraph_resource_handle_t* handle, TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "edge_id copy_from_host failed."); } - ret_code = cugraph_sg_graph_create(handle, + ret_code = cugraph_graph_create_sg(handle, &properties, + nullptr, src_view, dst_view, wgt_view, @@ -365,6 +374,9 @@ int create_sg_test_graph(const cugraph_resource_handle_t* handle, store_transposed, renumber, FALSE, + FALSE, + FALSE, + FALSE, graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); diff --git a/cpp/tests/c_api/triangle_count_test.c b/cpp/tests/c_api/triangle_count_test.c index 5929e3d6560..383cc335941 100644 --- a/cpp/tests/c_api/triangle_count_test.c +++ b/cpp/tests/c_api/triangle_count_test.c @@ -102,7 +102,7 @@ int generic_triangle_count_test(vertex_t* h_src, cugraph_triangle_count_result_free(p_result); } - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/two_hop_neighbors_test.c b/cpp/tests/c_api/two_hop_neighbors_test.c index bc95db3932b..44ccfd11622 100644 --- a/cpp/tests/c_api/two_hop_neighbors_test.c +++ b/cpp/tests/c_api/two_hop_neighbors_test.c @@ -117,7 +117,7 @@ int generic_two_hop_nbr_test(vertex_t* h_src, cugraph_vertex_pairs_free(result); cugraph_type_erased_device_array_view_free(start_vertices_view); cugraph_type_erased_device_array_free(start_vertices); - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_free_resource_handle(resource_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/c_api/uniform_neighbor_sample_test.c b/cpp/tests/c_api/uniform_neighbor_sample_test.c index 451dbca51a7..404e38627ae 100644 --- a/cpp/tests/c_api/uniform_neighbor_sample_test.c +++ b/cpp/tests/c_api/uniform_neighbor_sample_test.c @@ -460,7 +460,7 @@ int generic_uniform_neighbor_sample_test(const cugraph_resource_handle_t* handle cugraph_sample_result_free(result); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); return test_ret_value; } @@ -528,8 +528,9 @@ int create_test_graph_with_edge_ids(const cugraph_resource_handle_t* p_handle, ret_code = cugraph_type_erased_device_array_view_as_type(ids, weight_tid, &wgt_view, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "wgt cast from ids failed."); - ret_code = cugraph_sg_graph_create(p_handle, + ret_code = cugraph_graph_create_sg(p_handle, &properties, + NULL, src_view, dst_view, wgt_view, @@ -538,6 +539,9 @@ int create_test_graph_with_edge_ids(const cugraph_resource_handle_t* p_handle, store_transposed, renumber, FALSE, + FALSE, + FALSE, + FALSE, p_graph, ret_error); TEST_ASSERT(test_ret_value, ret_code == CUGRAPH_SUCCESS, "graph creation failed."); @@ -766,7 +770,7 @@ int test_uniform_neighbor_sample_with_labels(const cugraph_resource_handle_t* ha cugraph_sampling_options_free(sampling_options); #endif - cugraph_sg_graph_free(graph); + cugraph_graph_free(graph); cugraph_error_free(ret_error); } diff --git a/cpp/tests/c_api/weakly_connected_components_test.c b/cpp/tests/c_api/weakly_connected_components_test.c index ee1a6b9066b..04fdcbc8930 100644 --- a/cpp/tests/c_api/weakly_connected_components_test.c +++ b/cpp/tests/c_api/weakly_connected_components_test.c @@ -93,7 +93,7 @@ int generic_wcc_test(vertex_t* h_src, cugraph_type_erased_device_array_view_free(components); cugraph_type_erased_device_array_view_free(vertices); cugraph_labeling_result_free(p_result); - cugraph_sg_graph_free(p_graph); + cugraph_graph_free(p_graph); cugraph_free_resource_handle(p_handle); cugraph_error_free(ret_error); diff --git a/cpp/tests/prims/mg_count_if_v.cu b/cpp/tests/prims/mg_count_if_v.cu index 56550027936..19ec285109c 100644 --- a/cpp/tests/prims/mg_count_if_v.cu +++ b/cpp/tests/prims/mg_count_if_v.cu @@ -48,7 +48,7 @@ struct test_predicate { test_predicate(int mod_count) : mod(mod_count) {} __device__ bool operator()(vertex_t, const vertex_t& val) { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return (0 == (hash_func(val) % mod)); } }; diff --git a/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_intersection.cu b/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_intersection.cu index fc6369ec721..4025d4d1b1d 100644 --- a/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_intersection.cu +++ b/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_intersection.cu @@ -137,7 +137,7 @@ class Tests_MGPerVPairTransformDstNbrIntersection cugraph::get_dataframe_buffer_begin(mg_vertex_pair_buffer), cugraph::get_dataframe_buffer_end(mg_vertex_pair_buffer), [comm_rank, num_vertices = mg_graph_view.number_of_vertices()] __device__(size_t i) { - cuco::detail::MurmurHash3_32 + cuco::murmurhash3_32 hash_func{}; // use hash_func to generate arbitrary vertex pairs auto v0 = static_cast(hash_func(i + comm_rank) % num_vertices); auto v1 = static_cast(hash_func(i + num_vertices + comm_rank) % num_vertices); diff --git a/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_weighted_intersection.cu b/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_weighted_intersection.cu index 06a23880d81..8af187554e1 100644 --- a/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_weighted_intersection.cu +++ b/cpp/tests/prims/mg_per_v_pair_transform_dst_nbr_weighted_intersection.cu @@ -163,7 +163,7 @@ class Tests_MGPerVPairTransformDstNbrIntersection cugraph::get_dataframe_buffer_begin(mg_vertex_pair_buffer), cugraph::get_dataframe_buffer_end(mg_vertex_pair_buffer), [comm_rank, num_vertices = mg_graph_view.number_of_vertices()] __device__(size_t i) { - cuco::detail::MurmurHash3_32 + cuco::murmurhash3_32 hash_func{}; // use hash_func to generate arbitrary vertex pairs auto v0 = static_cast(hash_func(i + comm_rank) % num_vertices); auto v1 = static_cast(hash_func(i + num_vertices + comm_rank) % num_vertices); diff --git a/cpp/tests/prims/mg_transform_reduce_v.cu b/cpp/tests/prims/mg_transform_reduce_v.cu index 0e6d71094bd..9e9bee89d67 100644 --- a/cpp/tests/prims/mg_transform_reduce_v.cu +++ b/cpp/tests/prims/mg_transform_reduce_v.cu @@ -53,7 +53,7 @@ struct v_op_t { __device__ auto operator()(vertex_t, vertex_t val) const { - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return cugraph::test::detail::make_property_value(hash_func(val) % mod); } }; diff --git a/cpp/tests/utilities/property_generator_kernels.cuh b/cpp/tests/utilities/property_generator_kernels.cuh index d8d5cc420fd..78b22e0dac2 100644 --- a/cpp/tests/utilities/property_generator_kernels.cuh +++ b/cpp/tests/utilities/property_generator_kernels.cuh @@ -60,7 +60,7 @@ struct vertex_property_transform { { static_assert(cugraph::is_thrust_tuple_of_arithmetic::value || std::is_arithmetic_v); - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return make_property_value(hash_func(v) % mod); } }; @@ -74,7 +74,7 @@ struct edge_property_transform { { static_assert(cugraph::is_thrust_tuple_of_arithmetic::value || std::is_arithmetic_v); - cuco::detail::MurmurHash3_32 hash_func{}; + cuco::murmurhash3_32 hash_func{}; return make_property_value(hash_func(src + dst) % mod); } }; diff --git a/python/nx-cugraph/README.md b/python/nx-cugraph/README.md index c3ca0b880a9..8cc3a5d90df 100644 --- a/python/nx-cugraph/README.md +++ b/python/nx-cugraph/README.md @@ -1,7 +1,7 @@ # nx-cugraph ## Description -[RAPIDS](https://rapids.ai) nx-cugraph is a [backend to NetworkX](https://networkx.org/documentation/stable/reference/utils.html#backends) +[RAPIDS](https://rapids.ai) nx-cugraph is a [backend to NetworkX](https://networkx.org/documentation/stable/backends.html) to run supported algorithms with GPU acceleration. ## System Requirements @@ -10,7 +10,7 @@ nx-cugraph requires the following: * NVIDIA GPU, Volta architecture or later, with [compute capability](https://developer.nvidia.com/cuda-gpus) 7.0+ * CUDA 11.2, 11.4, 11.5, 11.8, 12.0, 12.2, or 12.5 * Python version 3.10, 3.11, or 3.12 - * NetworkX >= version 3.0 (version 3.2 or higher recommended) + * NetworkX >= version 3.0 (version 3.4 or higher recommended) More details about system requirements can be found in the [RAPIDS System Requirements documentation](https://docs.rapids.ai/install#system-req). @@ -45,18 +45,20 @@ Notes: NetworkX will use nx-cugraph as the graph analytics backend if any of the following are used: -### `NETWORKX_AUTOMATIC_BACKENDS` environment variable. -The `NETWORKX_AUTOMATIC_BACKENDS` environment variable can be used to have NetworkX automatically dispatch to specified backends an API is called that the backend supports. -Set `NETWORKX_AUTOMATIC_BACKENDS=cugraph` to use nx-cugraph to GPU accelerate supported APIs with no code changes. +### `NX_CUGRAPH_AUTOCONFIG` environment variable. +By setting `NX_CUGRAPH_AUTOCONFIG=True`, NetworkX will automatically dispatch algorithm calls to nx-cugraph (if the backend is supported). This allows users to GPU accelerate their code with zero code change. + +Read more on [Networkx Backends and How They Work](https://networkx.org/documentation/stable/reference/backends.html). + Example: ``` -bash> NETWORKX_AUTOMATIC_BACKENDS=cugraph python my_networkx_script.py +bash> NX_CUGRAPH_AUTOCONFIG=True python my_networkx_script.py ``` ### `backend=` keyword argument To explicitly specify a particular backend for an API, use the `backend=` keyword argument. This argument takes precedence over the -`NETWORKX_AUTOMATIC_BACKENDS` environment variable. This requires anyone +`NX_CUGRAPH_AUTOCONFIG` environment variable. This requires anyone running code that uses the `backend=` keyword argument to have the specified backend installed. diff --git a/python/nx-cugraph/_nx_cugraph/__init__.py b/python/nx-cugraph/_nx_cugraph/__init__.py index fc0bea47180..9feeda568a6 100644 --- a/python/nx-cugraph/_nx_cugraph/__init__.py +++ b/python/nx-cugraph/_nx_cugraph/__init__.py @@ -36,7 +36,7 @@ "backend_name": "cugraph", "project": "nx-cugraph", "package": "nx_cugraph", - "url": f"https://rapids.ai/nx-cugraph", + "url": "https://rapids.ai/nx-cugraph", "short_summary": "GPU-accelerated backend.", # "description": "TODO", "functions": { @@ -180,7 +180,7 @@ "ego_graph": "Weighted ego_graph with negative cycles is not yet supported. `NotImplementedError` will be raised if there are negative `distance` edge weights.", "eigenvector_centrality": "`nstart` parameter is not used, but it is checked for validity.", "from_pandas_edgelist": "cudf.DataFrame inputs also supported; value columns with str is unsuppported.", - "generic_bfs_edges": "`neighbors` and `sort_neighbors` parameters are not yet supported.", + "generic_bfs_edges": "`neighbors` parameter is not yet supported.", "katz_centrality": "`nstart` isn't used (but is checked), and `normalized=False` is not supported.", "louvain_communities": "`seed` parameter is currently ignored, and self-loops are not yet supported.", "pagerank": "`dangling` parameter is not supported, but it is checked for validity.", diff --git a/python/nx-cugraph/nx_cugraph/tests/test_ego_graph.py b/python/nx-cugraph/nx_cugraph/tests/test_ego_graph.py index 0697a744e85..f3d0a8d3767 100644 --- a/python/nx-cugraph/nx_cugraph/tests/test_ego_graph.py +++ b/python/nx-cugraph/nx_cugraph/tests/test_ego_graph.py @@ -78,7 +78,7 @@ def test_ego_graph_cycle_graph( nx.ego_graph(Gnx, n, **kwargs, backend="cugraph") with pytest.raises(NotImplementedError, match="ego_graph"): nx.ego_graph(Gcg, n, **kwargs, backend="cugraph") - if _nxver < (3, 4): + if _nxver < (3, 4) or not nx.config.fallback_to_nx: with pytest.raises(NotImplementedError, match="ego_graph"): nx.ego_graph(Gcg, n, **kwargs) else: @@ -86,7 +86,6 @@ def test_ego_graph_cycle_graph( # these arguments, so it falls back to networkx. Hence, as it is currently # implemented, the input graph is `nxcg.CudaGraph`, but the output graph # is `nx.Graph`. Should networkx convert back to "cugraph" backend? - # TODO: make fallback to networkx configurable. H2cg = nx.ego_graph(Gcg, n, **kwargs) assert type(H2nx) is type(H2cg) assert_graphs_equal(H2nx, nxcg.from_networkx(H2cg, preserve_all_attrs=True)) diff --git a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd index 497607860bd..5bbe5bc4a87 100644 --- a/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd +++ b/python/pylibcugraph/pylibcugraph/_cugraph_c/graph.pxd @@ -37,21 +37,6 @@ cdef extern from "cugraph_c/graph.h": bool_t is_symmetric bool_t is_multigraph - cdef cugraph_error_code_t \ - cugraph_sg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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_types, - bool_t store_transposed, - bool_t renumber, - bool_t check, - cugraph_graph_t** graph, - cugraph_error_t** error) - # Supports isolated vertices cdef cugraph_error_code_t \ cugraph_graph_create_sg( @@ -72,12 +57,6 @@ cdef extern from "cugraph_c/graph.h": cugraph_graph_t** graph, cugraph_error_t** error) - # This may get renamed to cugraph_graph_free() - cdef void \ - cugraph_sg_graph_free( - cugraph_graph_t* graph - ) - # FIXME: Might want to delete 'cugraph_sg_graph_free' and replace # 'cugraph_mg_graph_free' by 'cugraph_graph_free' cdef void \ @@ -85,45 +64,6 @@ cdef extern from "cugraph_c/graph.h": cugraph_graph_t* graph ) - cdef cugraph_error_code_t \ - cugraph_mg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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_types, - bool_t store_transposed, - size_t num_edges, - bool_t check, - cugraph_graph_t** graph, - cugraph_error_t** error - ) - - # This may get renamed to or replaced with cugraph_graph_free() - cdef void \ - cugraph_mg_graph_free( - cugraph_graph_t* graph - ) - - cdef cugraph_error_code_t \ - cugraph_sg_graph_create_from_csr( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - const cugraph_type_erased_device_array_view_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, - bool_t store_transposed, - bool_t renumber, - bool_t symmetrize, - bool_t check, - cugraph_graph_t** graph, - cugraph_error_t** error - ) - cdef cugraph_error_code_t \ cugraph_graph_create_sg_from_csr( const cugraph_resource_handle_t* handle, @@ -135,27 +75,7 @@ cdef extern from "cugraph_c/graph.h": const cugraph_type_erased_device_array_view_t* edge_type_ids, bool_t store_transposed, bool_t renumber, - bool_t check, - cugraph_graph_t** graph, - cugraph_error_t** error - ) - - cdef void \ - cugraph_sg_graph_free( - cugraph_graph_t* graph - ) - - cdef cugraph_error_code_t \ - cugraph_mg_graph_create( - const cugraph_resource_handle_t* handle, - const cugraph_graph_properties_t* properties, - 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, - bool_t store_transposed, - size_t num_edges, + bool_t symmetrize, bool_t check, cugraph_graph_t** graph, cugraph_error_t** error @@ -179,8 +99,3 @@ cdef extern from "cugraph_c/graph.h": bool_t do_expensive_check, cugraph_graph_t** graph, cugraph_error_t** error) - - cdef void \ - cugraph_mg_graph_free( - cugraph_graph_t* graph - ) diff --git a/python/pylibcugraph/pylibcugraph/graphs.pyx b/python/pylibcugraph/pylibcugraph/graphs.pyx index 6eda0a83d3e..ba32eb5b641 100644 --- a/python/pylibcugraph/pylibcugraph/graphs.pyx +++ b/python/pylibcugraph/pylibcugraph/graphs.pyx @@ -26,12 +26,8 @@ from pylibcugraph._cugraph_c.array cimport ( from pylibcugraph._cugraph_c.graph cimport ( cugraph_graph_create_sg, cugraph_graph_create_mg, - cugraph_sg_graph_create_from_csr, #FIXME: Remove this once - # 'cugraph_graph_create_sg_from_csr' is exposed cugraph_graph_create_sg_from_csr, - cugraph_sg_graph_free, #FIXME: Remove this cugraph_graph_free, - cugraph_mg_graph_free, #FIXME: Remove this ) from pylibcugraph.resource_handle cimport ( ResourceHandle, @@ -234,7 +230,7 @@ cdef class SGGraph(_GPUGraph): "cugraph_graph_create_sg()") elif input_array_format == "CSR": - error_code = cugraph_sg_graph_create_from_csr( + error_code = cugraph_graph_create_sg_from_csr( resource_handle.c_resource_handle_ptr, &(graph_properties.c_graph_properties), srcs_or_offsets_view_ptr, @@ -270,7 +266,7 @@ cdef class SGGraph(_GPUGraph): def __dealloc__(self): if self.c_graph_ptr is not NULL: - cugraph_sg_graph_free(self.c_graph_ptr) + cugraph_graph_free(self.c_graph_ptr) cdef class MGGraph(_GPUGraph): @@ -503,4 +499,4 @@ cdef class MGGraph(_GPUGraph): def __dealloc__(self): if self.c_graph_ptr is not NULL: - cugraph_mg_graph_free(self.c_graph_ptr) + cugraph_graph_free(self.c_graph_ptr)