From 2e3546d983d80f3e68f18ee2db2f724ba2465c15 Mon Sep 17 00:00:00 2001 From: Ralph Liu <137829296+nv-rliu@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:54:37 -0400 Subject: [PATCH 01/11] Fix Broken `cpp_build` by Pinning Openmpi Build Ver (24.06) (#4475) Addresses #4474 Currently `openmpi=5.0.3-hfd7b305_105` is blocking our CI `cpp_build` job. Most likely introduced by this PR: https://github.com/conda-forge/openmpi-feedstock/pull/158 This PR will unblock cugraph development until the issues are fixed. Once that happens, the version pinning should be removed. --- conda/environments/all_cuda-118_arch-x86_64.yaml | 2 +- conda/environments/all_cuda-122_arch-x86_64.yaml | 2 +- conda/recipes/libcugraph/meta.yaml | 2 +- dependencies.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 659a2b911fb..b043243c5c3 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -42,7 +42,7 @@ dependencies: - numpy>=1.23,<2.0a0 - numpydoc - nvcc_linux-64=11.8 -- openmpi +- openmpi<5.0.3 - packaging>=21 - pandas - pre-commit diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index 377e4151f9b..4a114e73876 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -47,7 +47,7 @@ dependencies: - numba>=0.57 - numpy>=1.23,<2.0a0 - numpydoc -- openmpi +- openmpi<5.0.3 - packaging>=21 - pandas - pre-commit diff --git a/conda/recipes/libcugraph/meta.yaml b/conda/recipes/libcugraph/meta.yaml index a4bb361aa6b..cbd97604cff 100644 --- a/conda/recipes/libcugraph/meta.yaml +++ b/conda/recipes/libcugraph/meta.yaml @@ -42,7 +42,7 @@ requirements: - {{ compiler('cxx') }} - cmake {{ cmake_version }} - ninja - - openmpi # Required for building cpp-mgtests (multi-GPU tests) + - openmpi<5.0.3 # Required for building cpp-mgtests (multi-GPU tests) - {{ stdlib("c") }} host: {% if cuda_major == "11" %} diff --git a/dependencies.yaml b/dependencies.yaml index 19634420520..3c1320f12e4 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -364,7 +364,7 @@ dependencies: - libraft-headers==24.6.* - libraft==24.6.* - librmm==24.6.* - - openmpi # Required for building cpp-mgtests (multi-GPU tests) + - openmpi<5.0.3 # Required for building cpp-mgtests (multi-GPU tests) specific: - output_types: [conda] matrices: From f4c519ec7b8ae430fe0832e5ad68c1b7f07c1943 Mon Sep 17 00:00:00 2001 From: Alex Barghi <105237337+alexbarghi-nv@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:22:13 -0400 Subject: [PATCH 02/11] [BUG] Pin Test Version of PyTorch to 2.1 to Resolve NCCL Error (#4464) PyTorch 2.2+ is incompatible with the NCCL version on our containers. Normally, this would not be an issue, but there is a bug in CuPy that loads the system NCCL instead of the user NCCL. This PR binds the PyTorch test dependency version to get around this issue. --------- Co-authored-by: Bradley Dice Co-authored-by: Ralph Liu <137829296+nv-rliu@users.noreply.github.com> Co-authored-by: James Lamb --- ci/build_wheel.sh | 8 +++++- ci/test_python.sh | 15 ++++------- ci/test_wheel_cugraph-pyg.sh | 1 - .../all_cuda-118_arch-x86_64.yaml | 1 + .../all_cuda-122_arch-x86_64.yaml | 1 + dependencies.yaml | 27 ++++++++++++++++++- python/cugraph-dgl/pyproject.toml | 2 ++ python/cugraph-pyg/pyproject.toml | 2 ++ .../cugraph/gnn/data_loading/dist_sampler.py | 24 +++++++++++++---- .../tests/sampling/test_bulk_sampler_io.py | 3 ++- .../tests/sampling/test_dist_sampler.py | 4 +++ .../tests/sampling/test_dist_sampler_mg.py | 4 +++ 12 files changed, 73 insertions(+), 19 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index c980ed320dc..da0f3617f3f 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -56,7 +56,13 @@ fi cd "${package_dir}" -python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check +python -m pip wheel \ + -w dist \ + -vvv \ + --no-deps \ + --disable-pip-version-check \ + --extra-index-url https://pypi.nvidia.com \ + . # pure-python packages should be marked as pure, and not have auditwheel run on them. if [[ ${package_name} == "nx-cugraph" ]] || \ diff --git a/ci/test_python.sh b/ci/test_python.sh index c215e25c526..ea9aa833939 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -44,6 +44,8 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi +export LD_PRELOAD="${CONDA_PREFIX}/lib/libgomp.so.1" + # RAPIDS_DATASET_ROOT_DIR is used by test scripts export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" pushd "${RAPIDS_DATASET_ROOT_DIR}" @@ -193,6 +195,8 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then conda activate test_cugraph_pyg set -u + rapids-print-env + # TODO re-enable logic once CUDA 12 is testable #if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then CONDA_CUDA_VERSION="11.8" @@ -206,18 +210,9 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ --channel "${PYTHON_CHANNEL}" \ - --channel pytorch \ --channel pyg \ - --channel nvidia \ "cugraph-pyg" \ - "pytorch=2.1.0" \ - "pytorch-cuda=${CONDA_CUDA_VERSION}" - - # Install pyg dependencies (which requires pip) - - pip install \ - ogb \ - tensordict + "ogb" pip install \ pyg_lib \ diff --git a/ci/test_wheel_cugraph-pyg.sh b/ci/test_wheel_cugraph-pyg.sh index 1004063cc38..c55ae033344 100755 --- a/ci/test_wheel_cugraph-pyg.sh +++ b/ci/test_wheel_cugraph-pyg.sh @@ -42,7 +42,6 @@ rapids-retry python -m pip install \ pyg_lib \ torch_scatter \ torch_sparse \ - tensordict \ -f ${PYG_URL} rapids-logger "pytest cugraph-pyg (single GPU)" diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index b043243c5c3..d997c25773b 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -56,6 +56,7 @@ dependencies: - pytest-mpl - pytest-xdist - python-louvain +- pytorch>=2.0,<2.2.0a0 - raft-dask==24.6.* - rapids-dask-dependency==24.6.* - recommonmark diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index 4a114e73876..ffb5a2d1ca6 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -61,6 +61,7 @@ dependencies: - pytest-mpl - pytest-xdist - python-louvain +- pytorch>=2.0,<2.2.0a0 - raft-dask==24.6.* - rapids-dask-dependency==24.6.* - recommonmark diff --git a/dependencies.yaml b/dependencies.yaml index 3c1320f12e4..20da98687b8 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -22,6 +22,7 @@ files: - depends_on_pylibcugraphops - depends_on_pylibwholegraph - depends_on_cupy + - depends_on_pytorch - python_run_cugraph - python_run_nx_cugraph - python_run_cugraph_dgl @@ -62,6 +63,7 @@ files: - cuda_version - depends_on_cudf - depends_on_pylibwholegraph + - depends_on_pytorch - py_version - test_python_common - test_python_cugraph @@ -179,6 +181,7 @@ files: includes: - test_python_common - depends_on_pylibwholegraph + - depends_on_pytorch py_build_cugraph_pyg: output: pyproject pyproject_dir: python/cugraph-pyg @@ -203,6 +206,7 @@ files: includes: - test_python_common - depends_on_pylibwholegraph + - depends_on_pytorch py_build_cugraph_equivariant: output: pyproject pyproject_dir: python/cugraph-equivariant @@ -568,9 +572,30 @@ dependencies: - cugraph==24.6.* - pytorch>=2.0 - pytorch-cuda==11.8 - - tensordict>=0.1.2 + - &tensordict tensordict>=0.1.2 - pyg>=2.5,<2.6 + depends_on_pytorch: + common: + - output_types: [conda] + packages: + - &pytorch_conda pytorch>=2.0,<2.2.0a0 + + specific: + - output_types: [requirements, pyproject] + matrices: + - matrix: {cuda: "12.*"} + packages: + - &pytorch_pip torch>=2.0,<2.2.0a0 + - *tensordict + - --extra-index-url=https://download.pytorch.org/whl/cu121 + - matrix: {cuda: "11.*"} + packages: + - *pytorch_pip + - *tensordict + - --extra-index-url=https://download.pytorch.org/whl/cu118 + - {matrix: null, packages: [*pytorch_pip, *tensordict]} + depends_on_pylibwholegraph: common: - output_types: conda diff --git a/python/cugraph-dgl/pyproject.toml b/python/cugraph-dgl/pyproject.toml index 534106eb87f..2da8e77cd69 100644 --- a/python/cugraph-dgl/pyproject.toml +++ b/python/cugraph-dgl/pyproject.toml @@ -38,6 +38,8 @@ test = [ "pytest-cov", "pytest-xdist", "scipy", + "tensordict>=0.1.2", + "torch>=2.0,<2.2.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project.urls] diff --git a/python/cugraph-pyg/pyproject.toml b/python/cugraph-pyg/pyproject.toml index b41911b5f80..5620568dcd0 100644 --- a/python/cugraph-pyg/pyproject.toml +++ b/python/cugraph-pyg/pyproject.toml @@ -46,6 +46,8 @@ test = [ "pytest-cov", "pytest-xdist", "scipy", + "tensordict>=0.1.2", + "torch>=2.0,<2.2.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [tool.setuptools] diff --git a/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py b/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py index 52638230b9b..a5a84362a07 100644 --- a/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py +++ b/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py @@ -24,14 +24,12 @@ from typing import Union, List, Dict, Tuple, Iterator, Optional -from cugraph.utilities import import_optional +from cugraph.utilities.utils import import_optional, MissingModule from cugraph.gnn.comms import cugraph_comms_get_raft_handle from cugraph.gnn.data_loading.bulk_sampler_io import create_df_from_disjoint_arrays -# PyTorch is NOT optional but this is required for container builds. -torch = import_optional("torch") - +torch = MissingModule("torch") TensorType = Union["torch.Tensor", cupy.ndarray, cudf.Series] @@ -44,6 +42,8 @@ def __init__( rank: Optional[int] = None, filelist=None, ): + torch = import_optional("torch") + self.__format = format self.__directory = directory @@ -77,6 +77,8 @@ def __iter__(self): return self def __next__(self): + torch = import_optional("torch") + if len(self.__files) > 0: f = self.__files.pop() fname = f[0] @@ -404,6 +406,7 @@ def get_reader(self) -> Iterator[Tuple[Dict[str, "torch.Tensor"], int, int]]: """ Returns an iterator over sampled data. """ + torch = import_optional("torch") rank = torch.distributed.get_rank() if self.is_multi_gpu else None return self.__writer.get_reader(rank) @@ -461,6 +464,8 @@ def get_label_list_and_output_rank( label_to_output_comm_rank: TensorType The global mapping of labels to ranks. """ + torch = import_optional("torch") + world_size = torch.distributed.get_world_size() if assume_equal_input_size: @@ -528,6 +533,8 @@ def get_start_batch_offset( and whether the input sizes on each rank are equal (bool). """ + torch = import_optional("torch") + input_size_is_equal = True if self.is_multi_gpu: rank = torch.distributed.get_rank() @@ -581,6 +588,8 @@ def sample_from_nodes( random_state: int The random seed to use for sampling. """ + torch = import_optional("torch") + nodes = torch.as_tensor(nodes, device="cuda") batches_per_call = self._local_seeds_per_call // batch_size @@ -700,6 +709,8 @@ def __init__( ) def __calc_local_seeds_per_call(self, local_seeds_per_call: Optional[int] = None): + torch = import_optional("torch") + if local_seeds_per_call is None: if len([x for x in self.__fanout if x <= 0]) > 0: return UniformNeighborSampler.UNKNOWN_VERTICES_DEFAULT @@ -721,6 +732,7 @@ def sample_batches( random_state: int = 0, assume_equal_input_size: bool = False, ) -> Dict[str, TensorType]: + torch = import_optional("torch") if self.is_multi_gpu: rank = torch.distributed.get_rank() @@ -800,7 +812,9 @@ def sample_batches( compression=self.__compression, compress_per_hop=self.__compress_per_hop, retain_seeds=self._retain_original_seeds, - label_offsets=cupy.asarray(label_offsets), + label_offsets=None + if label_offsets is None + else cupy.asarray(label_offsets), return_dict=True, ) diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py index 5eafe89ea83..ad5b70015de 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-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 @@ -169,6 +169,7 @@ def test_bulk_sampler_io_empty_batch(scratch_dir): @pytest.mark.sg +@pytest.mark.skip(reason="broken") def test_bulk_sampler_io_mock_csr(scratch_dir): major_offsets_array = cudf.Series([0, 5, 10, 15]) minors_array = cudf.Series([1, 2, 3, 4, 8, 9, 1, 3, 4, 5, 3, 0, 4, 9, 1]) diff --git a/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py b/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py index 02676774a02..88589429e85 100644 --- a/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py +++ b/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py @@ -31,6 +31,10 @@ torch = import_optional("torch") +if not isinstance(torch, MissingModule): + from rmm.allocators.torch import rmm_torch_allocator + + torch.cuda.change_current_allocator(rmm_torch_allocator) @pytest.fixture diff --git a/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py b/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py index bf65e46c516..324811e3368 100644 --- a/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py @@ -36,6 +36,10 @@ ) torch = import_optional("torch") +if __name__ == "__main__" and not isinstance(torch, MissingModule): + from rmm.allocators.torch import rmm_torch_allocator + + torch.cuda.change_current_allocator(rmm_torch_allocator) def karate_mg_graph(rank, world_size): From f519ac1b138c390fd8b9197ad91efe857cdb44f2 Mon Sep 17 00:00:00 2001 From: Ralph Liu <137829296+nv-rliu@users.noreply.github.com> Date: Wed, 19 Jun 2024 02:00:44 -0400 Subject: [PATCH 03/11] Forward merge branch-24.06 into branch-24.08 (#4489) Replaces https://github.com/rapidsai/cugraph/pull/4476 Authors: - Ralph Liu (https://github.com/nv-rliu) - Alex Barghi (https://github.com/alexbarghi-nv) - Tingyu Wang (https://github.com/tingyu66) - Bradley Dice (https://github.com/bdice) - James Lamb (https://github.com/jameslamb) Approvers: - Alex Barghi (https://github.com/alexbarghi-nv) - Chuck Hastings (https://github.com/ChuckHastings) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cugraph/pull/4489 --- ci/build_wheel.sh | 8 ++++- ci/build_wheel_cugraph.sh | 6 +++- ci/build_wheel_pylibcugraph.sh | 6 +++- ci/test_python.sh | 15 ++++------ ci/test_wheel_cugraph-pyg.sh | 1 - ci/test_wheel_nx-cugraph.sh | 7 ++++- .../all_cuda-118_arch-x86_64.yaml | 3 +- .../all_cuda-122_arch-x86_64.yaml | 3 +- conda/recipes/libcugraph/meta.yaml | 2 +- dependencies.yaml | 29 +++++++++++++++++-- python/cugraph-dgl/pyproject.toml | 2 ++ .../nn/tensor_product_conv.py | 10 ++++++- .../tests/test_tensor_product_conv.py | 9 +++++- python/cugraph-pyg/pyproject.toml | 2 ++ .../cugraph/gnn/data_loading/dist_sampler.py | 24 +++++++++++---- .../tests/sampling/test_bulk_sampler_io.py | 3 +- .../tests/sampling/test_dist_sampler.py | 4 +++ .../tests/sampling/test_dist_sampler_mg.py | 4 +++ 18 files changed, 110 insertions(+), 28 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index c980ed320dc..da0f3617f3f 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -56,7 +56,13 @@ fi cd "${package_dir}" -python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check +python -m pip wheel \ + -w dist \ + -vvv \ + --no-deps \ + --disable-pip-version-check \ + --extra-index-url https://pypi.nvidia.com \ + . # pure-python packages should be marked as pure, and not have auditwheel run on them. if [[ ${package_name} == "nx-cugraph" ]] || \ diff --git a/ci/build_wheel_cugraph.sh b/ci/build_wheel_cugraph.sh index ffd6445f8d5..6545ee3eca0 100755 --- a/ci/build_wheel_cugraph.sh +++ b/ci/build_wheel_cugraph.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -euo pipefail @@ -12,6 +12,10 @@ 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 export PIP_FIND_LINKS=$(pwd)/local-pylibcugraph +PARALLEL_LEVEL=$(python -c \ + "from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))") + export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" +export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}" ./ci/build_wheel.sh cugraph python/cugraph diff --git a/ci/build_wheel_pylibcugraph.sh b/ci/build_wheel_pylibcugraph.sh index 7c5a7299421..ee33ab4a82d 100755 --- a/ci/build_wheel_pylibcugraph.sh +++ b/ci/build_wheel_pylibcugraph.sh @@ -1,8 +1,12 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -euo pipefail +PARALLEL_LEVEL=$(python -c \ + "from math import ceil; from multiprocessing import cpu_count; print(ceil(cpu_count()/4))") + export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_CUGRAPH_CPP=OFF;-DCPM_cugraph-ops_SOURCE=${GITHUB_WORKSPACE}/cugraph-ops/" +export SKBUILD_BUILD_TOOL_ARGS="-j${PARALLEL_LEVEL};-l${PARALLEL_LEVEL}" ./ci/build_wheel.sh pylibcugraph python/pylibcugraph diff --git a/ci/test_python.sh b/ci/test_python.sh index fdcf88d692a..39159284f45 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -44,6 +44,8 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi +export LD_PRELOAD="${CONDA_PREFIX}/lib/libgomp.so.1" + # RAPIDS_DATASET_ROOT_DIR is used by test scripts export RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" pushd "${RAPIDS_DATASET_ROOT_DIR}" @@ -191,6 +193,8 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then conda activate test_cugraph_pyg set -u + rapids-print-env + # TODO re-enable logic once CUDA 12 is testable #if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then CONDA_CUDA_VERSION="11.8" @@ -204,18 +208,9 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then rapids-mamba-retry install \ --channel "${CPP_CHANNEL}" \ --channel "${PYTHON_CHANNEL}" \ - --channel pytorch \ --channel pyg \ - --channel nvidia \ "cugraph-pyg" \ - "pytorch=2.1.0" \ - "pytorch-cuda=${CONDA_CUDA_VERSION}" - - # Install pyg dependencies (which requires pip) - - pip install \ - ogb \ - tensordict + "ogb" pip install \ pyg_lib \ diff --git a/ci/test_wheel_cugraph-pyg.sh b/ci/test_wheel_cugraph-pyg.sh index 1004063cc38..c55ae033344 100755 --- a/ci/test_wheel_cugraph-pyg.sh +++ b/ci/test_wheel_cugraph-pyg.sh @@ -42,7 +42,6 @@ rapids-retry python -m pip install \ pyg_lib \ torch_scatter \ torch_sparse \ - tensordict \ -f ${PYG_URL} rapids-logger "pytest cugraph-pyg (single GPU)" diff --git a/ci/test_wheel_nx-cugraph.sh b/ci/test_wheel_nx-cugraph.sh index 53d40960fc3..b5adfbcb9d3 100755 --- a/ci/test_wheel_nx-cugraph.sh +++ b/ci/test_wheel_nx-cugraph.sh @@ -1,6 +1,11 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -eoxu pipefail +# Download wheels built during this job. +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 diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index a834620b89c..4a235eac7c4 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -42,7 +42,7 @@ dependencies: - numpy>=1.23,<2.0a0 - numpydoc - nvcc_linux-64=11.8 -- openmpi +- openmpi<5.0.3 - packaging>=21 - pandas - pre-commit @@ -56,6 +56,7 @@ dependencies: - pytest-mpl - pytest-xdist - python-louvain +- pytorch>=2.0,<2.2.0a0 - raft-dask==24.8.* - rapids-dask-dependency==24.8.* - recommonmark diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index a76034d71c3..8275634e55b 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -47,7 +47,7 @@ dependencies: - numba>=0.57 - numpy>=1.23,<2.0a0 - numpydoc -- openmpi +- openmpi<5.0.3 - packaging>=21 - pandas - pre-commit @@ -61,6 +61,7 @@ dependencies: - pytest-mpl - pytest-xdist - python-louvain +- pytorch>=2.0,<2.2.0a0 - raft-dask==24.8.* - rapids-dask-dependency==24.8.* - recommonmark diff --git a/conda/recipes/libcugraph/meta.yaml b/conda/recipes/libcugraph/meta.yaml index a4bb361aa6b..cbd97604cff 100644 --- a/conda/recipes/libcugraph/meta.yaml +++ b/conda/recipes/libcugraph/meta.yaml @@ -42,7 +42,7 @@ requirements: - {{ compiler('cxx') }} - cmake {{ cmake_version }} - ninja - - openmpi # Required for building cpp-mgtests (multi-GPU tests) + - openmpi<5.0.3 # Required for building cpp-mgtests (multi-GPU tests) - {{ stdlib("c") }} host: {% if cuda_major == "11" %} diff --git a/dependencies.yaml b/dependencies.yaml index 65772a6413a..91593bf9168 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -22,6 +22,7 @@ files: - depends_on_pylibcugraphops - depends_on_pylibwholegraph - depends_on_cupy + - depends_on_pytorch - python_run_cugraph - python_run_nx_cugraph - python_run_cugraph_dgl @@ -62,6 +63,7 @@ files: - cuda_version - depends_on_cudf - depends_on_pylibwholegraph + - depends_on_pytorch - py_version - test_python_common - test_python_cugraph @@ -177,6 +179,7 @@ files: includes: - test_python_common - depends_on_pylibwholegraph + - depends_on_pytorch py_build_cugraph_pyg: output: pyproject pyproject_dir: python/cugraph-pyg @@ -201,6 +204,7 @@ files: includes: - test_python_common - depends_on_pylibwholegraph + - depends_on_pytorch py_build_cugraph_equivariant: output: pyproject pyproject_dir: python/cugraph-equivariant @@ -362,7 +366,7 @@ dependencies: - libraft-headers==24.8.* - libraft==24.8.* - librmm==24.8.* - - openmpi # Required for building cpp-mgtests (multi-GPU tests) + - openmpi<5.0.3 # Required for building cpp-mgtests (multi-GPU tests) specific: - output_types: [conda] matrices: @@ -568,9 +572,30 @@ dependencies: - cugraph==24.8.* - pytorch>=2.0 - pytorch-cuda==11.8 - - tensordict>=0.1.2 + - &tensordict tensordict>=0.1.2 - pyg>=2.5,<2.6 + depends_on_pytorch: + common: + - output_types: [conda] + packages: + - &pytorch_conda pytorch>=2.0,<2.2.0a0 + + specific: + - output_types: [requirements, pyproject] + matrices: + - matrix: {cuda: "12.*"} + packages: + - &pytorch_pip torch>=2.0,<2.2.0a0 + - *tensordict + - --extra-index-url=https://download.pytorch.org/whl/cu121 + - matrix: {cuda: "11.*"} + packages: + - *pytorch_pip + - *tensordict + - --extra-index-url=https://download.pytorch.org/whl/cu118 + - {matrix: null, packages: [*pytorch_pip, *tensordict]} + depends_on_pylibwholegraph: common: - output_types: conda diff --git a/python/cugraph-dgl/pyproject.toml b/python/cugraph-dgl/pyproject.toml index b0ee00682a0..8f81d762a21 100644 --- a/python/cugraph-dgl/pyproject.toml +++ b/python/cugraph-dgl/pyproject.toml @@ -38,6 +38,8 @@ test = [ "pytest-cov", "pytest-xdist", "scipy", + "tensordict>=0.1.2", + "torch>=2.0,<2.2.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [project.urls] diff --git a/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py b/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py index af1d0efa76c..5a67fbe1502 100644 --- a/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py +++ b/python/cugraph-equivariant/cugraph_equivariant/nn/tensor_product_conv.py @@ -20,7 +20,15 @@ from cugraph_equivariant.utils import scatter_reduce -from pylibcugraphops.pytorch.operators import FusedFullyConnectedTensorProduct +try: + from pylibcugraphops.pytorch.operators import FusedFullyConnectedTensorProduct +except ImportError as exc: + raise RuntimeError( + "FullyConnectedTensorProductConv is no longer supported in " + "cugraph-equivariant starting from version 24.08. It will be migrated " + "to the new `cuequivariance` package. Please use 24.06 release for the " + "legacy interface." + ) from exc class FullyConnectedTensorProductConv(nn.Module): diff --git a/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py b/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py index a2a13b32cd2..7fbab1dc934 100644 --- a/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py +++ b/python/cugraph-equivariant/cugraph_equivariant/tests/test_tensor_product_conv.py @@ -16,7 +16,14 @@ import torch from torch import nn from e3nn import o3 -from cugraph_equivariant.nn import FullyConnectedTensorProductConv + +try: + from cugraph_equivariant.nn import FullyConnectedTensorProductConv +except RuntimeError: + pytest.skip( + "Migrated to cuequivariance package starting from 24.08.", + allow_module_level=True, + ) device = torch.device("cuda:0") diff --git a/python/cugraph-pyg/pyproject.toml b/python/cugraph-pyg/pyproject.toml index 7c4a27999e4..2bf744c817d 100644 --- a/python/cugraph-pyg/pyproject.toml +++ b/python/cugraph-pyg/pyproject.toml @@ -46,6 +46,8 @@ test = [ "pytest-cov", "pytest-xdist", "scipy", + "tensordict>=0.1.2", + "torch>=2.0,<2.2.0a0", ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [tool.setuptools] diff --git a/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py b/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py index 52638230b9b..a5a84362a07 100644 --- a/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py +++ b/python/cugraph/cugraph/gnn/data_loading/dist_sampler.py @@ -24,14 +24,12 @@ from typing import Union, List, Dict, Tuple, Iterator, Optional -from cugraph.utilities import import_optional +from cugraph.utilities.utils import import_optional, MissingModule from cugraph.gnn.comms import cugraph_comms_get_raft_handle from cugraph.gnn.data_loading.bulk_sampler_io import create_df_from_disjoint_arrays -# PyTorch is NOT optional but this is required for container builds. -torch = import_optional("torch") - +torch = MissingModule("torch") TensorType = Union["torch.Tensor", cupy.ndarray, cudf.Series] @@ -44,6 +42,8 @@ def __init__( rank: Optional[int] = None, filelist=None, ): + torch = import_optional("torch") + self.__format = format self.__directory = directory @@ -77,6 +77,8 @@ def __iter__(self): return self def __next__(self): + torch = import_optional("torch") + if len(self.__files) > 0: f = self.__files.pop() fname = f[0] @@ -404,6 +406,7 @@ def get_reader(self) -> Iterator[Tuple[Dict[str, "torch.Tensor"], int, int]]: """ Returns an iterator over sampled data. """ + torch = import_optional("torch") rank = torch.distributed.get_rank() if self.is_multi_gpu else None return self.__writer.get_reader(rank) @@ -461,6 +464,8 @@ def get_label_list_and_output_rank( label_to_output_comm_rank: TensorType The global mapping of labels to ranks. """ + torch = import_optional("torch") + world_size = torch.distributed.get_world_size() if assume_equal_input_size: @@ -528,6 +533,8 @@ def get_start_batch_offset( and whether the input sizes on each rank are equal (bool). """ + torch = import_optional("torch") + input_size_is_equal = True if self.is_multi_gpu: rank = torch.distributed.get_rank() @@ -581,6 +588,8 @@ def sample_from_nodes( random_state: int The random seed to use for sampling. """ + torch = import_optional("torch") + nodes = torch.as_tensor(nodes, device="cuda") batches_per_call = self._local_seeds_per_call // batch_size @@ -700,6 +709,8 @@ def __init__( ) def __calc_local_seeds_per_call(self, local_seeds_per_call: Optional[int] = None): + torch = import_optional("torch") + if local_seeds_per_call is None: if len([x for x in self.__fanout if x <= 0]) > 0: return UniformNeighborSampler.UNKNOWN_VERTICES_DEFAULT @@ -721,6 +732,7 @@ def sample_batches( random_state: int = 0, assume_equal_input_size: bool = False, ) -> Dict[str, TensorType]: + torch = import_optional("torch") if self.is_multi_gpu: rank = torch.distributed.get_rank() @@ -800,7 +812,9 @@ def sample_batches( compression=self.__compression, compress_per_hop=self.__compress_per_hop, retain_seeds=self._retain_original_seeds, - label_offsets=cupy.asarray(label_offsets), + label_offsets=None + if label_offsets is None + else cupy.asarray(label_offsets), return_dict=True, ) diff --git a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py index 5eafe89ea83..ad5b70015de 100644 --- a/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py +++ b/python/cugraph/cugraph/tests/sampling/test_bulk_sampler_io.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-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 @@ -169,6 +169,7 @@ def test_bulk_sampler_io_empty_batch(scratch_dir): @pytest.mark.sg +@pytest.mark.skip(reason="broken") def test_bulk_sampler_io_mock_csr(scratch_dir): major_offsets_array = cudf.Series([0, 5, 10, 15]) minors_array = cudf.Series([1, 2, 3, 4, 8, 9, 1, 3, 4, 5, 3, 0, 4, 9, 1]) diff --git a/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py b/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py index 02676774a02..88589429e85 100644 --- a/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py +++ b/python/cugraph/cugraph/tests/sampling/test_dist_sampler.py @@ -31,6 +31,10 @@ torch = import_optional("torch") +if not isinstance(torch, MissingModule): + from rmm.allocators.torch import rmm_torch_allocator + + torch.cuda.change_current_allocator(rmm_torch_allocator) @pytest.fixture diff --git a/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py b/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py index bf65e46c516..324811e3368 100644 --- a/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py +++ b/python/cugraph/cugraph/tests/sampling/test_dist_sampler_mg.py @@ -36,6 +36,10 @@ ) torch = import_optional("torch") +if __name__ == "__main__" and not isinstance(torch, MissingModule): + from rmm.allocators.torch import rmm_torch_allocator + + torch.cuda.change_current_allocator(rmm_torch_allocator) def karate_mg_graph(rank, world_size): From e4d51b2ae5368c926ef4fd689bb7c71e0241b80e Mon Sep 17 00:00:00 2001 From: Naim <110031745+naimnv@users.noreply.github.com> Date: Thu, 20 Jun 2024 00:33:41 +0200 Subject: [PATCH 04/11] compute cosine similarity for vertex pairs (#4482) compute cosine similarity for vertex pairs Authors: - Naim (https://github.com/naimnv) Approvers: - Seunghwa Kang (https://github.com/seunghwak) URL: https://github.com/rapidsai/cugraph/pull/4482 --- cpp/CMakeLists.txt | 2 + cpp/include/cugraph/algorithms.hpp | 87 +++++++++++ cpp/src/link_prediction/cosine_mg.cu | 122 +++++++++++++++ cpp/src/link_prediction/cosine_sg.cu | 122 +++++++++++++++ .../cosine_similarity_impl.cuh | 82 ++++++++++ cpp/src/link_prediction/jaccard_impl.cuh | 8 +- cpp/src/link_prediction/overlap_impl.cuh | 8 +- cpp/src/link_prediction/similarity_impl.cuh | 122 ++++++++++----- cpp/src/link_prediction/sorensen_impl.cuh | 8 +- .../link_prediction/mg_similarity_test.cpp | 28 ++++ .../mg_weighted_similarity_test.cpp | 28 ++++ .../link_prediction/similarity_compare.cpp | 141 +++++++++++++----- .../link_prediction/similarity_compare.hpp | 46 ++++++ cpp/tests/link_prediction/similarity_test.cu | 24 +++ .../weighted_similarity_test.cpp | 24 +++ 15 files changed, 764 insertions(+), 88 deletions(-) create mode 100644 cpp/src/link_prediction/cosine_mg.cu create mode 100644 cpp/src/link_prediction/cosine_sg.cu create mode 100644 cpp/src/link_prediction/cosine_similarity_impl.cuh diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7dca3d983a5..93f43b9ec56 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -193,9 +193,11 @@ set(CUGRAPH_SOURCES src/link_prediction/jaccard_sg.cu src/link_prediction/sorensen_sg.cu src/link_prediction/overlap_sg.cu + src/link_prediction/cosine_sg.cu src/link_prediction/jaccard_mg.cu src/link_prediction/sorensen_mg.cu src/link_prediction/overlap_mg.cu + src/link_prediction/cosine_mg.cu src/layout/legacy/force_atlas2.cu src/converters/legacy/COOtoCSR.cu src/community/legacy/spectral_clustering.cu diff --git a/cpp/include/cugraph/algorithms.hpp b/cpp/include/cugraph/algorithms.hpp index cc42399f091..bce484ece20 100644 --- a/cpp/include/cugraph/algorithms.hpp +++ b/cpp/include/cugraph/algorithms.hpp @@ -2082,6 +2082,37 @@ rmm::device_uvector jaccard_coefficients( std::tuple, raft::device_span> vertex_pairs, bool do_expensive_check = false); +/** + * @brief Compute Cosine similarity coefficient + * + * Similarity is computed for every pair of vertices specified. Note that + * similarity algorithms expect a symmetric graph. + * + * @throws cugraph::logic_error when an error occurs. + * + * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. + * @tparam edge_t Type of edge identifiers. Needs to be an integral type. + * @tparam weight_t Type of edge weights. Needs to be a floating point type. + * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) + * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and + * handles to various CUDA libraries) to run graph algorithms. + * @param graph_view Graph view object. + * @param edge_weight_view Optional view object holding edge weights for @p graph_view. If @p + * edge_weight_view.has_value() == true, use the weights associated with the graph. If false, assume + * a weight of 1 for all edges. + * @param vertex_pairs tuple of device spans defining the vertex pairs to compute similarity for + * In a multi-gpu context each vertex pair should be local to this GPU. + * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`). + * @return similarity coefficient for the corresponding @p vertex_pairs + */ +template +rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check = false); + /** * @brief Compute Sorensen similarity coefficient * @@ -2202,6 +2233,62 @@ std:: std::optional topk, bool do_expensive_check = false); +/** + * @brief Compute Consine all pairs similarity coefficient + * + * Similarity is computed for all pairs of vertices. Note that in a sparse + * graph, many of the vertex pairs will have a score of zero. We actually + * compute similarity only for vertices that are two hop neighbors within + * the graph, since vertices that are not two hop neighbors will have + * a score of 0. + * + * If @p vertices is specified we will compute similarity on two hop + * neighbors the @p vertices. If @p vertices is not specified it will + * compute similarity on all two hop neighbors in the graph. + * + * If @p topk is specified only the top @p topk scoring vertex pairs + * will be returned, if not specified then scores for all computed vertex pairs + * will be returned. + * + * Note the list of two hop neighbors in the entire graph might be a large + * number of vertex pairs. If the graph is dense enough it could be as large + * as the the number of vertices squared, which might run out of memory. + * + * @throws cugraph::logic_error when an error occurs. + * + * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. + * @tparam edge_t Type of edge identifiers. Needs to be an integral type. + * @tparam weight_t Type of edge weights. Needs to be a floating point type. + * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) + * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and + * handles to various CUDA libraries) to run graph algorithms. + * @param graph_view Graph view object. + * @param edge_weight_view Optional view object holding edge weights for @p graph_view. If @p + * edge_weight_view.has_value() == true, use the weights associated with the graph. If false, assume + * a weight of 1 for all edges. + * @param vertices optional device span defining the seed vertices. In a multi-gpu context the + * vertices should be local to this GPU. + * @param topk optional specification of the how many of the top scoring vertex pairs should be + * returned + * @param do_expensive_check A flag to run expensive checks for input arguments (if set to `true`). + * @return tuple containing three device vectors (v1, v2, score) of the same length. Corresponding + * elements in the vectors identify a result, v1 identifying a vertex in the graph, v2 identifying + * one of v1's two hop neighors, and the score identifying the similarity score between v1 and v2. + * If @p topk was specified then the vectors will be no longer than @p topk elements. In a + * multi-gpu context, if @p topk is specified all results will return on GPU rank 0, otherwise they + * will be returned on the local GPU for vertex v1. + */ +template +std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check = false); + /** * @brief Compute Sorensen similarity coefficient * diff --git a/cpp/src/link_prediction/cosine_mg.cu b/cpp/src/link_prediction/cosine_mg.cu new file mode 100644 index 00000000000..71b8e7030df --- /dev/null +++ b/cpp/src/link_prediction/cosine_mg.cu @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_sg.cu b/cpp/src/link_prediction/cosine_sg.cu new file mode 100644 index 00000000000..bf0cb79d802 --- /dev/null +++ b/cpp/src/link_prediction/cosine_sg.cu @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_similarity_impl.cuh b/cpp/src/link_prediction/cosine_similarity_impl.cuh new file mode 100644 index 00000000000..831f202c5e9 --- /dev/null +++ b/cpp/src/link_prediction/cosine_similarity_impl.cuh @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2022-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. + */ +#pragma once + +#include "link_prediction/similarity_impl.cuh" + +#include + +#include + +namespace cugraph { +namespace detail { + +template +struct cosine_functor_t { + weight_t __device__ compute_score(weight_t norm_a, + weight_t norm_b, + weight_t sum_of_product_of_a_and_b, + weight_t reserved_param) const + { + return sum_of_product_of_a_and_b / (norm_a * norm_b); + } +}; + +} // namespace detail + +template +rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check) +{ + CUGRAPH_EXPECTS(!graph_view.has_edge_mask(), "unimplemented."); + + return detail::similarity(handle, + graph_view, + edge_weight_view, + vertex_pairs, + detail::cosine_functor_t{}, + detail::coefficient_t::COSINE, + do_expensive_check); +} + +template +std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check) +{ + CUGRAPH_EXPECTS(!graph_view.has_edge_mask(), "unimplemented."); + + return detail::all_pairs_similarity(handle, + graph_view, + edge_weight_view, + vertices, + topk, + detail::cosine_functor_t{}, + detail::coefficient_t::COSINE, + do_expensive_check); +} + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_impl.cuh b/cpp/src/link_prediction/jaccard_impl.cuh index d8cfcf19b4f..f889f143c43 100644 --- a/cpp/src/link_prediction/jaccard_impl.cuh +++ b/cpp/src/link_prediction/jaccard_impl.cuh @@ -24,8 +24,8 @@ namespace cugraph { namespace detail { +template struct jaccard_functor_t { - template weight_t __device__ compute_score(weight_t weight_a, weight_t weight_b, weight_t weight_a_intersect_b, @@ -53,7 +53,8 @@ rmm::device_uvector jaccard_coefficients( graph_view, edge_weight_view, vertex_pairs, - detail::jaccard_functor_t{}, + detail::jaccard_functor_t{}, + detail::coefficient_t::JACCARD, do_expensive_check); } @@ -75,7 +76,8 @@ std:: edge_weight_view, vertices, topk, - detail::jaccard_functor_t{}, + detail::jaccard_functor_t{}, + detail::coefficient_t::JACCARD, do_expensive_check); } diff --git a/cpp/src/link_prediction/overlap_impl.cuh b/cpp/src/link_prediction/overlap_impl.cuh index 38e654453ff..f3a3319309e 100644 --- a/cpp/src/link_prediction/overlap_impl.cuh +++ b/cpp/src/link_prediction/overlap_impl.cuh @@ -24,8 +24,8 @@ namespace cugraph { namespace detail { +template struct overlap_functor_t { - template weight_t __device__ compute_score(weight_t weight_a, weight_t weight_b, weight_t weight_a_intersect_b, @@ -53,7 +53,8 @@ rmm::device_uvector overlap_coefficients( graph_view, edge_weight_view, vertex_pairs, - detail::overlap_functor_t{}, + detail::overlap_functor_t{}, + detail::coefficient_t::OVERLAP, do_expensive_check); } @@ -75,7 +76,8 @@ std:: edge_weight_view, vertices, topk, - detail::overlap_functor_t{}, + detail::overlap_functor_t{}, + detail::coefficient_t::OVERLAP, do_expensive_check); } diff --git a/cpp/src/link_prediction/similarity_impl.cuh b/cpp/src/link_prediction/similarity_impl.cuh index 00f7bc6cbe7..6a8882dcfab 100644 --- a/cpp/src/link_prediction/similarity_impl.cuh +++ b/cpp/src/link_prediction/similarity_impl.cuh @@ -36,6 +36,8 @@ namespace cugraph { namespace detail { +enum class coefficient_t { JACCARD, SORENSEN, OVERLAP, COSINE }; + template rmm::device_uvector similarity( raft::handle_t const& handle, @@ -43,6 +45,7 @@ rmm::device_uvector similarity( std::optional> edge_weight_view, std::tuple, raft::device_span> vertex_pairs, functor_t functor, + coefficient_t coeff, bool do_expensive_check = false) { using GraphViewType = graph_view_t; @@ -88,58 +91,86 @@ rmm::device_uvector similarity( vertex_pairs_begin, vertex_pairs_begin + num_vertex_pairs, weighted_out_degrees.begin(), - [functor] __device__(auto a, - auto b, - auto weight_a, - auto weight_b, - auto intersection, - auto intersected_properties_a, - auto intersected_properties_b) { - weight_t sum_of_min_weight_a_intersect_b = weight_t{0}; - weight_t sum_of_max_weight_a_intersect_b = weight_t{0}; - weight_t sum_of_intersected_a = weight_t{0}; - weight_t sum_of_intersected_b = weight_t{0}; - - auto pair_first = thrust::make_zip_iterator(intersected_properties_a.data(), - intersected_properties_b.data()); - thrust::tie(sum_of_min_weight_a_intersect_b, - sum_of_max_weight_a_intersect_b, - sum_of_intersected_a, - sum_of_intersected_b) = - thrust::transform_reduce( + [functor, coeff] __device__(auto a, + auto b, + auto weight_a, + auto weight_b, + auto intersection, + auto intersected_properties_a, + auto intersected_properties_b) { + if (coeff == coefficient_t::COSINE) { + weight_t norm_a = weight_t{0}; + weight_t norm_b = weight_t{0}; + weight_t sum_of_product_of_a_and_b = weight_t{0}; + + auto pair_first = thrust::make_zip_iterator(intersected_properties_a.data(), + intersected_properties_b.data()); + thrust::tie(norm_a, norm_b, sum_of_product_of_a_and_b) = thrust::transform_reduce( thrust::seq, pair_first, pair_first + intersected_properties_a.size(), [] __device__(auto property_pair) { auto prop_a = thrust::get<0>(property_pair); auto prop_b = thrust::get<1>(property_pair); - return thrust::make_tuple(min(prop_a, prop_b), max(prop_a, prop_b), prop_a, prop_b); + return thrust::make_tuple(prop_a * prop_a, prop_b * prop_b, prop_a * prop_b); }, - thrust::make_tuple(weight_t{0}, weight_t{0}, weight_t{0}, weight_t{0}), + thrust::make_tuple(weight_t{0}, weight_t{0}, weight_t{0}), [] __device__(auto lhs, auto rhs) { return thrust::make_tuple(thrust::get<0>(lhs) + thrust::get<0>(rhs), thrust::get<1>(lhs) + thrust::get<1>(rhs), - thrust::get<2>(lhs) + thrust::get<2>(rhs), - thrust::get<3>(lhs) + thrust::get<3>(rhs)); + thrust::get<2>(lhs) + thrust::get<2>(rhs)); }); - weight_t sum_of_uniq_a = weight_a - sum_of_intersected_a; - weight_t sum_of_uniq_b = weight_b - sum_of_intersected_b; - - sum_of_max_weight_a_intersect_b += sum_of_uniq_a + sum_of_uniq_b; - - return functor.compute_score(static_cast(weight_a), - static_cast(weight_b), - static_cast(sum_of_min_weight_a_intersect_b), - static_cast(sum_of_max_weight_a_intersect_b)); + return functor.compute_score(static_cast(sqrt(norm_a)), + static_cast(sqrt(norm_b)), + static_cast(sum_of_product_of_a_and_b), + weight_t{1.0}); + + } else { + weight_t sum_of_min_weight_a_intersect_b = weight_t{0}; + weight_t sum_of_max_weight_a_intersect_b = weight_t{0}; + weight_t sum_of_intersected_a = weight_t{0}; + weight_t sum_of_intersected_b = weight_t{0}; + + auto pair_first = thrust::make_zip_iterator(intersected_properties_a.data(), + intersected_properties_b.data()); + thrust::tie(sum_of_min_weight_a_intersect_b, + sum_of_max_weight_a_intersect_b, + sum_of_intersected_a, + sum_of_intersected_b) = + thrust::transform_reduce( + thrust::seq, + pair_first, + pair_first + intersected_properties_a.size(), + [] __device__(auto property_pair) { + auto prop_a = thrust::get<0>(property_pair); + auto prop_b = thrust::get<1>(property_pair); + return thrust::make_tuple(min(prop_a, prop_b), max(prop_a, prop_b), prop_a, prop_b); + }, + thrust::make_tuple(weight_t{0}, weight_t{0}, weight_t{0}, weight_t{0}), + [] __device__(auto lhs, auto rhs) { + return thrust::make_tuple(thrust::get<0>(lhs) + thrust::get<0>(rhs), + thrust::get<1>(lhs) + thrust::get<1>(rhs), + thrust::get<2>(lhs) + thrust::get<2>(rhs), + thrust::get<3>(lhs) + thrust::get<3>(rhs)); + }); + + weight_t sum_of_uniq_a = weight_a - sum_of_intersected_a; + weight_t sum_of_uniq_b = weight_b - sum_of_intersected_b; + + sum_of_max_weight_a_intersect_b += sum_of_uniq_a + sum_of_uniq_b; + + return functor.compute_score(static_cast(weight_a), + static_cast(weight_b), + static_cast(sum_of_min_weight_a_intersect_b), + static_cast(sum_of_max_weight_a_intersect_b)); + } }, similarity_score.begin(), do_expensive_check); - return similarity_score; } else { rmm::device_uvector similarity_score(num_vertex_pairs, handle.get_stream()); - auto out_degrees = graph_view.compute_out_degrees(handle); per_v_pair_transform_dst_nbr_intersection( @@ -149,17 +180,23 @@ rmm::device_uvector similarity( vertex_pairs_begin, vertex_pairs_begin + num_vertex_pairs, out_degrees.begin(), - [functor] __device__( + [functor, coeff] __device__( auto v1, auto v2, auto v1_degree, auto v2_degree, auto intersection, auto, auto) { - return functor.compute_score( - static_cast(v1_degree), - static_cast(v2_degree), - static_cast(intersection.size()), - static_cast(v1_degree + v2_degree - intersection.size())); + if (coeff == coefficient_t::COSINE) { + return functor.compute_score(weight_t{1}, + weight_t{1}, + intersection.size() >= 1 ? weight_t{1} : weight_t{0}, + weight_t{1}); + } else { + return functor.compute_score( + static_cast(v1_degree), + static_cast(v2_degree), + static_cast(intersection.size()), + static_cast(v1_degree + v2_degree - intersection.size())); + } }, similarity_score.begin(), do_expensive_check); - return similarity_score; } } @@ -174,6 +211,7 @@ all_pairs_similarity(raft::handle_t const& handle, std::optional> vertices, std::optional topk, functor_t functor, + coefficient_t coeff, bool do_expensive_check = false) { using GraphViewType = graph_view_t; @@ -391,6 +429,7 @@ all_pairs_similarity(raft::handle_t const& handle, std::make_tuple(raft::device_span{v1.data(), v1.size()}, raft::device_span{v2.data(), v2.size()}), functor, + coeff, do_expensive_check); // Add a remove_if to remove items that are less than the last topk element @@ -581,6 +620,7 @@ all_pairs_similarity(raft::handle_t const& handle, std::make_tuple(raft::device_span{v1.data(), v1.size()}, raft::device_span{v2.data(), v2.size()}), functor, + coeff, do_expensive_check); return std::make_tuple(std::move(v1), std::move(v2), std::move(score)); diff --git a/cpp/src/link_prediction/sorensen_impl.cuh b/cpp/src/link_prediction/sorensen_impl.cuh index af99732a45e..064e59d9f3d 100644 --- a/cpp/src/link_prediction/sorensen_impl.cuh +++ b/cpp/src/link_prediction/sorensen_impl.cuh @@ -24,8 +24,8 @@ namespace cugraph { namespace detail { +template struct sorensen_functor_t { - template weight_t __device__ compute_score(weight_t weight_a, weight_t weight_b, weight_t weight_a_intersect_b, @@ -53,7 +53,8 @@ rmm::device_uvector sorensen_coefficients( graph_view, edge_weight_view, vertex_pairs, - detail::sorensen_functor_t{}, + detail::sorensen_functor_t{}, + detail::coefficient_t::SORENSEN, do_expensive_check); } @@ -75,7 +76,8 @@ std:: edge_weight_view, vertices, topk, - detail::sorensen_functor_t{}, + detail::sorensen_functor_t{}, + detail::coefficient_t::SORENSEN, do_expensive_check); } diff --git a/cpp/tests/link_prediction/mg_similarity_test.cpp b/cpp/tests/link_prediction/mg_similarity_test.cpp index 3a71f8ee221..8f674e6a6de 100644 --- a/cpp/tests/link_prediction/mg_similarity_test.cpp +++ b/cpp/tests/link_prediction/mg_similarity_test.cpp @@ -252,6 +252,34 @@ TEST_P(Tests_MGSimilarity_Rmat, CheckInt64Int64FloatOverlap) override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_overlap_t{}); } +TEST_P(Tests_MGSimilarity_File, CheckInt32Int32FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGSimilarity_Rmat, CheckInt32Int32FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGSimilarity_Rmat, CheckInt32Int64FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGSimilarity_Rmat, CheckInt64Int64FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + INSTANTIATE_TEST_SUITE_P( file_test, Tests_MGSimilarity_File, diff --git a/cpp/tests/link_prediction/mg_weighted_similarity_test.cpp b/cpp/tests/link_prediction/mg_weighted_similarity_test.cpp index 3d891484818..192caa5227e 100644 --- a/cpp/tests/link_prediction/mg_weighted_similarity_test.cpp +++ b/cpp/tests/link_prediction/mg_weighted_similarity_test.cpp @@ -262,6 +262,34 @@ TEST_P(Tests_MGWeightedSimilarity_Rmat, CheckInt64Int64FloatOverlap) override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_overlap_t{}); } +TEST_P(Tests_MGWeightedSimilarity_File, CheckInt32Int32FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGWeightedSimilarity_Rmat, CheckInt32Int32FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGWeightedSimilarity_Rmat, CheckInt32Int64FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_MGWeightedSimilarity_Rmat, CheckInt64Int64FloatFloatCosine) +{ + auto param = GetParam(); + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + INSTANTIATE_TEST_SUITE_P( file_test, Tests_MGWeightedSimilarity_File, diff --git a/cpp/tests/link_prediction/similarity_compare.cpp b/cpp/tests/link_prediction/similarity_compare.cpp index b5da85cd36f..3c9459e988a 100644 --- a/cpp/tests/link_prediction/similarity_compare.cpp +++ b/cpp/tests/link_prediction/similarity_compare.cpp @@ -161,33 +161,56 @@ void weighted_similarity_compare( ++intersected_weight_idx; }); - weight_t sum_intersected_weights_v1 = - std::accumulate(intersected_weights_v1.begin(), intersected_weights_v1.end(), 0.0); - weight_t sum_intersected_weights_v2 = - std::accumulate(intersected_weights_v2.begin(), intersected_weights_v2.end(), 0.0); - - weight_t sum_of_uniq_weights_v1 = weighted_vertex_degrees[v1] - sum_intersected_weights_v1; - weight_t sum_of_uniq_weights_v2 = weighted_vertex_degrees[v2] - sum_intersected_weights_v2; - - weight_t min_weight_v1_intersect_v2 = weight_t{0}; - weight_t max_weight_v1_intersect_v2 = weight_t{0}; - - std::for_each( - thrust::make_zip_iterator(intersected_weights_v1.begin(), intersected_weights_v2.begin()), - thrust::make_zip_iterator(intersected_weights_v1.end(), intersected_weights_v2.end()), - [&min_weight_v1_intersect_v2, - &max_weight_v1_intersect_v2](thrust::tuple w1_w2) { - min_weight_v1_intersect_v2 += std::min(thrust::get<0>(w1_w2), thrust::get<1>(w1_w2)); - max_weight_v1_intersect_v2 += std::max(thrust::get<0>(w1_w2), thrust::get<1>(w1_w2)); - }); - - max_weight_v1_intersect_v2 += (sum_of_uniq_weights_v1 + sum_of_uniq_weights_v2); - auto expected_score = test_functor.compute_score(weighted_vertex_degrees[v1], - weighted_vertex_degrees[v2], - min_weight_v1_intersect_v2, - max_weight_v1_intersect_v2); - EXPECT_TRUE(compare_functor(score, expected_score)) - << "score mismatch, got " << score << ", expected " << expected_score; + if (test_functor.is_jaccard_or_sorensen_or_overlap) { + weight_t sum_intersected_weights_v1 = + std::accumulate(intersected_weights_v1.begin(), intersected_weights_v1.end(), 0.0); + weight_t sum_intersected_weights_v2 = + std::accumulate(intersected_weights_v2.begin(), intersected_weights_v2.end(), 0.0); + + weight_t sum_of_uniq_weights_v1 = weighted_vertex_degrees[v1] - sum_intersected_weights_v1; + weight_t sum_of_uniq_weights_v2 = weighted_vertex_degrees[v2] - sum_intersected_weights_v2; + + weight_t min_weight_v1_intersect_v2 = weight_t{0}; + weight_t max_weight_v1_intersect_v2 = weight_t{0}; + + std::for_each( + thrust::make_zip_iterator(intersected_weights_v1.begin(), intersected_weights_v2.begin()), + thrust::make_zip_iterator(intersected_weights_v1.end(), intersected_weights_v2.end()), + [&min_weight_v1_intersect_v2, + &max_weight_v1_intersect_v2](thrust::tuple w1_w2) { + min_weight_v1_intersect_v2 += std::min(thrust::get<0>(w1_w2), thrust::get<1>(w1_w2)); + max_weight_v1_intersect_v2 += std::max(thrust::get<0>(w1_w2), thrust::get<1>(w1_w2)); + }); + + max_weight_v1_intersect_v2 += (sum_of_uniq_weights_v1 + sum_of_uniq_weights_v2); + auto expected_score = test_functor.compute_score(weighted_vertex_degrees[v1], + weighted_vertex_degrees[v2], + min_weight_v1_intersect_v2, + max_weight_v1_intersect_v2); + EXPECT_TRUE(compare_functor(score, expected_score)) + << "score mismatch, got " << score << ", expected " << expected_score; + } else { + weight_t norm_v1 = weight_t{0}; + weight_t norm_v2 = weight_t{0}; + weight_t v1_dot_v2 = weight_t{0}; + + std::for_each( + thrust::make_zip_iterator(intersected_weights_v1.begin(), intersected_weights_v2.begin()), + thrust::make_zip_iterator(intersected_weights_v1.end(), intersected_weights_v2.end()), + [&norm_v1, &norm_v2, &v1_dot_v2](thrust::tuple w1_w2) { + auto x = thrust::get<0>(w1_w2); + auto y = thrust::get<1>(w1_w2); + + norm_v1 += x * x; + norm_v2 += y * y; + v1_dot_v2 += x * y; + }); + + auto expected_score = test_functor.compute_score( + std::sqrt(norm_v1), std::sqrt(norm_v2), v1_dot_v2, weight_t{1.0}); + EXPECT_TRUE(compare_functor(score, expected_score)) + << "score mismatch, got " << score << ", expected " << expected_score; + } }); } @@ -249,15 +272,27 @@ void similarity_compare( graph_dst.begin() + v2_end, intersection.begin()); - auto expected_score = test_functor.compute_score( - static_cast(vertex_degrees[v1]), - static_cast(vertex_degrees[v2]), - static_cast(std::distance(intersection.begin(), intersection_end)), - static_cast(vertex_degrees[v1] + vertex_degrees[v2] - - std::distance(intersection.begin(), intersection_end))); - - EXPECT_TRUE(compare_functor(score, expected_score)) - << "score mismatch, got " << score << ", expected " << expected_score; + if (test_functor.is_jaccard_or_sorensen_or_overlap) { + auto expected_score = test_functor.compute_score( + static_cast(vertex_degrees[v1]), + static_cast(vertex_degrees[v2]), + static_cast(std::distance(intersection.begin(), intersection_end)), + static_cast(vertex_degrees[v1] + vertex_degrees[v2] - + std::distance(intersection.begin(), intersection_end))); + + EXPECT_TRUE(compare_functor(score, expected_score)) + << "score mismatch, got " << score << ", expected " << expected_score; + + } else { + auto expected_score = + test_functor.compute_score(weight_t{1}, + weight_t{1}, + intersection.size() >= 1 ? weight_t{1} : weight_t{0}, + weight_t{1}); + + EXPECT_TRUE(compare_functor(score, expected_score)) + << "score mismatch, got " << score << ", expected " << expected_score; + } }); } @@ -269,6 +304,14 @@ template void similarity_compare( std::vector& result_score, test_jaccard_t const& test_functor); +template void similarity_compare( + int32_t num_vertices, + std::tuple&, std::vector&, std::optional>&> + edge_list, + std::tuple&, std::vector&> vertex_pairs, + std::vector& result_score, + test_cosine_t const& test_functor); + template void similarity_compare( int32_t num_vertices, std::tuple&, std::vector&, std::optional>&> @@ -293,6 +336,14 @@ template void similarity_compare( std::vector& result_score, test_jaccard_t const& test_functor); +template void similarity_compare( + int64_t num_vertices, + std::tuple&, std::vector&, std::optional>&> + edge_list, + std::tuple&, std::vector&> vertex_pairs, + std::vector& result_score, + test_cosine_t const& test_functor); + template void similarity_compare( int64_t num_vertices, std::tuple&, std::vector&, std::optional>&> @@ -309,8 +360,6 @@ template void similarity_compare( std::vector& result_score, test_overlap_t const& test_functor); -//// - template void weighted_similarity_compare( int32_t num_vertices, std::tuple&, std::vector&, std::optional>&> @@ -319,6 +368,14 @@ template void weighted_similarity_compare( std::vector& result_score, test_jaccard_t const& test_functor); +template void weighted_similarity_compare( + int32_t num_vertices, + std::tuple&, std::vector&, std::optional>&> + edge_list, + std::tuple&, std::vector&> vertex_pairs, + std::vector& result_score, + test_cosine_t const& test_functor); + template void weighted_similarity_compare( int32_t num_vertices, std::tuple&, std::vector&, std::optional>&> @@ -343,6 +400,14 @@ template void weighted_similarity_compare( std::vector& result_score, test_jaccard_t const& test_functor); +template void weighted_similarity_compare( + int64_t num_vertices, + std::tuple&, std::vector&, std::optional>&> + edge_list, + std::tuple&, std::vector&> vertex_pairs, + std::vector& result_score, + test_cosine_t const& test_functor); + template void weighted_similarity_compare( int64_t num_vertices, std::tuple&, std::vector&, std::optional>&> diff --git a/cpp/tests/link_prediction/similarity_compare.hpp b/cpp/tests/link_prediction/similarity_compare.hpp index eed0a82fe7e..d34916c0bae 100644 --- a/cpp/tests/link_prediction/similarity_compare.hpp +++ b/cpp/tests/link_prediction/similarity_compare.hpp @@ -28,6 +28,7 @@ namespace test { struct test_jaccard_t { std::string testname{"Jaccard"}; + bool is_jaccard_or_sorensen_or_overlap{true}; template weight_t compute_score(weight_t weight_a, @@ -69,6 +70,7 @@ struct test_jaccard_t { struct test_sorensen_t { std::string testname{"Sorensen"}; + bool is_jaccard_or_sorensen_or_overlap{true}; template weight_t compute_score(weight_t weight_a, @@ -110,6 +112,7 @@ struct test_sorensen_t { struct test_overlap_t { std::string testname{"Overlap"}; + bool is_jaccard_or_sorensen_or_overlap{true}; template weight_t compute_score(weight_t weight_a, @@ -149,6 +152,49 @@ struct test_overlap_t { } }; +struct test_cosine_t { + std::string testname{"Cosine"}; + bool is_jaccard_or_sorensen_or_overlap{false}; + + template + weight_t compute_score(weight_t norm_a, + weight_t norm_b, + weight_t sum_of_product_of_a_and_b, + weight_t reserved_param) const + { + if (std::abs(static_cast(norm_a * norm_b)) < + double{2} / std::numeric_limits::max()) { + return weight_t{0}; + } else { + return sum_of_product_of_a_and_b / (norm_a * norm_b); + } + } + + template + auto run( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool use_weights) const + { + return cugraph::cosine_similarity_coefficients( + handle, graph_view, edge_weight_view, vertex_pairs, true); + } + + template + auto run(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool use_weights, + std::optional topk) const + { + return cugraph::cosine_similarity_all_pairs_coefficients( + handle, graph_view, edge_weight_view, vertices, topk); + } +}; + template void similarity_compare( vertex_t num_vertices, diff --git a/cpp/tests/link_prediction/similarity_test.cu b/cpp/tests/link_prediction/similarity_test.cu index feeea257597..5547c4bd0c0 100644 --- a/cpp/tests/link_prediction/similarity_test.cu +++ b/cpp/tests/link_prediction/similarity_test.cu @@ -283,6 +283,30 @@ TEST_P(Tests_Similarity_Rmat, CheckInt64Int64FloatOverlap) override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_overlap_t{}); } +TEST_P(Tests_Similarity_File, CheckInt32Int32FloatCosine) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt32Int32FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt32Int64FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt64Int64FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + INSTANTIATE_TEST_SUITE_P( file_test, Tests_Similarity_File, diff --git a/cpp/tests/link_prediction/weighted_similarity_test.cpp b/cpp/tests/link_prediction/weighted_similarity_test.cpp index 570369a0236..2450e7d6376 100644 --- a/cpp/tests/link_prediction/weighted_similarity_test.cpp +++ b/cpp/tests/link_prediction/weighted_similarity_test.cpp @@ -293,6 +293,30 @@ TEST_P(Tests_Similarity_Rmat, CheckInt64Int64FloatOverlap) override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_overlap_t{}); } +TEST_P(Tests_Similarity_File, CheckInt32Int32FloatCosine) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt32Int32FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt32Int64FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + +TEST_P(Tests_Similarity_Rmat, CheckInt64Int64FloatCosine) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam()), cugraph::test::test_cosine_t{}); +} + INSTANTIATE_TEST_SUITE_P( file_test, Tests_Similarity_File, From 34f8471354da7255dbc12fc4eb9c4e6bd8352064 Mon Sep 17 00:00:00 2001 From: Ralph Liu <137829296+nv-rliu@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:11:40 -0400 Subject: [PATCH 05/11] Skip MG `dgl_uniform_sampler` test in nightlies (#4479) Addresses https://github.com/rapidsai/graph_dl/issues/500 This PR adds a marker to skip `test_dgl_uniform_sampler_mg.py` in our nightly workflow on draco to unblock other tests that are waiting to be run. This will be marked "Skipped" while it is being investigated. Authors: - Ralph Liu (https://github.com/nv-rliu) Approvers: - Rick Ratzel (https://github.com/rlratzel) URL: https://github.com/rapidsai/cugraph/pull/4479 --- .../cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py index bc36e5f0631..13828ea1cc7 100644 --- a/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py +++ b/python/cugraph/cugraph/tests/gnn/test_dgl_uniform_sampler_mg.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# 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 @@ -21,6 +21,12 @@ from cugraph.gnn.dgl_extensions.dgl_uniform_sampler import DGLUniformSampler +pytestmark = pytest.mark.skip( + reason="Skipping this file until dask worker \ + slowdown has been investigated" +) + + def assert_correct_eids(edge_df, sample_edge_id_df): # We test that all src, dst correspond to the correct # eids in the sample_edge_id_df From 261e695b48db22157b400bf7adb1c458242d0dc6 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 24 Jun 2024 10:06:21 -0700 Subject: [PATCH 06/11] Remove text builds of documentation (#4468) This PR removes text builds of the documentation, which we do not currently use for anything. Contributes to https://github.com/rapidsai/build-planning/issues/71. --------- Co-authored-by: Bradley Dice Co-authored-by: Ralph Liu <137829296+nv-rliu@users.noreply.github.com> --- ci/build_docs.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 089558bd452..8ec081163a3 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -72,10 +72,8 @@ pushd docs/cugraph # type of failure well. python -c "import cugraph; print(f'Using cugraph: {cugraph}')" sphinx-build -b dirhtml source _html -sphinx-build -b text source _text -mkdir -p "${RAPIDS_DOCS_DIR}/cugraph/"{html,txt} +mkdir -p "${RAPIDS_DOCS_DIR}/cugraph/html" mv _html/* "${RAPIDS_DOCS_DIR}/cugraph/html" -mv _text/* "${RAPIDS_DOCS_DIR}/cugraph/txt" popd rapids-upload-docs From ddd9c19f41d91be5e0cd223c5214b51803590365 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 27 Jun 2024 07:07:23 -0700 Subject: [PATCH 07/11] remove openmpi ceiling (#4496) fixes #4474 #4496 and related PRs introduced a ceiling on `openmpi`, a dependency that's only pulled in at test time, because `cugraph`'s builds were struggling to find it. This proposes removing that pin, as the fixes in https://github.com/conda-forge/openmpi-feedstock/pull/159 should allow the package to again be found by e.g. `find_package(MPI)` in CMake scripts. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Chuck Hastings (https://github.com/ChuckHastings) - Ray Douglass (https://github.com/raydouglass) URL: https://github.com/rapidsai/cugraph/pull/4496 --- conda/environments/all_cuda-118_arch-x86_64.yaml | 3 ++- conda/environments/all_cuda-122_arch-x86_64.yaml | 3 ++- dependencies.yaml | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 4a235eac7c4..40aaef5b6ed 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -42,7 +42,7 @@ dependencies: - numpy>=1.23,<2.0a0 - numpydoc - nvcc_linux-64=11.8 -- openmpi<5.0.3 +- openmpi - packaging>=21 - pandas - pre-commit @@ -70,6 +70,7 @@ dependencies: - sphinx-markdown-tables - sphinx<6 - sphinxcontrib-websupport +- thriftpy2<=0.5.0 - ucx-proc=*=gpu - ucx-py==0.39.* - wget diff --git a/conda/environments/all_cuda-122_arch-x86_64.yaml b/conda/environments/all_cuda-122_arch-x86_64.yaml index 8275634e55b..1c42ad39fb1 100644 --- a/conda/environments/all_cuda-122_arch-x86_64.yaml +++ b/conda/environments/all_cuda-122_arch-x86_64.yaml @@ -47,7 +47,7 @@ dependencies: - numba>=0.57 - numpy>=1.23,<2.0a0 - numpydoc -- openmpi<5.0.3 +- openmpi - packaging>=21 - pandas - pre-commit @@ -75,6 +75,7 @@ dependencies: - sphinx-markdown-tables - sphinx<6 - sphinxcontrib-websupport +- thriftpy2<=0.5.0 - ucx-proc=*=gpu - ucx-py==0.39.* - wget diff --git a/dependencies.yaml b/dependencies.yaml index 91593bf9168..c37d2080771 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -366,7 +366,7 @@ dependencies: - libraft-headers==24.8.* - libraft==24.8.* - librmm==24.8.* - - openmpi<5.0.3 # Required for building cpp-mgtests (multi-GPU tests) + - openmpi # Required for building cpp-mgtests (multi-GPU tests) specific: - output_types: [conda] matrices: @@ -545,6 +545,9 @@ dependencies: - output_types: [conda] packages: - pylibwholegraph==24.8.* + # this thriftpy2 entry can be removed entirely (or switched to a '!=') + # once a new release of that project resolves https://github.com/Thriftpy/thriftpy2/issues/281 + - thriftpy2<=0.5.0 test_python_pylibcugraph: common: - output_types: [conda, pyproject] From ece789dd27a4e745ff41242206248fd0b6072e31 Mon Sep 17 00:00:00 2001 From: Chuck Hastings <45364586+ChuckHastings@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:47:23 -0400 Subject: [PATCH 08/11] Tweak rmm configuration for C++ unit tests (#4503) We are seeing intermittent failures in CI from having trouble allocating the RMM pool allocator. Dropping the memory usage by default from 1/6 to 1/10. Added an option `maxpool` that will use 1/2 of the available memory, since we use the unit tests in larger configurations to do scale testing of algorithms. Authors: - Chuck Hastings (https://github.com/ChuckHastings) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - James Lamb (https://github.com/jameslamb) URL: https://github.com/rapidsai/cugraph/pull/4503 --- cpp/tests/utilities/base_fixture.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cpp/tests/utilities/base_fixture.hpp b/cpp/tests/utilities/base_fixture.hpp index cb302674a25..25011c0c97a 100644 --- a/cpp/tests/utilities/base_fixture.hpp +++ b/cpp/tests/utilities/base_fixture.hpp @@ -68,14 +68,18 @@ inline auto make_cuda() { return std::make_shared inline auto make_managed() { return std::make_shared(); } -inline auto make_pool() +// use_max set to true will use half of available GPU memory for RMM, otherwise +// otherwise we'll use 1/10. +inline auto make_pool(bool use_max = false) { - // Reduce the default pool allocation to 1/6th of the GPU memory so that we can + // Reduce the default pool allocation to 1/10 of GPU memory so that we can // run more than 2 tests in parallel at the same time. Changes to this value could // effect the maximum amount of parallel tests, and therefore `tests/CMakeLists.txt` // `_CUGRAPH_TEST_PERCENT` default value will need to be audited. auto const [free, total] = rmm::available_device_memory(); - auto const min_alloc = rmm::align_down(std::min(free, total / 6), rmm::CUDA_ALLOCATION_ALIGNMENT); + auto const min_alloc = + use_max ? rmm::align_down(std::min(free, total / 2), rmm::CUDA_ALLOCATION_ALIGNMENT) + : rmm::align_down(std::min(free, total / 10), rmm::CUDA_ALLOCATION_ALIGNMENT); return rmm::mr::make_owning_wrapper(make_cuda(), min_alloc); } @@ -99,7 +103,8 @@ inline auto make_binning() * @throw cugraph::logic_error if the `allocation_mode` is unsupported. * * @param allocation_mode String identifies which resource type. - * Accepted types are "pool", "cuda", and "managed" only. + * Accepted types are "pool", "cuda", "managed" and + * "maxpool" only. * @return Memory resource instance */ inline std::shared_ptr create_memory_resource( @@ -108,6 +113,7 @@ inline std::shared_ptr create_memory_resource( if (allocation_mode == "binning") return make_binning(); if (allocation_mode == "cuda") return make_cuda(); if (allocation_mode == "pool") return make_pool(); + if (allocation_mode == "maxpool") return make_pool(true); if (allocation_mode == "managed") return make_managed(); CUGRAPH_FAIL("Invalid RMM allocation mode"); } From fd90b984f25b58f1af81619dac50aec9a53a8613 Mon Sep 17 00:00:00 2001 From: Naim <110031745+naimnv@users.noreply.github.com> Date: Sat, 29 Jun 2024 00:08:37 +0200 Subject: [PATCH 09/11] Refactor code base to reduce memory requirement for building libcugraph (#4506) Refactor code base to reduce memory requirement for building libcugraph. - split all sg.cu and mg.cu files into three files for three combination of (vertex_t, edge_t ), i.e, (32 bit, 32bit), (32 bit, 64bit), (64 bit, 64bit) Authors: - Naim (https://github.com/naimnv) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Chuck Hastings (https://github.com/ChuckHastings) - Joseph Nke (https://github.com/jnke2016) URL: https://github.com/rapidsai/cugraph/pull/4506 --- cpp/CMakeLists.txt | 467 +++++++++++++----- .../centrality/betweenness_centrality_mg.cu | 130 ----- .../betweenness_centrality_mg_v32_e32.cu | 58 +++ .../betweenness_centrality_mg_v32_e64.cu | 58 +++ .../betweenness_centrality_mg_v64_e64.cu | 58 +++ .../centrality/betweenness_centrality_sg.cu | 130 ----- .../betweenness_centrality_sg_v32_e32.cu | 58 +++ .../betweenness_centrality_sg_v32_e64.cu | 58 +++ .../betweenness_centrality_sg_v64_e64.cu | 58 +++ .../centrality/eigenvector_centrality_mg.cu | 76 --- .../eigenvector_centrality_mg_v32_e32.cu | 40 ++ .../eigenvector_centrality_mg_v32_e64.cu | 40 ++ .../eigenvector_centrality_mg_v64_e64.cu | 40 ++ .../centrality/eigenvector_centrality_sg.cu | 76 --- .../eigenvector_centrality_sg_v32_e32.cu | 40 ++ .../eigenvector_centrality_sg_v32_e64.cu | 40 ++ .../eigenvector_centrality_sg_v64_e64.cu | 40 ++ cpp/src/centrality/katz_centrality_mg.cu | 106 ---- .../centrality/katz_centrality_mg_v32_e32.cu | 50 ++ .../centrality/katz_centrality_mg_v32_e64.cu | 50 ++ .../centrality/katz_centrality_mg_v64_e64.cu | 50 ++ cpp/src/centrality/katz_centrality_sg.cu | 106 ---- .../centrality/katz_centrality_sg_v32_e32.cu | 50 ++ .../centrality/katz_centrality_sg_v32_e64.cu | 50 ++ .../centrality/katz_centrality_sg_v64_e64.cu | 50 ++ .../community/approx_weighted_matching_mg.cu | 50 -- .../approx_weighted_matching_mg_v32_e32.cu | 30 ++ .../approx_weighted_matching_mg_v32_e64.cu | 30 ++ .../approx_weighted_matching_mg_v64_e64.cu | 30 ++ .../community/approx_weighted_matching_sg.cu | 50 -- .../approx_weighted_matching_sg_v32_e32.cu | 30 ++ .../approx_weighted_matching_sg_v32_e64.cu | 30 ++ .../approx_weighted_matching_sg_v64_e64.cu | 30 ++ cpp/src/community/detail/common_methods_mg.cu | 310 ------------ .../detail/common_methods_mg_v32_e32.cu | 118 +++++ .../detail/common_methods_mg_v32_e64.cu | 118 +++++ .../detail/common_methods_mg_v64_e64.cu | 118 +++++ cpp/src/community/detail/common_methods_sg.cu | 310 ------------ .../detail/common_methods_sg_v32_e32.cu | 118 +++++ .../detail/common_methods_sg_v32_e64.cu | 118 +++++ .../detail/common_methods_sg_v64_e64.cu | 118 +++++ ...> maximal_independent_moves_mg_v32_e32.cu} | 10 - .../maximal_independent_moves_mg_v32_e64.cu | 28 ++ .../maximal_independent_moves_mg_v64_e64.cu | 28 ++ ...> maximal_independent_moves_sg_v32_e32.cu} | 10 - .../maximal_independent_moves_sg_v32_e64.cu | 27 + .../maximal_independent_moves_sg_v64_e64.cu | 27 + cpp/src/community/detail/refine_mg.cu | 154 ------ cpp/src/community/detail/refine_mg_v32_e32.cu | 66 +++ cpp/src/community/detail/refine_mg_v32_e64.cu | 66 +++ cpp/src/community/detail/refine_mg_v64_e64.cu | 66 +++ cpp/src/community/detail/refine_sg.cu | 154 ------ cpp/src/community/detail/refine_sg_v32_e32.cu | 66 +++ cpp/src/community/detail/refine_sg_v32_e64.cu | 66 +++ cpp/src/community/detail/refine_sg_v64_e64.cu | 66 +++ cpp/src/community/ecg_mg.cu | 92 ---- cpp/src/community/ecg_mg_v32_e32.cu | 44 ++ cpp/src/community/ecg_mg_v32_e64.cu | 44 ++ cpp/src/community/ecg_mg_v64_e64.cu | 44 ++ cpp/src/community/ecg_sg.cu | 92 ---- cpp/src/community/ecg_sg_v32_e32.cu | 44 ++ cpp/src/community/ecg_sg_v32_e64.cu | 44 ++ cpp/src/community/ecg_sg_v64_e64.cu | 44 ++ ...g.cu => edge_triangle_count_mg_v32_e32.cu} | 8 - .../edge_triangle_count_mg_v32_e64.cu | 25 + .../edge_triangle_count_mg_v64_e64.cu | 25 + ...g.cu => edge_triangle_count_sg_v32_e32.cu} | 8 - .../edge_triangle_count_sg_v32_e64.cu | 25 + .../edge_triangle_count_sg_v64_e64.cu | 25 + cpp/src/community/egonet_mg.cu | 157 ------ cpp/src/community/egonet_mg_v32_e32.cu | 66 +++ cpp/src/community/egonet_mg_v32_e64.cu | 66 +++ cpp/src/community/egonet_mg_v64_e64.cu | 69 +++ cpp/src/community/egonet_sg.cu | 156 ------ cpp/src/community/egonet_sg_v32_e32.cu | 66 +++ cpp/src/community/egonet_sg_v32_e64.cu | 66 +++ cpp/src/community/egonet_sg_v64_e64.cu | 68 +++ cpp/src/community/k_truss_sg.cu | 77 --- cpp/src/community/k_truss_sg_v32_e32.cu | 41 ++ cpp/src/community/k_truss_sg_v32_e64.cu | 41 ++ cpp/src/community/k_truss_sg_v64_e64.cu | 41 ++ cpp/src/community/leiden_mg.cu | 129 ----- cpp/src/community/leiden_mg_v32_e32.cu | 58 +++ cpp/src/community/leiden_mg_v32_e64.cu | 58 +++ cpp/src/community/leiden_mg_v64_e64.cu | 59 +++ cpp/src/community/leiden_sg.cu | 129 ----- cpp/src/community/leiden_sg_v32_e32.cu | 58 +++ cpp/src/community/leiden_sg_v32_e64.cu | 58 +++ cpp/src/community/leiden_sg_v64_e64.cu | 59 +++ cpp/src/community/louvain_mg.cu | 127 ----- cpp/src/community/louvain_mg_v32_e32.cu | 57 +++ cpp/src/community/louvain_mg_v32_e64.cu | 57 +++ cpp/src/community/louvain_mg_v64_e64.cu | 59 +++ cpp/src/community/louvain_sg.cu | 127 ----- cpp/src/community/louvain_sg_v32_e32.cu | 57 +++ cpp/src/community/louvain_sg_v32_e64.cu | 57 +++ cpp/src/community/louvain_sg_v64_e64.cu | 59 +++ ...unt_mg.cu => triangle_count_mg_v32_e32.cu} | 12 - .../community/triangle_count_mg_v32_e64.cu | 27 + .../community/triangle_count_mg_v64_e64.cu | 27 + ...unt_sg.cu => triangle_count_sg_v32_e32.cu} | 12 - .../community/triangle_count_sg_v32_e64.cu | 27 + .../community/triangle_count_sg_v64_e64.cu | 27 + .../{mis_mg.cu => mis_mg_v32_e32.cu} | 10 - cpp/src/components/mis_mg_v32_e64.cu | 24 + cpp/src/components/mis_mg_v64_e64.cu | 24 + .../{mis_sg.cu => mis_sg_v32_e32.cu} | 10 - cpp/src/components/mis_sg_v32_e64.cu | 25 + cpp/src/components/mis_sg_v64_e64.cu | 25 + ...ng_mg.cu => vertex_coloring_mg_v32_e32.cu} | 10 - .../components/vertex_coloring_mg_v32_e64.cu | 25 + .../components/vertex_coloring_mg_v64_e64.cu | 25 + ...ng_sg.cu => vertex_coloring_sg_v32_e32.cu} | 10 - .../components/vertex_coloring_sg_v32_e64.cu | 25 + .../components/vertex_coloring_sg_v64_e64.cu | 25 + ...weakly_connected_components_mg_v32_e32.cu} | 12 - .../weakly_connected_components_mg_v32_e64.cu | 29 ++ .../weakly_connected_components_mg_v64_e64.cu | 29 ++ ...weakly_connected_components_sg_v32_e32.cu} | 12 - .../weakly_connected_components_sg_v32_e64.cu | 29 ++ .../weakly_connected_components_sg_v64_e64.cu | 29 ++ ...number_mg.cu => core_number_mg_v32_e32.cu} | 16 - cpp/src/cores/core_number_mg_v32_e64.cu | 31 ++ cpp/src/cores/core_number_mg_v64_e64.cu | 31 ++ ...number_sg.cu => core_number_sg_v32_e32.cu} | 16 - cpp/src/cores/core_number_sg_v32_e64.cu | 31 ++ cpp/src/cores/core_number_sg_v64_e64.cu | 31 ++ cpp/src/cores/k_core_mg.cu | 89 ---- cpp/src/cores/k_core_mg_v32_e32.cu | 45 ++ cpp/src/cores/k_core_mg_v32_e64.cu | 45 ++ cpp/src/cores/k_core_mg_v64_e64.cu | 45 ++ cpp/src/cores/k_core_sg.cu | 89 ---- cpp/src/cores/k_core_sg_v32_e32.cu | 45 ++ cpp/src/cores/k_core_sg_v32_e64.cu | 45 ++ cpp/src/cores/k_core_sg_v64_e64.cu | 45 ++ cpp/src/detail/collect_comm_wrapper.cuh | 43 ++ .../detail/collect_comm_wrapper_mg_v32_e32.cu | 40 ++ ....cu => collect_comm_wrapper_mg_v64_e64.cu} | 19 +- cpp/src/detail/collect_local_vertex_values.cu | 240 --------- .../detail/collect_local_vertex_values.cuh | 88 ++++ .../collect_local_vertex_values_mg_v32_e32.cu | 51 ++ .../collect_local_vertex_values_mg_v32_e64.cu | 51 ++ .../collect_local_vertex_values_mg_v64_e64.cu | 62 +++ .../collect_local_vertex_values_sg_v32_e32.cu | 51 ++ .../collect_local_vertex_values_sg_v32_e64.cu | 51 ++ .../collect_local_vertex_values_sg_v64_e64.cu | 62 +++ ...pby_and_count.cu => groupby_and_count.cuh} | 56 +-- .../detail/groupby_and_count_mg_v32_e32.cu | 57 +++ .../detail/groupby_and_count_mg_v32_e64.cu | 56 +++ .../detail/groupby_and_count_mg_v64_e64.cu | 57 +++ .../{permute_range.cu => permute_range.cuh} | 16 +- cpp/src/detail/permute_range_v32.cu | 48 ++ cpp/src/detail/permute_range_v64.cu | 48 ++ cpp/src/detail/utility_wrappers.cu | 250 ---------- cpp/src/detail/utility_wrappers.cuh | 144 ++++++ cpp/src/detail/utility_wrappers_32.cu | 96 ++++ cpp/src/detail/utility_wrappers_64.cu | 104 ++++ ...generator.cu => erdos_renyi_generator.cuh} | 30 +- .../erdos_renyi_generator_sg_v32_e32.cu | 49 ++ .../erdos_renyi_generator_sg_v64_e64.cu | 49 ++ ...u => generate_bipartite_rmat_edgelist.cuh} | 21 +- ...rate_bipartite_rmat_edgelist_sg_v32_e32.cu | 48 ++ ...rate_bipartite_rmat_edgelist_sg_v64_e64.cu | 48 ++ ...edgelist.cu => generate_rmat_edgelist.cuh} | 95 +--- .../generate_rmat_edgelist_sg_v32_e32.cu | 85 ++++ .../generate_rmat_edgelist_sg_v64_e64.cu | 84 ++++ ...generator_tools.cu => generator_tools.cuh} | 98 +--- .../generators/generator_tools_sg_v32_e32.cu | 90 ++++ .../generators/generator_tools_sg_v64_e64.cu | 90 ++++ ...le_generators.cu => simple_generators.cuh} | 38 +- .../simple_generators_sg_v32_e32.cu | 56 +++ .../simple_generators_sg_v64_e64.cu | 56 +++ .../{hits_mg.cu => hits_mg_v32_e32.cu} | 44 -- cpp/src/link_analysis/hits_mg_v32_e64.cu | 44 ++ cpp/src/link_analysis/hits_mg_v64_e64.cu | 44 ++ .../{hits_sg.cu => hits_sg_v32_e32.cu} | 44 -- cpp/src/link_analysis/hits_sg_v32_e64.cu | 44 ++ cpp/src/link_analysis/hits_sg_v64_e64.cu | 44 ++ cpp/src/link_analysis/pagerank_mg.cu | 183 ------- cpp/src/link_analysis/pagerank_mg_v32_e32.cu | 75 +++ cpp/src/link_analysis/pagerank_mg_v32_e64.cu | 75 +++ cpp/src/link_analysis/pagerank_mg_v64_e64.cu | 75 +++ cpp/src/link_analysis/pagerank_sg.cu | 183 ------- cpp/src/link_analysis/pagerank_sg_v32_e32.cu | 75 +++ cpp/src/link_analysis/pagerank_sg_v32_e64.cu | 75 +++ cpp/src/link_analysis/pagerank_sg_v64_e64.cu | 75 +++ cpp/src/link_prediction/cosine_mg.cu | 122 ----- cpp/src/link_prediction/cosine_mg_v32_e32.cu | 54 ++ cpp/src/link_prediction/cosine_mg_v32_e64.cu | 54 ++ cpp/src/link_prediction/cosine_mg_v64_e64.cu | 54 ++ cpp/src/link_prediction/cosine_sg.cu | 122 ----- cpp/src/link_prediction/cosine_sg_v32_e32.cu | 54 ++ cpp/src/link_prediction/cosine_sg_v32_e64.cu | 54 ++ cpp/src/link_prediction/cosine_sg_v64_e64.cu | 54 ++ cpp/src/link_prediction/jaccard_mg.cu | 122 ----- cpp/src/link_prediction/jaccard_mg_v32_e32.cu | 54 ++ cpp/src/link_prediction/jaccard_mg_v32_e64.cu | 54 ++ cpp/src/link_prediction/jaccard_mg_v64_e64.cu | 54 ++ cpp/src/link_prediction/jaccard_sg.cu | 122 ----- cpp/src/link_prediction/jaccard_sg_v32_e32.cu | 54 ++ cpp/src/link_prediction/jaccard_sg_v32_e64.cu | 54 ++ cpp/src/link_prediction/jaccard_sg_v64_e64.cu | 54 ++ cpp/src/link_prediction/overlap_mg.cu | 122 ----- cpp/src/link_prediction/overlap_mg_v32_e32.cu | 54 ++ cpp/src/link_prediction/overlap_mg_v32_e64.cu | 54 ++ cpp/src/link_prediction/overlap_mg_v64_e64.cu | 54 ++ cpp/src/link_prediction/overlap_sg.cu | 122 ----- cpp/src/link_prediction/overlap_sg_v32_e32.cu | 54 ++ cpp/src/link_prediction/overlap_sg_v32_e64.cu | 54 ++ cpp/src/link_prediction/overlap_sg_v64_e64.cu | 54 ++ cpp/src/link_prediction/sorensen_mg.cu | 122 ----- .../link_prediction/sorensen_mg_v32_e32.cu | 54 ++ .../link_prediction/sorensen_mg_v32_e64.cu | 54 ++ .../link_prediction/sorensen_mg_v64_e64.cu | 54 ++ cpp/src/link_prediction/sorensen_sg.cu | 122 ----- .../link_prediction/sorensen_sg_v32_e32.cu | 54 ++ .../link_prediction/sorensen_sg_v32_e64.cu | 54 ++ .../link_prediction/sorensen_sg_v64_e64.cu | 54 ++ ...airs_result.cu => vertex_pairs_result.cuh} | 110 +---- .../mtmg/vertex_pairs_result_mg_v32_e32.cu | 59 +++ .../mtmg/vertex_pairs_result_mg_v64_e64.cu | 59 +++ .../mtmg/vertex_pairs_result_sg_v32_e32.cu | 59 +++ .../mtmg/vertex_pairs_result_sg_v64_e64.cu | 59 +++ .../{vertex_result.cu => vertex_result.cuh} | 98 +--- cpp/src/mtmg/vertex_result_mg_v32_e32.cu | 57 +++ cpp/src/mtmg/vertex_result_mg_v64_e64.cu | 57 +++ cpp/src/mtmg/vertex_result_sg_v32_e32.cu | 57 +++ cpp/src/mtmg/vertex_result_sg_v64_e64.cu | 57 +++ .../gather_one_hop_edgelist_mg_v32_e32.cu | 55 +++ .../gather_one_hop_edgelist_mg_v32_e64.cu | 55 +++ .../gather_one_hop_edgelist_mg_v64_e64.cu | 55 +++ .../gather_one_hop_edgelist_sg_v32_e32.cu | 55 +++ .../gather_one_hop_edgelist_sg_v32_e64.cu | 55 +++ .../gather_one_hop_edgelist_sg_v64_e64.cu | 55 +++ ...cu => prepare_next_frontier_mg_v32_e32.cu} | 18 - .../prepare_next_frontier_mg_v64_e64.cu | 41 ++ ...cu => prepare_next_frontier_sg_v32_e32.cu} | 18 - .../prepare_next_frontier_sg_v64_e64.cu | 41 ++ ...remove_visited_vertices_from_frontier.cuh} | 16 - ...sited_vertices_from_frontier_sg_v32_e32.cu | 40 ++ ...sited_vertices_from_frontier_sg_v64_e64.cu | 40 ++ cpp/src/sampling/detail/sample_edges_mg.cu | 125 ----- .../detail/sample_edges_mg_v32_e32.cu | 57 +++ .../detail/sample_edges_mg_v32_e64.cu | 57 +++ .../detail/sample_edges_mg_v64_e64.cu | 57 +++ cpp/src/sampling/detail/sample_edges_sg.cu | 125 ----- .../detail/sample_edges_sg_v32_e32.cu | 57 +++ .../detail/sample_edges_sg_v32_e64.cu | 57 +++ .../detail/sample_edges_sg_v64_e64.cu | 57 +++ .../detail/shuffle_and_organize_output_mg.cu | 143 ------ .../shuffle_and_organize_output_mg_v32_e32.cu | 63 +++ .../shuffle_and_organize_output_mg_v32_e64.cu | 63 +++ .../shuffle_and_organize_output_mg_v64_e64.cu | 63 +++ cpp/src/sampling/random_walks_mg.cu | 179 ------- cpp/src/sampling/random_walks_mg_v32_e32.cu | 75 +++ cpp/src/sampling/random_walks_mg_v32_e64.cu | 75 +++ cpp/src/sampling/random_walks_mg_v64_e64.cu | 75 +++ ...random_walks.cu => random_walks_old_sg.cu} | 0 .../sampling/random_walks_old_sg_v32_e32.cu | 59 +++ .../sampling/random_walks_old_sg_v32_e64.cu | 54 ++ .../sampling/random_walks_old_sg_v64_e64.cu | 59 +++ cpp/src/sampling/random_walks_sg.cu | 179 ------- cpp/src/sampling/random_walks_sg_v32_e32.cu | 75 +++ cpp/src/sampling/random_walks_sg_v32_e64.cu | 75 +++ cpp/src/sampling/random_walks_sg_v64_e64.cu | 75 +++ ...> renumber_sampled_edgelist_sg_v32_e32.cu} | 13 - .../renumber_sampled_edgelist_sg_v64_e64.cu | 37 ++ .../sampling/sampling_post_processing_sg.cu | 443 ----------------- .../sampling_post_processing_sg_v32_e32.cu | 163 ++++++ .../sampling_post_processing_sg_v32_e64.cu | 163 ++++++ .../sampling_post_processing_sg_v64_e64.cu | 163 ++++++ .../uniform_neighbor_sampling_mg_v32_e32.cpp | 75 +++ .../uniform_neighbor_sampling_mg_v32_e64.cpp | 75 +++ .../uniform_neighbor_sampling_mg_v64_e64.cpp | 75 +++ .../uniform_neighbor_sampling_sg_v32_e32.cpp | 75 +++ .../uniform_neighbor_sampling_sg_v32_e64.cpp | 75 +++ .../uniform_neighbor_sampling_sg_v64_e64.cpp | 75 +++ cpp/src/structure/coarsen_graph_mg.cu | 154 ------ cpp/src/structure/coarsen_graph_mg_v32_e32.cu | 66 +++ cpp/src/structure/coarsen_graph_mg_v32_e64.cu | 66 +++ cpp/src/structure/coarsen_graph_mg_v64_e64.cu | 66 +++ cpp/src/structure/coarsen_graph_sg.cu | 154 ------ cpp/src/structure/coarsen_graph_sg_v32_e32.cu | 66 +++ cpp/src/structure/coarsen_graph_sg_v32_e64.cu | 66 +++ cpp/src/structure/coarsen_graph_sg_v64_e64.cu | 66 +++ .../create_graph_from_edgelist_mg.cu | 274 ---------- .../create_graph_from_edgelist_mg_v32_e32.cu | 106 ++++ .../create_graph_from_edgelist_mg_v32_e64.cu | 106 ++++ .../create_graph_from_edgelist_mg_v64_e64.cu | 106 ++++ .../create_graph_from_edgelist_sg.cu | 274 ---------- .../create_graph_from_edgelist_sg_v32_e32.cu | 106 ++++ .../create_graph_from_edgelist_sg_v32_e64.cu | 106 ++++ .../create_graph_from_edgelist_sg_v64_e64.cu | 106 ++++ .../structure/decompress_to_edgelist_mg.cu | 190 ------- .../decompress_to_edgelist_mg_v32_e32.cu | 78 +++ .../decompress_to_edgelist_mg_v32_e64.cu} | 83 +--- .../decompress_to_edgelist_mg_v64_e64.cu | 78 +++ .../structure/decompress_to_edgelist_sg.cu | 190 ------- .../decompress_to_edgelist_sg_v32_e32.cu | 78 +++ .../decompress_to_edgelist_sg_v32_e64.cu} | 83 +--- .../decompress_to_edgelist_sg_v64_e64.cu | 78 +++ .../{graph_mg.cu => graph_mg_v32_e32.cu} | 4 - cpp/src/structure/graph_mg_v32_e64.cu | 25 + cpp/src/structure/graph_mg_v64_e64.cu | 25 + .../{graph_sg.cu => graph_sg_v32_e32.cu} | 4 - cpp/src/structure/graph_sg_v32_e64.cu | 25 + cpp/src/structure/graph_sg_v64_e64.cu | 25 + cpp/src/structure/graph_view_mg_v32_e32.cu | 24 + cpp/src/structure/graph_view_mg_v32_e64.cu | 24 + ...ph_view_mg.cu => graph_view_mg_v64_e64.cu} | 4 - cpp/src/structure/graph_view_sg_v32_e32.cu | 24 + cpp/src/structure/graph_view_sg_v32_e64.cu | 24 + ...ph_view_sg.cu => graph_view_sg_v64_e64.cu} | 4 - cpp/src/structure/graph_weight_utils_mg.cu | 332 ------------- .../graph_weight_utils_mg_v32_e32.cu | 124 +++++ .../graph_weight_utils_mg_v32_e64.cu | 124 +++++ .../graph_weight_utils_mg_v64_e64.cu | 132 +++++ cpp/src/structure/graph_weight_utils_sg.cu | 335 ------------- .../graph_weight_utils_sg_v32_e32.cu | 125 +++++ .../graph_weight_utils_sg_v32_e64.cu | 125 +++++ .../graph_weight_utils_sg_v64_e64.cu | 133 +++++ cpp/src/structure/induced_subgraph_mg.cu | 94 ---- .../structure/induced_subgraph_mg_v32_e32.cu | 46 ++ .../structure/induced_subgraph_mg_v32_e64.cu | 46 ++ .../structure/induced_subgraph_mg_v64_e64.cu | 46 ++ cpp/src/structure/induced_subgraph_sg.cu | 94 ---- .../structure/induced_subgraph_sg_v32_e32.cu | 46 ++ .../structure/induced_subgraph_sg_v32_e64.cu | 46 ++ .../structure/induced_subgraph_sg_v64_e64.cu | 46 ++ .../{relabel_mg.cu => relabel_mg_v32_e32.cu} | 8 - cpp/src/structure/relabel_mg_v64_e64.cu | 31 ++ .../{relabel_sg.cu => relabel_sg_v32_e32.cu} | 9 - cpp/src/structure/relabel_sg_v64_e64.cu | 32 ++ cpp/src/structure/remove_multi_edges.cu | 98 ---- .../remove_multi_edges_sg_v32_e32.cu | 46 ++ .../remove_multi_edges_sg_v32_e64.cu | 46 ++ .../remove_multi_edges_sg_v64_e64.cu | 46 ++ cpp/src/structure/remove_self_loops.cu | 92 ---- .../structure/remove_self_loops_sg_v32_e32.cu | 44 ++ .../structure/remove_self_loops_sg_v32_e64.cu | 44 ++ .../structure/remove_self_loops_sg_v64_e64.cu | 44 ++ ..._mg.cu => renumber_edgelist_mg_v32_e32.cu} | 22 - .../structure/renumber_edgelist_mg_v32_e64.cu | 33 ++ .../structure/renumber_edgelist_mg_v64_e64.cu | 33 ++ ..._sg.cu => renumber_edgelist_sg_v32_e32.cu} | 18 - .../structure/renumber_edgelist_sg_v32_e64.cu | 31 ++ .../structure/renumber_edgelist_sg_v64_e64.cu | 31 ++ ...ils_mg.cu => renumber_utils_mg_v32_e32.cu} | 44 -- .../structure/renumber_utils_mg_v64_e64.cu | 67 +++ ...ils_sg.cu => renumber_utils_sg_v32_e32.cu} | 49 -- .../structure/renumber_utils_sg_v64_e64.cu | 72 +++ .../structure/select_random_vertices_mg.cu | 81 --- .../select_random_vertices_mg_v32_e32.cu | 41 ++ .../select_random_vertices_mg_v32_e64.cu | 41 ++ .../select_random_vertices_mg_v64_e64.cu | 41 ++ .../structure/select_random_vertices_sg.cu | 81 --- .../select_random_vertices_sg_v32_e32.cu | 41 ++ .../select_random_vertices_sg_v32_e64.cu | 41 ++ .../select_random_vertices_sg_v64_e64.cu | 41 ++ .../symmetrize_edgelist_mg_v32_e32.cu | 62 +++ .../symmetrize_edgelist_mg_v64_e64.cu | 62 +++ ...g.cu => symmetrize_edgelist_sg_v32_e32.cu} | 0 ...g.cu => symmetrize_edgelist_sg_v64_e64.cu} | 18 +- cpp/src/structure/symmetrize_graph_mg.cu | 169 ------- .../structure/symmetrize_graph_mg_v32_e32.cu | 71 +++ .../structure/symmetrize_graph_mg_v32_e64.cu | 71 +++ .../structure/symmetrize_graph_mg_v64_e64.cu | 71 +++ cpp/src/structure/symmetrize_graph_sg.cu | 175 ------- .../structure/symmetrize_graph_sg_v32_e32.cu | 73 +++ .../structure/symmetrize_graph_sg_v32_e64.cu | 73 +++ .../structure/symmetrize_graph_sg_v64_e64.cu | 73 +++ cpp/src/structure/transpose_graph_mg.cu | 157 ------ .../structure/transpose_graph_mg_v32_e32.cu | 67 +++ .../structure/transpose_graph_mg_v32_e64.cu | 67 +++ .../structure/transpose_graph_mg_v64_e64.cu | 67 +++ cpp/src/structure/transpose_graph_sg.cu | 163 ------ .../structure/transpose_graph_sg_v32_e32.cu | 69 +++ .../structure/transpose_graph_sg_v32_e64.cu | 69 +++ .../structure/transpose_graph_sg_v64_e64.cu | 69 +++ .../structure/transpose_graph_storage_mg.cu | 157 ------ .../transpose_graph_storage_mg_v32_e32.cu | 67 +++ .../transpose_graph_storage_mg_v32_e64.cu | 67 +++ .../transpose_graph_storage_mg_v64_e64.cu | 67 +++ .../structure/transpose_graph_storage_sg.cu | 163 ------ .../transpose_graph_storage_sg_v32_e32.cu | 69 +++ .../transpose_graph_storage_sg_v32_e64.cu | 69 +++ .../transpose_graph_storage_sg_v64_e64.cu | 69 +++ .../{bfs_mg.cu => bfs_mg_v32_e32.cu} | 20 - cpp/src/traversal/bfs_mg_v32_e64.cu | 33 ++ cpp/src/traversal/bfs_mg_v64_e64.cu | 33 ++ .../{bfs_sg.cu => bfs_sg_v32_e32.cu} | 20 - cpp/src/traversal/bfs_sg_v32_e64.cu | 33 ++ cpp/src/traversal/bfs_sg_v64_e64.cu | 33 ++ ..._mg.cu => extract_bfs_paths_mg_v32_e32.cu} | 16 - .../traversal/extract_bfs_paths_mg_v32_e64.cu | 31 ++ .../traversal/extract_bfs_paths_mg_v64_e64.cu | 31 ++ ..._sg.cu => extract_bfs_paths_sg_v32_e32.cu} | 16 - .../traversal/extract_bfs_paths_sg_v32_e64.cu | 31 ++ .../traversal/extract_bfs_paths_sg_v64_e64.cu | 31 ++ ...op_nbrs_mg.cu => k_hop_nbrs_mg_v32_e32.cu} | 14 - cpp/src/traversal/k_hop_nbrs_mg_v32_e64.cu | 29 ++ cpp/src/traversal/k_hop_nbrs_mg_v64_e64.cu | 29 ++ ...op_nbrs_sg.cu => k_hop_nbrs_sg_v32_e32.cu} | 14 - cpp/src/traversal/k_hop_nbrs_sg_v32_e64.cu | 29 ++ cpp/src/traversal/k_hop_nbrs_sg_v64_e64.cu | 29 ++ cpp/src/traversal/od_shortest_distances_sg.cu | 76 --- .../od_shortest_distances_sg_v32_e32.cu | 40 ++ .../od_shortest_distances_sg_v32_e64.cu | 40 ++ .../od_shortest_distances_sg_v64_e64.cu | 40 ++ cpp/src/traversal/sssp_mg.cu | 76 --- cpp/src/traversal/sssp_mg_v32_e32.cu | 40 ++ cpp/src/traversal/sssp_mg_v32_e64.cu | 40 ++ cpp/src/traversal/sssp_mg_v64_e64.cu | 40 ++ cpp/src/traversal/sssp_sg.cu | 76 --- cpp/src/traversal/sssp_sg_v32_e32.cu | 40 ++ cpp/src/traversal/sssp_sg_v32_e64.cu | 40 ++ cpp/src/traversal/sssp_sg_v64_e64.cu | 40 ++ .../{path_retrieval.cu => path_retrieval.cuh} | 31 -- .../utilities/path_retrieval_sg_v32_e32.cu | 48 ++ .../utilities/path_retrieval_sg_v64_e64.cu | 47 ++ ...rtex_pairs.cu => shuffle_vertex_pairs.cuh} | 237 +-------- .../shuffle_vertex_pairs_mg_v32_e32.cu | 115 +++++ .../shuffle_vertex_pairs_mg_v32_e64.cu | 114 +++++ .../shuffle_vertex_pairs_mg_v64_e64.cu | 115 +++++ ...uffle_vertices.cu => shuffle_vertices.cuh} | 138 +----- .../utilities/shuffle_vertices_mg_v32_fp.cu | 55 +++ .../shuffle_vertices_mg_v32_integral.cu | 73 +++ .../utilities/shuffle_vertices_mg_v64_fp.cu | 55 +++ .../shuffle_vertices_mg_v64_integral.cu | 84 ++++ 429 files changed, 18109 insertions(+), 11389 deletions(-) delete mode 100644 cpp/src/centrality/betweenness_centrality_mg.cu create mode 100644 cpp/src/centrality/betweenness_centrality_mg_v32_e32.cu create mode 100644 cpp/src/centrality/betweenness_centrality_mg_v32_e64.cu create mode 100644 cpp/src/centrality/betweenness_centrality_mg_v64_e64.cu delete mode 100644 cpp/src/centrality/betweenness_centrality_sg.cu create mode 100644 cpp/src/centrality/betweenness_centrality_sg_v32_e32.cu create mode 100644 cpp/src/centrality/betweenness_centrality_sg_v32_e64.cu create mode 100644 cpp/src/centrality/betweenness_centrality_sg_v64_e64.cu delete mode 100644 cpp/src/centrality/eigenvector_centrality_mg.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_mg_v32_e32.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_mg_v32_e64.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_mg_v64_e64.cu delete mode 100644 cpp/src/centrality/eigenvector_centrality_sg.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_sg_v32_e32.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_sg_v32_e64.cu create mode 100644 cpp/src/centrality/eigenvector_centrality_sg_v64_e64.cu delete mode 100644 cpp/src/centrality/katz_centrality_mg.cu create mode 100644 cpp/src/centrality/katz_centrality_mg_v32_e32.cu create mode 100644 cpp/src/centrality/katz_centrality_mg_v32_e64.cu create mode 100644 cpp/src/centrality/katz_centrality_mg_v64_e64.cu delete mode 100644 cpp/src/centrality/katz_centrality_sg.cu create mode 100644 cpp/src/centrality/katz_centrality_sg_v32_e32.cu create mode 100644 cpp/src/centrality/katz_centrality_sg_v32_e64.cu create mode 100644 cpp/src/centrality/katz_centrality_sg_v64_e64.cu delete mode 100644 cpp/src/community/approx_weighted_matching_mg.cu create mode 100644 cpp/src/community/approx_weighted_matching_mg_v32_e32.cu create mode 100644 cpp/src/community/approx_weighted_matching_mg_v32_e64.cu create mode 100644 cpp/src/community/approx_weighted_matching_mg_v64_e64.cu delete mode 100644 cpp/src/community/approx_weighted_matching_sg.cu create mode 100644 cpp/src/community/approx_weighted_matching_sg_v32_e32.cu create mode 100644 cpp/src/community/approx_weighted_matching_sg_v32_e64.cu create mode 100644 cpp/src/community/approx_weighted_matching_sg_v64_e64.cu delete mode 100644 cpp/src/community/detail/common_methods_mg.cu create mode 100644 cpp/src/community/detail/common_methods_mg_v32_e32.cu create mode 100644 cpp/src/community/detail/common_methods_mg_v32_e64.cu create mode 100644 cpp/src/community/detail/common_methods_mg_v64_e64.cu delete mode 100644 cpp/src/community/detail/common_methods_sg.cu create mode 100644 cpp/src/community/detail/common_methods_sg_v32_e32.cu create mode 100644 cpp/src/community/detail/common_methods_sg_v32_e64.cu create mode 100644 cpp/src/community/detail/common_methods_sg_v64_e64.cu rename cpp/src/community/detail/{maximal_independent_moves_mg.cu => maximal_independent_moves_mg_v32_e32.cu} (69%) create mode 100644 cpp/src/community/detail/maximal_independent_moves_mg_v32_e64.cu create mode 100644 cpp/src/community/detail/maximal_independent_moves_mg_v64_e64.cu rename cpp/src/community/detail/{maximal_independent_moves_sg.cu => maximal_independent_moves_sg_v32_e32.cu} (69%) create mode 100644 cpp/src/community/detail/maximal_independent_moves_sg_v32_e64.cu create mode 100644 cpp/src/community/detail/maximal_independent_moves_sg_v64_e64.cu delete mode 100644 cpp/src/community/detail/refine_mg.cu create mode 100644 cpp/src/community/detail/refine_mg_v32_e32.cu create mode 100644 cpp/src/community/detail/refine_mg_v32_e64.cu create mode 100644 cpp/src/community/detail/refine_mg_v64_e64.cu delete mode 100644 cpp/src/community/detail/refine_sg.cu create mode 100644 cpp/src/community/detail/refine_sg_v32_e32.cu create mode 100644 cpp/src/community/detail/refine_sg_v32_e64.cu create mode 100644 cpp/src/community/detail/refine_sg_v64_e64.cu delete mode 100644 cpp/src/community/ecg_mg.cu create mode 100644 cpp/src/community/ecg_mg_v32_e32.cu create mode 100644 cpp/src/community/ecg_mg_v32_e64.cu create mode 100644 cpp/src/community/ecg_mg_v64_e64.cu delete mode 100644 cpp/src/community/ecg_sg.cu create mode 100644 cpp/src/community/ecg_sg_v32_e32.cu create mode 100644 cpp/src/community/ecg_sg_v32_e64.cu create mode 100644 cpp/src/community/ecg_sg_v64_e64.cu rename cpp/src/community/{edge_triangle_count_mg.cu => edge_triangle_count_mg_v32_e32.cu} (69%) create mode 100644 cpp/src/community/edge_triangle_count_mg_v32_e64.cu create mode 100644 cpp/src/community/edge_triangle_count_mg_v64_e64.cu rename cpp/src/community/{edge_triangle_count_sg.cu => edge_triangle_count_sg_v32_e32.cu} (68%) create mode 100644 cpp/src/community/edge_triangle_count_sg_v32_e64.cu create mode 100644 cpp/src/community/edge_triangle_count_sg_v64_e64.cu delete mode 100644 cpp/src/community/egonet_mg.cu create mode 100644 cpp/src/community/egonet_mg_v32_e32.cu create mode 100644 cpp/src/community/egonet_mg_v32_e64.cu create mode 100644 cpp/src/community/egonet_mg_v64_e64.cu delete mode 100644 cpp/src/community/egonet_sg.cu create mode 100644 cpp/src/community/egonet_sg_v32_e32.cu create mode 100644 cpp/src/community/egonet_sg_v32_e64.cu create mode 100644 cpp/src/community/egonet_sg_v64_e64.cu delete mode 100644 cpp/src/community/k_truss_sg.cu create mode 100644 cpp/src/community/k_truss_sg_v32_e32.cu create mode 100644 cpp/src/community/k_truss_sg_v32_e64.cu create mode 100644 cpp/src/community/k_truss_sg_v64_e64.cu delete mode 100644 cpp/src/community/leiden_mg.cu create mode 100644 cpp/src/community/leiden_mg_v32_e32.cu create mode 100644 cpp/src/community/leiden_mg_v32_e64.cu create mode 100644 cpp/src/community/leiden_mg_v64_e64.cu delete mode 100644 cpp/src/community/leiden_sg.cu create mode 100644 cpp/src/community/leiden_sg_v32_e32.cu create mode 100644 cpp/src/community/leiden_sg_v32_e64.cu create mode 100644 cpp/src/community/leiden_sg_v64_e64.cu delete mode 100644 cpp/src/community/louvain_mg.cu create mode 100644 cpp/src/community/louvain_mg_v32_e32.cu create mode 100644 cpp/src/community/louvain_mg_v32_e64.cu create mode 100644 cpp/src/community/louvain_mg_v64_e64.cu delete mode 100644 cpp/src/community/louvain_sg.cu create mode 100644 cpp/src/community/louvain_sg_v32_e32.cu create mode 100644 cpp/src/community/louvain_sg_v32_e64.cu create mode 100644 cpp/src/community/louvain_sg_v64_e64.cu rename cpp/src/community/{triangle_count_mg.cu => triangle_count_mg_v32_e32.cu} (59%) create mode 100644 cpp/src/community/triangle_count_mg_v32_e64.cu create mode 100644 cpp/src/community/triangle_count_mg_v64_e64.cu rename cpp/src/community/{triangle_count_sg.cu => triangle_count_sg_v32_e32.cu} (59%) create mode 100644 cpp/src/community/triangle_count_sg_v32_e64.cu create mode 100644 cpp/src/community/triangle_count_sg_v64_e64.cu rename cpp/src/components/{mis_mg.cu => mis_mg_v32_e32.cu} (68%) create mode 100644 cpp/src/components/mis_mg_v32_e64.cu create mode 100644 cpp/src/components/mis_mg_v64_e64.cu rename cpp/src/components/{mis_sg.cu => mis_sg_v32_e32.cu} (68%) create mode 100644 cpp/src/components/mis_sg_v32_e64.cu create mode 100644 cpp/src/components/mis_sg_v64_e64.cu rename cpp/src/components/{vertex_coloring_mg.cu => vertex_coloring_mg_v32_e32.cu} (69%) create mode 100644 cpp/src/components/vertex_coloring_mg_v32_e64.cu create mode 100644 cpp/src/components/vertex_coloring_mg_v64_e64.cu rename cpp/src/components/{vertex_coloring_sg.cu => vertex_coloring_sg_v32_e32.cu} (69%) create mode 100644 cpp/src/components/vertex_coloring_sg_v32_e64.cu create mode 100644 cpp/src/components/vertex_coloring_sg_v64_e64.cu rename cpp/src/components/{weakly_connected_components_mg.cu => weakly_connected_components_mg_v32_e32.cu} (70%) create mode 100644 cpp/src/components/weakly_connected_components_mg_v32_e64.cu create mode 100644 cpp/src/components/weakly_connected_components_mg_v64_e64.cu rename cpp/src/components/{weakly_connected_components_sg.cu => weakly_connected_components_sg_v32_e32.cu} (70%) create mode 100644 cpp/src/components/weakly_connected_components_sg_v32_e64.cu create mode 100644 cpp/src/components/weakly_connected_components_sg_v64_e64.cu rename cpp/src/cores/{core_number_mg.cu => core_number_mg_v32_e32.cu} (58%) create mode 100644 cpp/src/cores/core_number_mg_v32_e64.cu create mode 100644 cpp/src/cores/core_number_mg_v64_e64.cu rename cpp/src/cores/{core_number_sg.cu => core_number_sg_v32_e32.cu} (58%) create mode 100644 cpp/src/cores/core_number_sg_v32_e64.cu create mode 100644 cpp/src/cores/core_number_sg_v64_e64.cu delete mode 100644 cpp/src/cores/k_core_mg.cu create mode 100644 cpp/src/cores/k_core_mg_v32_e32.cu create mode 100644 cpp/src/cores/k_core_mg_v32_e64.cu create mode 100644 cpp/src/cores/k_core_mg_v64_e64.cu delete mode 100644 cpp/src/cores/k_core_sg.cu create mode 100644 cpp/src/cores/k_core_sg_v32_e32.cu create mode 100644 cpp/src/cores/k_core_sg_v32_e64.cu create mode 100644 cpp/src/cores/k_core_sg_v64_e64.cu create mode 100644 cpp/src/detail/collect_comm_wrapper.cuh create mode 100644 cpp/src/detail/collect_comm_wrapper_mg_v32_e32.cu rename cpp/src/detail/{collect_comm_wrapper.cu => collect_comm_wrapper_mg_v64_e64.cu} (63%) delete mode 100644 cpp/src/detail/collect_local_vertex_values.cu create mode 100644 cpp/src/detail/collect_local_vertex_values.cuh create mode 100644 cpp/src/detail/collect_local_vertex_values_mg_v32_e32.cu create mode 100644 cpp/src/detail/collect_local_vertex_values_mg_v32_e64.cu create mode 100644 cpp/src/detail/collect_local_vertex_values_mg_v64_e64.cu create mode 100644 cpp/src/detail/collect_local_vertex_values_sg_v32_e32.cu create mode 100644 cpp/src/detail/collect_local_vertex_values_sg_v32_e64.cu create mode 100644 cpp/src/detail/collect_local_vertex_values_sg_v64_e64.cu rename cpp/src/detail/{groupby_and_count.cu => groupby_and_count.cuh} (81%) create mode 100644 cpp/src/detail/groupby_and_count_mg_v32_e32.cu create mode 100644 cpp/src/detail/groupby_and_count_mg_v32_e64.cu create mode 100644 cpp/src/detail/groupby_and_count_mg_v64_e64.cu rename cpp/src/detail/{permute_range.cu => permute_range.cuh} (88%) create mode 100644 cpp/src/detail/permute_range_v32.cu create mode 100644 cpp/src/detail/permute_range_v64.cu delete mode 100644 cpp/src/detail/utility_wrappers.cu create mode 100644 cpp/src/detail/utility_wrappers.cuh create mode 100644 cpp/src/detail/utility_wrappers_32.cu create mode 100644 cpp/src/detail/utility_wrappers_64.cu rename cpp/src/generators/{erdos_renyi_generator.cu => erdos_renyi_generator.cuh} (71%) create mode 100644 cpp/src/generators/erdos_renyi_generator_sg_v32_e32.cu create mode 100644 cpp/src/generators/erdos_renyi_generator_sg_v64_e64.cu rename cpp/src/generators/{generate_bipartite_rmat_edgelist.cu => generate_bipartite_rmat_edgelist.cuh} (81%) create mode 100644 cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v32_e32.cu create mode 100644 cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v64_e64.cu rename cpp/src/generators/{generate_rmat_edgelist.cu => generate_rmat_edgelist.cuh} (65%) create mode 100644 cpp/src/generators/generate_rmat_edgelist_sg_v32_e32.cu create mode 100644 cpp/src/generators/generate_rmat_edgelist_sg_v64_e64.cu rename cpp/src/generators/{generator_tools.cu => generator_tools.cuh} (68%) create mode 100644 cpp/src/generators/generator_tools_sg_v32_e32.cu create mode 100644 cpp/src/generators/generator_tools_sg_v64_e64.cu rename cpp/src/generators/{simple_generators.cu => simple_generators.cuh} (87%) create mode 100644 cpp/src/generators/simple_generators_sg_v32_e32.cu create mode 100644 cpp/src/generators/simple_generators_sg_v64_e64.cu rename cpp/src/link_analysis/{hits_mg.cu => hits_mg_v32_e32.cu} (52%) create mode 100644 cpp/src/link_analysis/hits_mg_v32_e64.cu create mode 100644 cpp/src/link_analysis/hits_mg_v64_e64.cu rename cpp/src/link_analysis/{hits_sg.cu => hits_sg_v32_e32.cu} (51%) create mode 100644 cpp/src/link_analysis/hits_sg_v32_e64.cu create mode 100644 cpp/src/link_analysis/hits_sg_v64_e64.cu delete mode 100644 cpp/src/link_analysis/pagerank_mg.cu create mode 100644 cpp/src/link_analysis/pagerank_mg_v32_e32.cu create mode 100644 cpp/src/link_analysis/pagerank_mg_v32_e64.cu create mode 100644 cpp/src/link_analysis/pagerank_mg_v64_e64.cu delete mode 100644 cpp/src/link_analysis/pagerank_sg.cu create mode 100644 cpp/src/link_analysis/pagerank_sg_v32_e32.cu create mode 100644 cpp/src/link_analysis/pagerank_sg_v32_e64.cu create mode 100644 cpp/src/link_analysis/pagerank_sg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/cosine_mg.cu create mode 100644 cpp/src/link_prediction/cosine_mg_v32_e32.cu create mode 100644 cpp/src/link_prediction/cosine_mg_v32_e64.cu create mode 100644 cpp/src/link_prediction/cosine_mg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/cosine_sg.cu create mode 100644 cpp/src/link_prediction/cosine_sg_v32_e32.cu create mode 100644 cpp/src/link_prediction/cosine_sg_v32_e64.cu create mode 100644 cpp/src/link_prediction/cosine_sg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/jaccard_mg.cu create mode 100644 cpp/src/link_prediction/jaccard_mg_v32_e32.cu create mode 100644 cpp/src/link_prediction/jaccard_mg_v32_e64.cu create mode 100644 cpp/src/link_prediction/jaccard_mg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/jaccard_sg.cu create mode 100644 cpp/src/link_prediction/jaccard_sg_v32_e32.cu create mode 100644 cpp/src/link_prediction/jaccard_sg_v32_e64.cu create mode 100644 cpp/src/link_prediction/jaccard_sg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/overlap_mg.cu create mode 100644 cpp/src/link_prediction/overlap_mg_v32_e32.cu create mode 100644 cpp/src/link_prediction/overlap_mg_v32_e64.cu create mode 100644 cpp/src/link_prediction/overlap_mg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/overlap_sg.cu create mode 100644 cpp/src/link_prediction/overlap_sg_v32_e32.cu create mode 100644 cpp/src/link_prediction/overlap_sg_v32_e64.cu create mode 100644 cpp/src/link_prediction/overlap_sg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/sorensen_mg.cu create mode 100644 cpp/src/link_prediction/sorensen_mg_v32_e32.cu create mode 100644 cpp/src/link_prediction/sorensen_mg_v32_e64.cu create mode 100644 cpp/src/link_prediction/sorensen_mg_v64_e64.cu delete mode 100644 cpp/src/link_prediction/sorensen_sg.cu create mode 100644 cpp/src/link_prediction/sorensen_sg_v32_e32.cu create mode 100644 cpp/src/link_prediction/sorensen_sg_v32_e64.cu create mode 100644 cpp/src/link_prediction/sorensen_sg_v64_e64.cu rename cpp/src/mtmg/{vertex_pairs_result.cu => vertex_pairs_result.cuh} (57%) create mode 100644 cpp/src/mtmg/vertex_pairs_result_mg_v32_e32.cu create mode 100644 cpp/src/mtmg/vertex_pairs_result_mg_v64_e64.cu create mode 100644 cpp/src/mtmg/vertex_pairs_result_sg_v32_e32.cu create mode 100644 cpp/src/mtmg/vertex_pairs_result_sg_v64_e64.cu rename cpp/src/mtmg/{vertex_result.cu => vertex_result.cuh} (55%) create mode 100644 cpp/src/mtmg/vertex_result_mg_v32_e32.cu create mode 100644 cpp/src/mtmg/vertex_result_mg_v64_e64.cu create mode 100644 cpp/src/mtmg/vertex_result_sg_v32_e32.cu create mode 100644 cpp/src/mtmg/vertex_result_sg_v64_e64.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu create mode 100644 cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu rename cpp/src/sampling/detail/{prepare_next_frontier_mg.cu => prepare_next_frontier_mg_v32_e32.cu} (63%) create mode 100644 cpp/src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu rename cpp/src/sampling/detail/{prepare_next_frontier_sg.cu => prepare_next_frontier_sg_v32_e32.cu} (63%) create mode 100644 cpp/src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu rename cpp/src/sampling/detail/{remove_visited_vertices_from_frontier.cu => remove_visited_vertices_from_frontier.cuh} (77%) create mode 100644 cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu delete mode 100644 cpp/src/sampling/detail/sample_edges_mg.cu create mode 100644 cpp/src/sampling/detail/sample_edges_mg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/sample_edges_mg_v32_e64.cu create mode 100644 cpp/src/sampling/detail/sample_edges_mg_v64_e64.cu delete mode 100644 cpp/src/sampling/detail/sample_edges_sg.cu create mode 100644 cpp/src/sampling/detail/sample_edges_sg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/sample_edges_sg_v32_e64.cu create mode 100644 cpp/src/sampling/detail/sample_edges_sg_v64_e64.cu delete mode 100644 cpp/src/sampling/detail/shuffle_and_organize_output_mg.cu create mode 100644 cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu create mode 100644 cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu create mode 100644 cpp/src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu delete mode 100644 cpp/src/sampling/random_walks_mg.cu create mode 100644 cpp/src/sampling/random_walks_mg_v32_e32.cu create mode 100644 cpp/src/sampling/random_walks_mg_v32_e64.cu create mode 100644 cpp/src/sampling/random_walks_mg_v64_e64.cu rename cpp/src/sampling/{random_walks.cu => random_walks_old_sg.cu} (100%) create mode 100644 cpp/src/sampling/random_walks_old_sg_v32_e32.cu create mode 100644 cpp/src/sampling/random_walks_old_sg_v32_e64.cu create mode 100644 cpp/src/sampling/random_walks_old_sg_v64_e64.cu delete mode 100644 cpp/src/sampling/random_walks_sg.cu create mode 100644 cpp/src/sampling/random_walks_sg_v32_e32.cu create mode 100644 cpp/src/sampling/random_walks_sg_v32_e64.cu create mode 100644 cpp/src/sampling/random_walks_sg_v64_e64.cu rename cpp/src/sampling/{renumber_sampled_edgelist_sg.cu => renumber_sampled_edgelist_sg_v32_e32.cu} (70%) create mode 100644 cpp/src/sampling/renumber_sampled_edgelist_sg_v64_e64.cu delete mode 100644 cpp/src/sampling/sampling_post_processing_sg.cu create mode 100644 cpp/src/sampling/sampling_post_processing_sg_v32_e32.cu create mode 100644 cpp/src/sampling/sampling_post_processing_sg_v32_e64.cu create mode 100644 cpp/src/sampling/sampling_post_processing_sg_v64_e64.cu create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e32.cpp create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e64.cpp create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_mg_v64_e64.cpp create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e32.cpp create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e64.cpp create mode 100644 cpp/src/sampling/uniform_neighbor_sampling_sg_v64_e64.cpp delete mode 100644 cpp/src/structure/coarsen_graph_mg.cu create mode 100644 cpp/src/structure/coarsen_graph_mg_v32_e32.cu create mode 100644 cpp/src/structure/coarsen_graph_mg_v32_e64.cu create mode 100644 cpp/src/structure/coarsen_graph_mg_v64_e64.cu delete mode 100644 cpp/src/structure/coarsen_graph_sg.cu create mode 100644 cpp/src/structure/coarsen_graph_sg_v32_e32.cu create mode 100644 cpp/src/structure/coarsen_graph_sg_v32_e64.cu create mode 100644 cpp/src/structure/coarsen_graph_sg_v64_e64.cu delete mode 100644 cpp/src/structure/create_graph_from_edgelist_mg.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_mg_v32_e32.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_mg_v32_e64.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_mg_v64_e64.cu delete mode 100644 cpp/src/structure/create_graph_from_edgelist_sg.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_sg_v32_e32.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_sg_v32_e64.cu create mode 100644 cpp/src/structure/create_graph_from_edgelist_sg_v64_e64.cu delete mode 100644 cpp/src/structure/decompress_to_edgelist_mg.cu create mode 100644 cpp/src/structure/decompress_to_edgelist_mg_v32_e32.cu rename cpp/src/{sampling/detail/gather_one_hop_edgelist_mg.cu => structure/decompress_to_edgelist_mg_v32_e64.cu} (50%) create mode 100644 cpp/src/structure/decompress_to_edgelist_mg_v64_e64.cu delete mode 100644 cpp/src/structure/decompress_to_edgelist_sg.cu create mode 100644 cpp/src/structure/decompress_to_edgelist_sg_v32_e32.cu rename cpp/src/{sampling/detail/gather_one_hop_edgelist_sg.cu => structure/decompress_to_edgelist_sg_v32_e64.cu} (50%) create mode 100644 cpp/src/structure/decompress_to_edgelist_sg_v64_e64.cu rename cpp/src/structure/{graph_mg.cu => graph_mg_v32_e32.cu} (79%) create mode 100644 cpp/src/structure/graph_mg_v32_e64.cu create mode 100644 cpp/src/structure/graph_mg_v64_e64.cu rename cpp/src/structure/{graph_sg.cu => graph_sg_v32_e32.cu} (78%) create mode 100644 cpp/src/structure/graph_sg_v32_e64.cu create mode 100644 cpp/src/structure/graph_sg_v64_e64.cu create mode 100644 cpp/src/structure/graph_view_mg_v32_e32.cu create mode 100644 cpp/src/structure/graph_view_mg_v32_e64.cu rename cpp/src/structure/{graph_view_mg.cu => graph_view_mg_v64_e64.cu} (77%) create mode 100644 cpp/src/structure/graph_view_sg_v32_e32.cu create mode 100644 cpp/src/structure/graph_view_sg_v32_e64.cu rename cpp/src/structure/{graph_view_sg.cu => graph_view_sg_v64_e64.cu} (77%) delete mode 100644 cpp/src/structure/graph_weight_utils_mg.cu create mode 100644 cpp/src/structure/graph_weight_utils_mg_v32_e32.cu create mode 100644 cpp/src/structure/graph_weight_utils_mg_v32_e64.cu create mode 100644 cpp/src/structure/graph_weight_utils_mg_v64_e64.cu delete mode 100644 cpp/src/structure/graph_weight_utils_sg.cu create mode 100644 cpp/src/structure/graph_weight_utils_sg_v32_e32.cu create mode 100644 cpp/src/structure/graph_weight_utils_sg_v32_e64.cu create mode 100644 cpp/src/structure/graph_weight_utils_sg_v64_e64.cu delete mode 100644 cpp/src/structure/induced_subgraph_mg.cu create mode 100644 cpp/src/structure/induced_subgraph_mg_v32_e32.cu create mode 100644 cpp/src/structure/induced_subgraph_mg_v32_e64.cu create mode 100644 cpp/src/structure/induced_subgraph_mg_v64_e64.cu delete mode 100644 cpp/src/structure/induced_subgraph_sg.cu create mode 100644 cpp/src/structure/induced_subgraph_sg_v32_e32.cu create mode 100644 cpp/src/structure/induced_subgraph_sg_v32_e64.cu create mode 100644 cpp/src/structure/induced_subgraph_sg_v64_e64.cu rename cpp/src/structure/{relabel_mg.cu => relabel_mg_v32_e32.cu} (71%) create mode 100644 cpp/src/structure/relabel_mg_v64_e64.cu rename cpp/src/structure/{relabel_sg.cu => relabel_sg_v32_e32.cu} (78%) create mode 100644 cpp/src/structure/relabel_sg_v64_e64.cu delete mode 100644 cpp/src/structure/remove_multi_edges.cu create mode 100644 cpp/src/structure/remove_multi_edges_sg_v32_e32.cu create mode 100644 cpp/src/structure/remove_multi_edges_sg_v32_e64.cu create mode 100644 cpp/src/structure/remove_multi_edges_sg_v64_e64.cu delete mode 100644 cpp/src/structure/remove_self_loops.cu create mode 100644 cpp/src/structure/remove_self_loops_sg_v32_e32.cu create mode 100644 cpp/src/structure/remove_self_loops_sg_v32_e64.cu create mode 100644 cpp/src/structure/remove_self_loops_sg_v64_e64.cu rename cpp/src/structure/{renumber_edgelist_mg.cu => renumber_edgelist_mg_v32_e32.cu} (53%) create mode 100644 cpp/src/structure/renumber_edgelist_mg_v32_e64.cu create mode 100644 cpp/src/structure/renumber_edgelist_mg_v64_e64.cu rename cpp/src/structure/{renumber_edgelist_sg.cu => renumber_edgelist_sg_v32_e32.cu} (51%) create mode 100644 cpp/src/structure/renumber_edgelist_sg_v32_e64.cu create mode 100644 cpp/src/structure/renumber_edgelist_sg_v64_e64.cu rename cpp/src/structure/{renumber_utils_mg.cu => renumber_utils_mg_v32_e32.cu} (56%) create mode 100644 cpp/src/structure/renumber_utils_mg_v64_e64.cu rename cpp/src/structure/{renumber_utils_sg.cu => renumber_utils_sg_v32_e32.cu} (55%) create mode 100644 cpp/src/structure/renumber_utils_sg_v64_e64.cu delete mode 100644 cpp/src/structure/select_random_vertices_mg.cu create mode 100644 cpp/src/structure/select_random_vertices_mg_v32_e32.cu create mode 100644 cpp/src/structure/select_random_vertices_mg_v32_e64.cu create mode 100644 cpp/src/structure/select_random_vertices_mg_v64_e64.cu delete mode 100644 cpp/src/structure/select_random_vertices_sg.cu create mode 100644 cpp/src/structure/select_random_vertices_sg_v32_e32.cu create mode 100644 cpp/src/structure/select_random_vertices_sg_v32_e64.cu create mode 100644 cpp/src/structure/select_random_vertices_sg_v64_e64.cu create mode 100644 cpp/src/structure/symmetrize_edgelist_mg_v32_e32.cu create mode 100644 cpp/src/structure/symmetrize_edgelist_mg_v64_e64.cu rename cpp/src/structure/{symmetrize_edgelist_sg.cu => symmetrize_edgelist_sg_v32_e32.cu} (100%) rename cpp/src/structure/{symmetrize_edgelist_mg.cu => symmetrize_edgelist_sg_v64_e64.cu} (89%) delete mode 100644 cpp/src/structure/symmetrize_graph_mg.cu create mode 100644 cpp/src/structure/symmetrize_graph_mg_v32_e32.cu create mode 100644 cpp/src/structure/symmetrize_graph_mg_v32_e64.cu create mode 100644 cpp/src/structure/symmetrize_graph_mg_v64_e64.cu delete mode 100644 cpp/src/structure/symmetrize_graph_sg.cu create mode 100644 cpp/src/structure/symmetrize_graph_sg_v32_e32.cu create mode 100644 cpp/src/structure/symmetrize_graph_sg_v32_e64.cu create mode 100644 cpp/src/structure/symmetrize_graph_sg_v64_e64.cu delete mode 100644 cpp/src/structure/transpose_graph_mg.cu create mode 100644 cpp/src/structure/transpose_graph_mg_v32_e32.cu create mode 100644 cpp/src/structure/transpose_graph_mg_v32_e64.cu create mode 100644 cpp/src/structure/transpose_graph_mg_v64_e64.cu delete mode 100644 cpp/src/structure/transpose_graph_sg.cu create mode 100644 cpp/src/structure/transpose_graph_sg_v32_e32.cu create mode 100644 cpp/src/structure/transpose_graph_sg_v32_e64.cu create mode 100644 cpp/src/structure/transpose_graph_sg_v64_e64.cu delete mode 100644 cpp/src/structure/transpose_graph_storage_mg.cu create mode 100644 cpp/src/structure/transpose_graph_storage_mg_v32_e32.cu create mode 100644 cpp/src/structure/transpose_graph_storage_mg_v32_e64.cu create mode 100644 cpp/src/structure/transpose_graph_storage_mg_v64_e64.cu delete mode 100644 cpp/src/structure/transpose_graph_storage_sg.cu create mode 100644 cpp/src/structure/transpose_graph_storage_sg_v32_e32.cu create mode 100644 cpp/src/structure/transpose_graph_storage_sg_v32_e64.cu create mode 100644 cpp/src/structure/transpose_graph_storage_sg_v64_e64.cu rename cpp/src/traversal/{bfs_mg.cu => bfs_mg_v32_e32.cu} (57%) create mode 100644 cpp/src/traversal/bfs_mg_v32_e64.cu create mode 100644 cpp/src/traversal/bfs_mg_v64_e64.cu rename cpp/src/traversal/{bfs_sg.cu => bfs_sg_v32_e32.cu} (57%) create mode 100644 cpp/src/traversal/bfs_sg_v32_e64.cu create mode 100644 cpp/src/traversal/bfs_sg_v64_e64.cu rename cpp/src/traversal/{extract_bfs_paths_mg.cu => extract_bfs_paths_mg_v32_e32.cu} (63%) create mode 100644 cpp/src/traversal/extract_bfs_paths_mg_v32_e64.cu create mode 100644 cpp/src/traversal/extract_bfs_paths_mg_v64_e64.cu rename cpp/src/traversal/{extract_bfs_paths_sg.cu => extract_bfs_paths_sg_v32_e32.cu} (63%) create mode 100644 cpp/src/traversal/extract_bfs_paths_sg_v32_e64.cu create mode 100644 cpp/src/traversal/extract_bfs_paths_sg_v64_e64.cu rename cpp/src/traversal/{k_hop_nbrs_mg.cu => k_hop_nbrs_mg_v32_e32.cu} (64%) create mode 100644 cpp/src/traversal/k_hop_nbrs_mg_v32_e64.cu create mode 100644 cpp/src/traversal/k_hop_nbrs_mg_v64_e64.cu rename cpp/src/traversal/{k_hop_nbrs_sg.cu => k_hop_nbrs_sg_v32_e32.cu} (64%) create mode 100644 cpp/src/traversal/k_hop_nbrs_sg_v32_e64.cu create mode 100644 cpp/src/traversal/k_hop_nbrs_sg_v64_e64.cu delete mode 100644 cpp/src/traversal/od_shortest_distances_sg.cu create mode 100644 cpp/src/traversal/od_shortest_distances_sg_v32_e32.cu create mode 100644 cpp/src/traversal/od_shortest_distances_sg_v32_e64.cu create mode 100644 cpp/src/traversal/od_shortest_distances_sg_v64_e64.cu delete mode 100644 cpp/src/traversal/sssp_mg.cu create mode 100644 cpp/src/traversal/sssp_mg_v32_e32.cu create mode 100644 cpp/src/traversal/sssp_mg_v32_e64.cu create mode 100644 cpp/src/traversal/sssp_mg_v64_e64.cu delete mode 100644 cpp/src/traversal/sssp_sg.cu create mode 100644 cpp/src/traversal/sssp_sg_v32_e32.cu create mode 100644 cpp/src/traversal/sssp_sg_v32_e64.cu create mode 100644 cpp/src/traversal/sssp_sg_v64_e64.cu rename cpp/src/utilities/{path_retrieval.cu => path_retrieval.cuh} (66%) create mode 100644 cpp/src/utilities/path_retrieval_sg_v32_e32.cu create mode 100644 cpp/src/utilities/path_retrieval_sg_v64_e64.cu rename cpp/src/utilities/{shuffle_vertex_pairs.cu => shuffle_vertex_pairs.cuh} (57%) create mode 100644 cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu create mode 100644 cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu create mode 100644 cpp/src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu rename cpp/src/utilities/{shuffle_vertices.cu => shuffle_vertices.cuh} (53%) create mode 100644 cpp/src/utilities/shuffle_vertices_mg_v32_fp.cu create mode 100644 cpp/src/utilities/shuffle_vertices_mg_v32_integral.cu create mode 100644 cpp/src/utilities/shuffle_vertices_mg_v64_fp.cu create mode 100644 cpp/src/utilities/shuffle_vertices_mg_v64_integral.cu diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 93f43b9ec56..8d57c089d8f 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -168,135 +168,362 @@ endif() # which should give us a better parallel schedule. set(CUGRAPH_SOURCES - src/utilities/shuffle_vertices.cu - src/detail/permute_range.cu - src/utilities/shuffle_vertex_pairs.cu - src/detail/collect_local_vertex_values.cu - src/detail/groupby_and_count.cu - src/detail/collect_comm_wrapper.cu - src/sampling/random_walks_mg.cu - src/community/detail/common_methods_mg.cu - src/community/detail/common_methods_sg.cu - src/community/detail/refine_sg.cu - src/community/detail/refine_mg.cu - src/community/edge_triangle_count_sg.cu - src/community/edge_triangle_count_mg.cu - src/community/detail/maximal_independent_moves_sg.cu - src/community/detail/maximal_independent_moves_mg.cu - src/detail/utility_wrappers.cu - src/structure/graph_view_mg.cu - src/structure/remove_self_loops.cu - src/structure/remove_multi_edges.cu - src/utilities/path_retrieval.cu + src/utilities/shuffle_vertices_mg_v32_fp.cu + src/utilities/shuffle_vertices_mg_v32_integral.cu + src/utilities/shuffle_vertices_mg_v64_fp.cu + src/utilities/shuffle_vertices_mg_v64_integral.cu + src/detail/permute_range_v32.cu + src/detail/permute_range_v64.cu + src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu + src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu + src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu + src/detail/collect_local_vertex_values_sg_v32_e32.cu + src/detail/collect_local_vertex_values_sg_v32_e64.cu + src/detail/collect_local_vertex_values_sg_v64_e64.cu + src/detail/collect_local_vertex_values_mg_v32_e32.cu + src/detail/collect_local_vertex_values_mg_v32_e64.cu + src/detail/collect_local_vertex_values_mg_v64_e64.cu + src/detail/groupby_and_count_mg_v32_e32.cu + src/detail/groupby_and_count_mg_v32_e64.cu + src/detail/groupby_and_count_mg_v64_e64.cu + src/detail/collect_comm_wrapper_mg_v32_e32.cu + src/detail/collect_comm_wrapper_mg_v64_e64.cu + src/sampling/random_walks_mg_v64_e64.cu + src/sampling/random_walks_mg_v32_e32.cu + src/sampling/random_walks_mg_v32_e64.cu + src/community/detail/common_methods_mg_v64_e64.cu + src/community/detail/common_methods_mg_v32_e32.cu + src/community/detail/common_methods_mg_v32_e64.cu + src/community/detail/common_methods_sg_v64_e64.cu + src/community/detail/common_methods_sg_v32_e32.cu + src/community/detail/common_methods_sg_v32_e64.cu + src/community/detail/refine_sg_v64_e64.cu + src/community/detail/refine_sg_v32_e32.cu + src/community/detail/refine_sg_v32_e64.cu + src/community/detail/refine_mg_v64_e64.cu + src/community/detail/refine_mg_v32_e32.cu + src/community/detail/refine_mg_v32_e64.cu + src/community/edge_triangle_count_sg_v64_e64.cu + src/community/edge_triangle_count_sg_v32_e32.cu + src/community/edge_triangle_count_sg_v32_e64.cu + src/community/edge_triangle_count_mg_v64_e64.cu + src/community/edge_triangle_count_mg_v32_e32.cu + src/community/edge_triangle_count_mg_v32_e64.cu + src/community/detail/maximal_independent_moves_sg_v64_e64.cu + src/community/detail/maximal_independent_moves_sg_v32_e32.cu + src/community/detail/maximal_independent_moves_sg_v32_e64.cu + src/community/detail/maximal_independent_moves_mg_v64_e64.cu + src/community/detail/maximal_independent_moves_mg_v32_e32.cu + src/community/detail/maximal_independent_moves_mg_v32_e64.cu + src/detail/utility_wrappers_32.cu + src/detail/utility_wrappers_64.cu + src/structure/graph_view_mg_v64_e64.cu + src/structure/graph_view_mg_v32_e32.cu + src/structure/graph_view_mg_v32_e64.cu + src/structure/remove_self_loops_sg_v32_e32.cu + src/structure/remove_self_loops_sg_v32_e64.cu + src/structure/remove_self_loops_sg_v64_e64.cu + src/structure/remove_multi_edges_sg_v32_e32.cu + src/structure/remove_multi_edges_sg_v32_e64.cu + src/structure/remove_multi_edges_sg_v64_e64.cu + src/utilities/path_retrieval_sg_v32_e32.cu + src/utilities/path_retrieval_sg_v64_e64.cu src/structure/legacy/graph.cu src/linear_assignment/legacy/hungarian.cu - src/link_prediction/jaccard_sg.cu - src/link_prediction/sorensen_sg.cu - src/link_prediction/overlap_sg.cu - src/link_prediction/cosine_sg.cu - src/link_prediction/jaccard_mg.cu - src/link_prediction/sorensen_mg.cu - src/link_prediction/overlap_mg.cu - src/link_prediction/cosine_mg.cu + src/link_prediction/jaccard_sg_v64_e64.cu + src/link_prediction/jaccard_sg_v32_e32.cu + src/link_prediction/jaccard_sg_v32_e64.cu + src/link_prediction/sorensen_sg_v64_e64.cu + src/link_prediction/sorensen_sg_v32_e32.cu + src/link_prediction/sorensen_sg_v32_e64.cu + src/link_prediction/overlap_sg_v64_e64.cu + src/link_prediction/overlap_sg_v32_e32.cu + src/link_prediction/overlap_sg_v32_e64.cu + src/link_prediction/cosine_sg_v64_e64.cu + src/link_prediction/cosine_sg_v32_e32.cu + src/link_prediction/cosine_sg_v32_e64.cu + src/link_prediction/jaccard_mg_v64_e64.cu + src/link_prediction/jaccard_mg_v32_e32.cu + src/link_prediction/jaccard_mg_v32_e64.cu + src/link_prediction/sorensen_mg_v64_e64.cu + src/link_prediction/sorensen_mg_v32_e32.cu + src/link_prediction/sorensen_mg_v32_e64.cu + src/link_prediction/overlap_mg_v64_e64.cu + src/link_prediction/overlap_mg_v32_e32.cu + src/link_prediction/overlap_mg_v32_e64.cu + src/link_prediction/cosine_mg_v64_e64.cu + src/link_prediction/cosine_mg_v32_e32.cu + src/link_prediction/cosine_mg_v32_e64.cu src/layout/legacy/force_atlas2.cu src/converters/legacy/COOtoCSR.cu src/community/legacy/spectral_clustering.cu - src/community/louvain_sg.cu - src/community/louvain_mg.cu - src/community/leiden_sg.cu - src/community/leiden_mg.cu - src/community/ecg_sg.cu - src/community/ecg_mg.cu + src/community/louvain_sg_v64_e64.cu + src/community/louvain_sg_v32_e32.cu + src/community/louvain_sg_v32_e64.cu + src/community/louvain_mg_v64_e64.cu + src/community/louvain_mg_v32_e32.cu + src/community/louvain_mg_v32_e64.cu + src/community/leiden_sg_v64_e64.cu + src/community/leiden_sg_v32_e32.cu + src/community/leiden_sg_v32_e64.cu + src/community/leiden_mg_v64_e64.cu + src/community/leiden_mg_v32_e32.cu + src/community/leiden_mg_v32_e64.cu + src/community/ecg_sg_v64_e64.cu + src/community/ecg_sg_v32_e32.cu + src/community/ecg_sg_v32_e64.cu + src/community/ecg_mg_v64_e64.cu + src/community/ecg_mg_v32_e32.cu + src/community/ecg_mg_v32_e64.cu src/community/legacy/louvain.cu src/community/legacy/ecg.cu - src/community/egonet_sg.cu - src/community/egonet_mg.cu - src/community/k_truss_sg.cu - src/sampling/random_walks.cu - src/sampling/random_walks_sg.cu - src/sampling/detail/prepare_next_frontier_sg.cu - src/sampling/detail/prepare_next_frontier_mg.cu - src/sampling/detail/gather_one_hop_edgelist_sg.cu - src/sampling/detail/gather_one_hop_edgelist_mg.cu - src/sampling/detail/remove_visited_vertices_from_frontier.cu - src/sampling/detail/sample_edges_sg.cu - src/sampling/detail/sample_edges_mg.cu - src/sampling/detail/shuffle_and_organize_output_mg.cu - src/sampling/uniform_neighbor_sampling_mg.cpp - src/sampling/uniform_neighbor_sampling_sg.cpp - src/sampling/renumber_sampled_edgelist_sg.cu - src/sampling/sampling_post_processing_sg.cu - src/cores/core_number_sg.cu - src/cores/core_number_mg.cu - src/cores/k_core_sg.cu - src/cores/k_core_mg.cu + src/community/egonet_sg_v64_e64.cu + src/community/egonet_sg_v32_e32.cu + src/community/egonet_sg_v32_e64.cu + src/community/egonet_mg_v64_e64.cu + src/community/egonet_mg_v32_e32.cu + src/community/egonet_mg_v32_e64.cu + src/community/k_truss_sg_v64_e64.cu + src/community/k_truss_sg_v32_e32.cu + src/community/k_truss_sg_v32_e64.cu + src/sampling/random_walks_old_sg_v32_e32.cu + src/sampling/random_walks_old_sg_v32_e64.cu + src/sampling/random_walks_old_sg_v64_e64.cu + src/sampling/random_walks_sg_v64_e64.cu + src/sampling/random_walks_sg_v32_e32.cu + src/sampling/random_walks_sg_v32_e64.cu + src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu + src/sampling/detail/prepare_next_frontier_sg_v32_e32.cu + src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu + src/sampling/detail/prepare_next_frontier_mg_v32_e32.cu + src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu + src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu + src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu + src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu + src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu + src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu + src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu + src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu + src/sampling/detail/sample_edges_sg_v64_e64.cu + src/sampling/detail/sample_edges_sg_v32_e32.cu + src/sampling/detail/sample_edges_sg_v32_e64.cu + src/sampling/detail/sample_edges_mg_v64_e64.cu + src/sampling/detail/sample_edges_mg_v32_e32.cu + src/sampling/detail/sample_edges_mg_v32_e64.cu + src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu + src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu + src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu + src/sampling/uniform_neighbor_sampling_mg_v32_e64.cpp + src/sampling/uniform_neighbor_sampling_mg_v32_e32.cpp + src/sampling/uniform_neighbor_sampling_mg_v64_e64.cpp + src/sampling/uniform_neighbor_sampling_sg_v32_e64.cpp + src/sampling/uniform_neighbor_sampling_sg_v32_e32.cpp + src/sampling/uniform_neighbor_sampling_sg_v64_e64.cpp + src/sampling/renumber_sampled_edgelist_sg_v64_e64.cu + src/sampling/renumber_sampled_edgelist_sg_v32_e32.cu + src/sampling/sampling_post_processing_sg_v64_e64.cu + src/sampling/sampling_post_processing_sg_v32_e32.cu + src/sampling/sampling_post_processing_sg_v32_e64.cu + src/cores/core_number_sg_v64_e64.cu + src/cores/core_number_sg_v32_e32.cu + src/cores/core_number_sg_v32_e64.cu + src/cores/core_number_mg_v64_e64.cu + src/cores/core_number_mg_v32_e32.cu + src/cores/core_number_mg_v32_e64.cu + src/cores/k_core_sg_v64_e64.cu + src/cores/k_core_sg_v32_e32.cu + src/cores/k_core_sg_v32_e64.cu + src/cores/k_core_mg_v64_e64.cu + src/cores/k_core_mg_v32_e32.cu + src/cores/k_core_mg_v32_e64.cu src/components/legacy/connectivity.cu - src/generators/generate_rmat_edgelist.cu - src/generators/generate_bipartite_rmat_edgelist.cu - src/generators/generator_tools.cu - src/generators/simple_generators.cu - src/generators/erdos_renyi_generator.cu - src/structure/graph_sg.cu - src/structure/graph_mg.cu - src/structure/graph_view_sg.cu - src/structure/decompress_to_edgelist_sg.cu - src/structure/decompress_to_edgelist_mg.cu - src/structure/symmetrize_graph_sg.cu - src/structure/symmetrize_graph_mg.cu - src/structure/transpose_graph_sg.cu - src/structure/transpose_graph_mg.cu - src/structure/transpose_graph_storage_sg.cu - src/structure/transpose_graph_storage_mg.cu - src/structure/coarsen_graph_sg.cu - src/structure/coarsen_graph_mg.cu - src/structure/graph_weight_utils_mg.cu - src/structure/graph_weight_utils_sg.cu - src/structure/renumber_edgelist_sg.cu - src/structure/renumber_edgelist_mg.cu - src/structure/renumber_utils_sg.cu - src/structure/renumber_utils_mg.cu - src/structure/relabel_sg.cu - src/structure/relabel_mg.cu - src/structure/induced_subgraph_sg.cu - src/structure/induced_subgraph_mg.cu - src/structure/select_random_vertices_sg.cu - src/structure/select_random_vertices_mg.cu - src/traversal/extract_bfs_paths_sg.cu - src/traversal/extract_bfs_paths_mg.cu - src/traversal/bfs_sg.cu - src/traversal/bfs_mg.cu - src/traversal/sssp_sg.cu - src/traversal/od_shortest_distances_sg.cu - src/traversal/sssp_mg.cu - src/link_analysis/hits_sg.cu - src/link_analysis/hits_mg.cu - src/link_analysis/pagerank_sg.cu - src/link_analysis/pagerank_mg.cu - src/centrality/katz_centrality_sg.cu - src/centrality/katz_centrality_mg.cu - src/centrality/eigenvector_centrality_sg.cu - src/centrality/eigenvector_centrality_mg.cu - src/centrality/betweenness_centrality_sg.cu - src/centrality/betweenness_centrality_mg.cu + src/generators/generate_rmat_edgelist_sg_v32_e32.cu + src/generators/generate_rmat_edgelist_sg_v64_e64.cu + src/generators/generate_bipartite_rmat_edgelist_sg_v32_e32.cu + src/generators/generate_bipartite_rmat_edgelist_sg_v64_e64.cu + src/generators/generator_tools_sg_v32_e32.cu + src/generators/generator_tools_sg_v64_e64.cu + src/generators/simple_generators_sg_v32_e32.cu + src/generators/simple_generators_sg_v64_e64.cu + src/generators/erdos_renyi_generator_sg_v32_e32.cu + src/generators/erdos_renyi_generator_sg_v64_e64.cu + src/structure/graph_sg_v64_e64.cu + src/structure/graph_sg_v32_e32.cu + src/structure/graph_sg_v32_e64.cu + src/structure/graph_mg_v64_e64.cu + src/structure/graph_mg_v32_e32.cu + src/structure/graph_mg_v32_e64.cu + src/structure/graph_view_sg_v64_e64.cu + src/structure/graph_view_sg_v32_e32.cu + src/structure/graph_view_sg_v32_e64.cu + src/structure/decompress_to_edgelist_sg_v64_e64.cu + src/structure/decompress_to_edgelist_sg_v32_e32.cu + src/structure/decompress_to_edgelist_sg_v32_e64.cu + src/structure/decompress_to_edgelist_mg_v64_e64.cu + src/structure/decompress_to_edgelist_mg_v32_e32.cu + src/structure/decompress_to_edgelist_mg_v32_e64.cu + src/structure/symmetrize_graph_sg_v64_e64.cu + src/structure/symmetrize_graph_sg_v32_e32.cu + src/structure/symmetrize_graph_sg_v32_e64.cu + src/structure/symmetrize_graph_mg_v64_e64.cu + src/structure/symmetrize_graph_mg_v32_e32.cu + src/structure/symmetrize_graph_mg_v32_e64.cu + src/structure/transpose_graph_sg_v64_e64.cu + src/structure/transpose_graph_sg_v32_e32.cu + src/structure/transpose_graph_sg_v32_e64.cu + src/structure/transpose_graph_mg_v64_e64.cu + src/structure/transpose_graph_mg_v32_e32.cu + src/structure/transpose_graph_mg_v32_e64.cu + src/structure/transpose_graph_storage_sg_v64_e64.cu + src/structure/transpose_graph_storage_sg_v32_e32.cu + src/structure/transpose_graph_storage_sg_v32_e64.cu + src/structure/transpose_graph_storage_mg_v64_e64.cu + src/structure/transpose_graph_storage_mg_v32_e32.cu + src/structure/transpose_graph_storage_mg_v32_e64.cu + src/structure/coarsen_graph_sg_v64_e64.cu + src/structure/coarsen_graph_sg_v32_e32.cu + src/structure/coarsen_graph_sg_v32_e64.cu + src/structure/coarsen_graph_mg_v64_e64.cu + src/structure/coarsen_graph_mg_v32_e32.cu + src/structure/coarsen_graph_mg_v32_e64.cu + src/structure/graph_weight_utils_mg_v64_e64.cu + src/structure/graph_weight_utils_mg_v32_e32.cu + src/structure/graph_weight_utils_mg_v32_e64.cu + src/structure/graph_weight_utils_sg_v64_e64.cu + src/structure/graph_weight_utils_sg_v32_e32.cu + src/structure/graph_weight_utils_sg_v32_e64.cu + src/structure/renumber_edgelist_sg_v64_e64.cu + src/structure/renumber_edgelist_sg_v32_e32.cu + src/structure/renumber_edgelist_sg_v32_e64.cu + src/structure/renumber_edgelist_mg_v64_e64.cu + src/structure/renumber_edgelist_mg_v32_e32.cu + src/structure/renumber_edgelist_mg_v32_e64.cu + src/structure/renumber_utils_sg_v64_e64.cu + src/structure/renumber_utils_sg_v32_e32.cu + src/structure/renumber_utils_mg_v64_e64.cu + src/structure/renumber_utils_mg_v32_e32.cu + src/structure/relabel_sg_v64_e64.cu + src/structure/relabel_sg_v32_e32.cu + src/structure/relabel_mg_v64_e64.cu + src/structure/relabel_mg_v32_e32.cu + src/structure/induced_subgraph_sg_v64_e64.cu + src/structure/induced_subgraph_sg_v32_e32.cu + src/structure/induced_subgraph_sg_v32_e64.cu + src/structure/induced_subgraph_mg_v64_e64.cu + src/structure/induced_subgraph_mg_v32_e32.cu + src/structure/induced_subgraph_mg_v32_e64.cu + src/structure/select_random_vertices_sg_v64_e64.cu + src/structure/select_random_vertices_sg_v32_e32.cu + src/structure/select_random_vertices_sg_v32_e64.cu + src/structure/select_random_vertices_mg_v64_e64.cu + src/structure/select_random_vertices_mg_v32_e32.cu + src/structure/select_random_vertices_mg_v32_e64.cu + src/traversal/extract_bfs_paths_sg_v64_e64.cu + src/traversal/extract_bfs_paths_sg_v32_e32.cu + src/traversal/extract_bfs_paths_sg_v32_e64.cu + src/traversal/extract_bfs_paths_mg_v64_e64.cu + src/traversal/extract_bfs_paths_mg_v32_e32.cu + src/traversal/extract_bfs_paths_mg_v32_e64.cu + src/traversal/bfs_sg_v64_e64.cu + src/traversal/bfs_sg_v32_e32.cu + src/traversal/bfs_sg_v32_e64.cu + src/traversal/bfs_mg_v64_e64.cu + src/traversal/bfs_mg_v32_e32.cu + src/traversal/bfs_mg_v32_e64.cu + src/traversal/sssp_sg_v64_e64.cu + src/traversal/sssp_sg_v32_e32.cu + src/traversal/sssp_sg_v32_e64.cu + src/traversal/od_shortest_distances_sg_v64_e64.cu + src/traversal/od_shortest_distances_sg_v32_e32.cu + src/traversal/od_shortest_distances_sg_v32_e64.cu + src/traversal/sssp_mg_v64_e64.cu + src/traversal/sssp_mg_v32_e32.cu + src/traversal/sssp_mg_v32_e64.cu + src/link_analysis/hits_sg_v64_e64.cu + src/link_analysis/hits_sg_v32_e32.cu + src/link_analysis/hits_sg_v32_e64.cu + src/link_analysis/hits_mg_v64_e64.cu + src/link_analysis/hits_mg_v32_e32.cu + src/link_analysis/hits_mg_v32_e64.cu + src/link_analysis/pagerank_sg_v64_e64.cu + src/link_analysis/pagerank_sg_v32_e32.cu + src/link_analysis/pagerank_sg_v32_e64.cu + src/link_analysis/pagerank_mg_v64_e64.cu + src/link_analysis/pagerank_mg_v32_e32.cu + src/link_analysis/pagerank_mg_v32_e64.cu + src/centrality/katz_centrality_sg_v64_e64.cu + src/centrality/katz_centrality_sg_v32_e32.cu + src/centrality/katz_centrality_sg_v32_e64.cu + src/centrality/katz_centrality_mg_v64_e64.cu + src/centrality/katz_centrality_mg_v32_e32.cu + src/centrality/katz_centrality_mg_v32_e64.cu + src/centrality/eigenvector_centrality_sg_v64_e64.cu + src/centrality/eigenvector_centrality_sg_v32_e32.cu + src/centrality/eigenvector_centrality_sg_v32_e64.cu + src/centrality/eigenvector_centrality_mg_v64_e64.cu + src/centrality/eigenvector_centrality_mg_v32_e32.cu + src/centrality/eigenvector_centrality_mg_v32_e64.cu + src/centrality/betweenness_centrality_sg_v64_e64.cu + src/centrality/betweenness_centrality_sg_v32_e32.cu + src/centrality/betweenness_centrality_sg_v32_e64.cu + src/centrality/betweenness_centrality_mg_v64_e64.cu + src/centrality/betweenness_centrality_mg_v32_e32.cu + src/centrality/betweenness_centrality_mg_v32_e64.cu src/tree/legacy/mst.cu - src/components/weakly_connected_components_sg.cu - src/components/weakly_connected_components_mg.cu - src/components/mis_sg.cu - src/components/mis_mg.cu - src/components/vertex_coloring_sg.cu - src/components/vertex_coloring_mg.cu - src/structure/create_graph_from_edgelist_sg.cu - src/structure/create_graph_from_edgelist_mg.cu - src/structure/symmetrize_edgelist_sg.cu - src/structure/symmetrize_edgelist_mg.cu - src/community/triangle_count_sg.cu - src/community/triangle_count_mg.cu - src/community/approx_weighted_matching_sg.cu - src/community/approx_weighted_matching_mg.cu - src/traversal/k_hop_nbrs_sg.cu - src/traversal/k_hop_nbrs_mg.cu - src/mtmg/vertex_result.cu - src/mtmg/vertex_pairs_result.cu + src/components/weakly_connected_components_sg_v64_e64.cu + src/components/weakly_connected_components_sg_v32_e32.cu + src/components/weakly_connected_components_sg_v32_e64.cu + src/components/weakly_connected_components_mg_v64_e64.cu + src/components/weakly_connected_components_mg_v32_e32.cu + src/components/weakly_connected_components_mg_v32_e64.cu + src/components/mis_sg_v64_e64.cu + src/components/mis_sg_v32_e32.cu + src/components/mis_sg_v32_e64.cu + src/components/mis_mg_v64_e64.cu + src/components/mis_mg_v32_e32.cu + src/components/mis_mg_v32_e64.cu + src/components/vertex_coloring_sg_v64_e64.cu + src/components/vertex_coloring_sg_v32_e32.cu + src/components/vertex_coloring_sg_v32_e64.cu + src/components/vertex_coloring_mg_v64_e64.cu + src/components/vertex_coloring_mg_v32_e32.cu + src/components/vertex_coloring_mg_v32_e64.cu + src/structure/create_graph_from_edgelist_sg_v64_e64.cu + src/structure/create_graph_from_edgelist_sg_v32_e32.cu + src/structure/create_graph_from_edgelist_sg_v32_e64.cu + src/structure/create_graph_from_edgelist_mg_v64_e64.cu + src/structure/create_graph_from_edgelist_mg_v32_e32.cu + src/structure/create_graph_from_edgelist_mg_v32_e64.cu + src/structure/symmetrize_edgelist_sg_v64_e64.cu + src/structure/symmetrize_edgelist_sg_v32_e32.cu + src/structure/symmetrize_edgelist_mg_v64_e64.cu + src/structure/symmetrize_edgelist_mg_v32_e32.cu + src/community/triangle_count_sg_v64_e64.cu + src/community/triangle_count_sg_v32_e32.cu + src/community/triangle_count_sg_v32_e64.cu + src/community/triangle_count_mg_v64_e64.cu + src/community/triangle_count_mg_v32_e32.cu + src/community/triangle_count_mg_v32_e64.cu + src/community/approx_weighted_matching_sg_v64_e64.cu + src/community/approx_weighted_matching_sg_v32_e32.cu + src/community/approx_weighted_matching_sg_v32_e64.cu + src/community/approx_weighted_matching_mg_v64_e64.cu + src/community/approx_weighted_matching_mg_v32_e32.cu + src/community/approx_weighted_matching_mg_v32_e64.cu + src/traversal/k_hop_nbrs_sg_v64_e64.cu + src/traversal/k_hop_nbrs_sg_v32_e32.cu + src/traversal/k_hop_nbrs_sg_v32_e64.cu + src/traversal/k_hop_nbrs_mg_v64_e64.cu + src/traversal/k_hop_nbrs_mg_v32_e32.cu + src/traversal/k_hop_nbrs_mg_v32_e64.cu + src/mtmg/vertex_result_sg_v32_e32.cu + src/mtmg/vertex_result_sg_v64_e64.cu + src/mtmg/vertex_result_mg_v32_e32.cu + src/mtmg/vertex_result_mg_v64_e64.cu + src/mtmg/vertex_pairs_result_sg_v32_e32.cu + src/mtmg/vertex_pairs_result_sg_v64_e64.cu + src/mtmg/vertex_pairs_result_mg_v32_e32.cu + src/mtmg/vertex_pairs_result_mg_v64_e64.cu ) if(USE_CUGRAPH_OPS) diff --git a/cpp/src/centrality/betweenness_centrality_mg.cu b/cpp/src/centrality/betweenness_centrality_mg.cu deleted file mode 100644 index 23f31e64b0b..00000000000 --- a/cpp/src/centrality/betweenness_centrality_mg.cu +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "centrality/betweenness_centrality_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_mg_v32_e32.cu b/cpp/src/centrality/betweenness_centrality_mg_v32_e32.cu new file mode 100644 index 00000000000..ea5aa99902b --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_mg_v32_e32.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_mg_v32_e64.cu b/cpp/src/centrality/betweenness_centrality_mg_v32_e64.cu new file mode 100644 index 00000000000..e90ae93b407 --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_mg_v32_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_mg_v64_e64.cu b/cpp/src/centrality/betweenness_centrality_mg_v64_e64.cu new file mode 100644 index 00000000000..f0f1f3efe60 --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_mg_v64_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_sg.cu b/cpp/src/centrality/betweenness_centrality_sg.cu deleted file mode 100644 index e19345df665..00000000000 --- a/cpp/src/centrality/betweenness_centrality_sg.cu +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "centrality/betweenness_centrality_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template rmm::device_uvector betweenness_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const include_endpoints, - bool do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, float> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -template edge_property_t, double> -edge_betweenness_centrality( - const raft::handle_t& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - bool const normalized, - bool const do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_sg_v32_e32.cu b/cpp/src/centrality/betweenness_centrality_sg_v32_e32.cu new file mode 100644 index 00000000000..a13c34fe4a3 --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_sg_v32_e32.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_sg_v32_e64.cu b/cpp/src/centrality/betweenness_centrality_sg_v32_e64.cu new file mode 100644 index 00000000000..21175047fe9 --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_sg_v32_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/betweenness_centrality_sg_v64_e64.cu b/cpp/src/centrality/betweenness_centrality_sg_v64_e64.cu new file mode 100644 index 00000000000..95c40a87c5f --- /dev/null +++ b/cpp/src/centrality/betweenness_centrality_sg_v64_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/betweenness_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template rmm::device_uvector betweenness_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const include_endpoints, + bool do_expensive_check); + +template edge_property_t, float> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +template edge_property_t, double> +edge_betweenness_centrality( + const raft::handle_t& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + bool const normalized, + bool const do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_mg.cu b/cpp/src/centrality/eigenvector_centrality_mg.cu deleted file mode 100644 index 4ad942cd690..00000000000 --- a/cpp/src/centrality/eigenvector_centrality_mg.cu +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "centrality/eigenvector_centrality_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_mg_v32_e32.cu b/cpp/src/centrality/eigenvector_centrality_mg_v32_e32.cu new file mode 100644 index 00000000000..cadcab6966a --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_mg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_mg_v32_e64.cu b/cpp/src/centrality/eigenvector_centrality_mg_v32_e64.cu new file mode 100644 index 00000000000..77d74310c8e --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_mg_v32_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_mg_v64_e64.cu b/cpp/src/centrality/eigenvector_centrality_mg_v64_e64.cu new file mode 100644 index 00000000000..5b60b0dcb1e --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_mg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_sg.cu b/cpp/src/centrality/eigenvector_centrality_sg.cu deleted file mode 100644 index e3be04406b7..00000000000 --- a/cpp/src/centrality/eigenvector_centrality_sg.cu +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "centrality/eigenvector_centrality_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template rmm::device_uvector eigenvector_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> initial_centralities, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_sg_v32_e32.cu b/cpp/src/centrality/eigenvector_centrality_sg_v32_e32.cu new file mode 100644 index 00000000000..ce29f055b34 --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_sg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_sg_v32_e64.cu b/cpp/src/centrality/eigenvector_centrality_sg_v32_e64.cu new file mode 100644 index 00000000000..c0efa7a59c1 --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_sg_v32_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/eigenvector_centrality_sg_v64_e64.cu b/cpp/src/centrality/eigenvector_centrality_sg_v64_e64.cu new file mode 100644 index 00000000000..b7a35f6596b --- /dev/null +++ b/cpp/src/centrality/eigenvector_centrality_sg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2022-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. + */ +#include "centrality/eigenvector_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template rmm::device_uvector eigenvector_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> initial_centralities, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_mg.cu b/cpp/src/centrality/katz_centrality_mg.cu deleted file mode 100644 index 67fcf028616..00000000000 --- a/cpp/src/centrality/katz_centrality_mg.cu +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "centrality/katz_centrality_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_mg_v32_e32.cu b/cpp/src/centrality/katz_centrality_mg_v32_e32.cu new file mode 100644 index 00000000000..8d9efe4c64a --- /dev/null +++ b/cpp/src/centrality/katz_centrality_mg_v32_e32.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_mg_v32_e64.cu b/cpp/src/centrality/katz_centrality_mg_v32_e64.cu new file mode 100644 index 00000000000..22efe9b5606 --- /dev/null +++ b/cpp/src/centrality/katz_centrality_mg_v32_e64.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_mg_v64_e64.cu b/cpp/src/centrality/katz_centrality_mg_v64_e64.cu new file mode 100644 index 00000000000..53dc8217a9f --- /dev/null +++ b/cpp/src/centrality/katz_centrality_mg_v64_e64.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_sg.cu b/cpp/src/centrality/katz_centrality_sg.cu deleted file mode 100644 index d36038ee025..00000000000 --- a/cpp/src/centrality/katz_centrality_sg.cu +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "centrality/katz_centrality_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - float const* betas, - float* katz_centralities, - float alpha, - float beta, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -template void katz_centrality( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - double const* betas, - double* katz_centralities, - double alpha, - double beta, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool normalize, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_sg_v32_e32.cu b/cpp/src/centrality/katz_centrality_sg_v32_e32.cu new file mode 100644 index 00000000000..cd87680b15b --- /dev/null +++ b/cpp/src/centrality/katz_centrality_sg_v32_e32.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_sg_v32_e64.cu b/cpp/src/centrality/katz_centrality_sg_v32_e64.cu new file mode 100644 index 00000000000..6d977c14825 --- /dev/null +++ b/cpp/src/centrality/katz_centrality_sg_v32_e64.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/centrality/katz_centrality_sg_v64_e64.cu b/cpp/src/centrality/katz_centrality_sg_v64_e64.cu new file mode 100644 index 00000000000..2a81ad50391 --- /dev/null +++ b/cpp/src/centrality/katz_centrality_sg_v64_e64.cu @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021-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. + */ +#include "centrality/katz_centrality_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + float const* betas, + float* katz_centralities, + float alpha, + float beta, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +template void katz_centrality( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + double const* betas, + double* katz_centralities, + double alpha, + double beta, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_mg.cu b/cpp/src/community/approx_weighted_matching_mg.cu deleted file mode 100644 index 41d6c3d97e0..00000000000 --- a/cpp/src/community/approx_weighted_matching_mg.cu +++ /dev/null @@ -1,50 +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. - */ -#include "approx_weighted_matching_impl.cuh" - -namespace cugraph { - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_mg_v32_e32.cu b/cpp/src/community/approx_weighted_matching_mg_v32_e32.cu new file mode 100644 index 00000000000..e55f1a3c503 --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_mg_v32_e32.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_mg_v32_e64.cu b/cpp/src/community/approx_weighted_matching_mg_v32_e64.cu new file mode 100644 index 00000000000..431634ab18a --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_mg_v32_e64.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_mg_v64_e64.cu b/cpp/src/community/approx_weighted_matching_mg_v64_e64.cu new file mode 100644 index 00000000000..39cf2f2cf80 --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_mg_v64_e64.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_sg.cu b/cpp/src/community/approx_weighted_matching_sg.cu deleted file mode 100644 index 418a43d51ae..00000000000 --- a/cpp/src/community/approx_weighted_matching_sg.cu +++ /dev/null @@ -1,50 +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. - */ -#include "approx_weighted_matching_impl.cuh" - -namespace cugraph { - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, float> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template std::tuple, double> approximate_weighted_matching( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_sg_v32_e32.cu b/cpp/src/community/approx_weighted_matching_sg_v32_e32.cu new file mode 100644 index 00000000000..9fe9a848e9a --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_sg_v32_e32.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_sg_v32_e64.cu b/cpp/src/community/approx_weighted_matching_sg_v32_e64.cu new file mode 100644 index 00000000000..f9bab14c29f --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_sg_v32_e64.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/approx_weighted_matching_sg_v64_e64.cu b/cpp/src/community/approx_weighted_matching_sg_v64_e64.cu new file mode 100644 index 00000000000..9b71ae71318 --- /dev/null +++ b/cpp/src/community/approx_weighted_matching_sg_v64_e64.cu @@ -0,0 +1,30 @@ +/* + * 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. + */ +#include "approx_weighted_matching_impl.cuh" + +namespace cugraph { + +template std::tuple, float> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template std::tuple, double> approximate_weighted_matching( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_mg.cu b/cpp/src/community/detail/common_methods_mg.cu deleted file mode 100644 index 980c00993a4..00000000000 --- a/cpp/src/community/detail/common_methods_mg.cu +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "community/detail/common_methods.cuh" - -namespace cugraph { -namespace detail { - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int64_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int64_t> const& - src_clusters_cache); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_mg_v32_e32.cu b/cpp/src/community/detail/common_methods_mg_v32_e32.cu new file mode 100644 index 00000000000..fae90825b5d --- /dev/null +++ b/cpp/src/community/detail/common_methods_mg_v32_e32.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_mg_v32_e64.cu b/cpp/src/community/detail/common_methods_mg_v32_e64.cu new file mode 100644 index 00000000000..3958683b4ad --- /dev/null +++ b/cpp/src/community/detail/common_methods_mg_v32_e64.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_mg_v64_e64.cu b/cpp/src/community/detail/common_methods_mg_v64_e64.cu new file mode 100644 index 00000000000..e0124d88e55 --- /dev/null +++ b/cpp/src/community/detail/common_methods_mg_v64_e64.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int64_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int64_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_sg.cu b/cpp/src/community/detail/common_methods_sg.cu deleted file mode 100644 index 21e867df4b4..00000000000 --- a/cpp/src/community/detail/common_methods_sg.cu +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "community/detail/common_methods.cuh" - -namespace cugraph { -namespace detail { - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template float compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - float total_edge_weight, - float resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template double compute_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - rmm::device_uvector const& next_clusters, - rmm::device_uvector const& cluster_weights, - double total_edge_weight, - double resolution); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, float>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template std::tuple< - cugraph::graph_t, - std::optional, double>>> -graph_contraction(raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weights, - raft::device_span labels); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template rmm::device_uvector update_clustering_by_delta_modularity( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int64_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int32_t> const& - src_clusters_cache); - -template std::tuple, rmm::device_uvector> -compute_cluster_keys_and_values( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - rmm::device_uvector const& next_clusters_v, - edge_src_property_t, int64_t> const& - src_clusters_cache); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_sg_v32_e32.cu b/cpp/src/community/detail/common_methods_sg_v32_e32.cu new file mode 100644 index 00000000000..1c50ecd4700 --- /dev/null +++ b/cpp/src/community/detail/common_methods_sg_v32_e32.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_sg_v32_e64.cu b/cpp/src/community/detail/common_methods_sg_v32_e64.cu new file mode 100644 index 00000000000..7be4b179fa4 --- /dev/null +++ b/cpp/src/community/detail/common_methods_sg_v32_e64.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int32_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/common_methods_sg_v64_e64.cu b/cpp/src/community/detail/common_methods_sg_v64_e64.cu new file mode 100644 index 00000000000..9119bcb00c0 --- /dev/null +++ b/cpp/src/community/detail/common_methods_sg_v64_e64.cu @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022-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. + */ +#include "community/detail/common_methods.cuh" + +namespace cugraph { +namespace detail { + +template float compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + float total_edge_weight, + float resolution); + +template double compute_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + rmm::device_uvector const& next_clusters, + rmm::device_uvector const& cluster_weights, + double total_edge_weight, + double resolution); + +template std::tuple< + cugraph::graph_t, + std::optional, float>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template std::tuple< + cugraph::graph_t, + std::optional, double>>> +graph_contraction(raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weights, + raft::device_span labels); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template rmm::device_uvector update_clustering_by_delta_modularity( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int64_t> const& + src_clusters_cache); + +template std::tuple, rmm::device_uvector> +compute_cluster_keys_and_values( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + rmm::device_uvector const& next_clusters_v, + edge_src_property_t, int64_t> const& + src_clusters_cache); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_mg.cu b/cpp/src/community/detail/maximal_independent_moves_mg_v32_e32.cu similarity index 69% rename from cpp/src/community/detail/maximal_independent_moves_mg.cu rename to cpp/src/community/detail/maximal_independent_moves_mg_v32_e32.cu index 577253cdf58..cbd3554afae 100644 --- a/cpp/src/community/detail/maximal_independent_moves_mg.cu +++ b/cpp/src/community/detail/maximal_independent_moves_mg_v32_e32.cu @@ -23,16 +23,6 @@ template rmm::device_uvector maximal_independent_moves( graph_view_t const& decision_graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector maximal_independent_moves( - raft::handle_t const& handle, - graph_view_t const& decision_graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector maximal_independent_moves( - raft::handle_t const& handle, - graph_view_t const& decision_graph_view, - raft::random::RngState& rng_state); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_mg_v32_e64.cu b/cpp/src/community/detail/maximal_independent_moves_mg_v32_e64.cu new file mode 100644 index 00000000000..596f7fa0a11 --- /dev/null +++ b/cpp/src/community/detail/maximal_independent_moves_mg_v32_e64.cu @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023-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. + */ +#include "maximal_independent_moves.cuh" + +namespace cugraph { +namespace detail { + +template rmm::device_uvector maximal_independent_moves( + raft::handle_t const& handle, + graph_view_t const& decision_graph_view, + raft::random::RngState& rng_state); + +} // namespace detail + +} // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_mg_v64_e64.cu b/cpp/src/community/detail/maximal_independent_moves_mg_v64_e64.cu new file mode 100644 index 00000000000..0c52ea12c35 --- /dev/null +++ b/cpp/src/community/detail/maximal_independent_moves_mg_v64_e64.cu @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023-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. + */ +#include "maximal_independent_moves.cuh" + +namespace cugraph { +namespace detail { + +template rmm::device_uvector maximal_independent_moves( + raft::handle_t const& handle, + graph_view_t const& decision_graph_view, + raft::random::RngState& rng_state); + +} // namespace detail + +} // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_sg.cu b/cpp/src/community/detail/maximal_independent_moves_sg_v32_e32.cu similarity index 69% rename from cpp/src/community/detail/maximal_independent_moves_sg.cu rename to cpp/src/community/detail/maximal_independent_moves_sg_v32_e32.cu index 18527c1ce48..47bcff41d0d 100644 --- a/cpp/src/community/detail/maximal_independent_moves_sg.cu +++ b/cpp/src/community/detail/maximal_independent_moves_sg_v32_e32.cu @@ -23,15 +23,5 @@ template rmm::device_uvector maximal_independent_moves( graph_view_t const& decision_graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector maximal_independent_moves( - raft::handle_t const& handle, - graph_view_t const& decision_graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector maximal_independent_moves( - raft::handle_t const& handle, - graph_view_t const& decision_graph_view, - raft::random::RngState& rng_state); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_sg_v32_e64.cu b/cpp/src/community/detail/maximal_independent_moves_sg_v32_e64.cu new file mode 100644 index 00000000000..2ae195faf01 --- /dev/null +++ b/cpp/src/community/detail/maximal_independent_moves_sg_v32_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023-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. + */ +#include "maximal_independent_moves.cuh" + +namespace cugraph { +namespace detail { + +template rmm::device_uvector maximal_independent_moves( + raft::handle_t const& handle, + graph_view_t const& decision_graph_view, + raft::random::RngState& rng_state); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/maximal_independent_moves_sg_v64_e64.cu b/cpp/src/community/detail/maximal_independent_moves_sg_v64_e64.cu new file mode 100644 index 00000000000..34978449007 --- /dev/null +++ b/cpp/src/community/detail/maximal_independent_moves_sg_v64_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023-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. + */ +#include "maximal_independent_moves.cuh" + +namespace cugraph { +namespace detail { + +template rmm::device_uvector maximal_independent_moves( + raft::handle_t const& handle, + graph_view_t const& decision_graph_view, + raft::random::RngState& rng_state); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_mg.cu b/cpp/src/community/detail/refine_mg.cu deleted file mode 100644 index 946c18de2c5..00000000000 --- a/cpp/src/community/detail/refine_mg.cu +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ -#include "community/detail/refine_impl.cuh" - -namespace cugraph { -namespace detail { - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/community/detail/refine_mg_v32_e32.cu b/cpp/src/community/detail/refine_mg_v32_e32.cu new file mode 100644 index 00000000000..d27260c1337 --- /dev/null +++ b/cpp/src/community/detail/refine_mg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_mg_v32_e64.cu b/cpp/src/community/detail/refine_mg_v32_e64.cu new file mode 100644 index 00000000000..16c0fde2991 --- /dev/null +++ b/cpp/src/community/detail/refine_mg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_mg_v64_e64.cu b/cpp/src/community/detail/refine_mg_v64_e64.cu new file mode 100644 index 00000000000..1a2ed665b8a --- /dev/null +++ b/cpp/src/community/detail/refine_mg_v64_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_sg.cu b/cpp/src/community/detail/refine_sg.cu deleted file mode 100644 index af4327b44e2..00000000000 --- a/cpp/src/community/detail/refine_sg.cu +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ -#include "community/detail/refine_impl.cuh" - -namespace cugraph { -namespace detail { - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - float total_edge_weight, - float resolution, - float theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, float> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int32_t> const& - src_clusters_cache, - edge_dst_property_t, int32_t> const& - dst_clusters_cache, - bool up_down); - -template std::tuple, - std::pair, rmm::device_uvector>> -refine_clustering( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - cugraph::graph_view_t const& graph_view, - std::optional> edge_weight_view, - double total_edge_weight, - double resolution, - double theta, - rmm::device_uvector const& vertex_weights_v, - rmm::device_uvector&& cluster_keys_v, - rmm::device_uvector&& cluster_weights_v, - rmm::device_uvector&& next_clusters_v, - edge_src_property_t, double> const& - src_vertex_weights_cache, - edge_src_property_t, int64_t> const& - src_clusters_cache, - edge_dst_property_t, int64_t> const& - dst_clusters_cache, - bool up_down); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/community/detail/refine_sg_v32_e32.cu b/cpp/src/community/detail/refine_sg_v32_e32.cu new file mode 100644 index 00000000000..ac0ede8225d --- /dev/null +++ b/cpp/src/community/detail/refine_sg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_sg_v32_e64.cu b/cpp/src/community/detail/refine_sg_v32_e64.cu new file mode 100644 index 00000000000..f011bb2ebe0 --- /dev/null +++ b/cpp/src/community/detail/refine_sg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int32_t> const& + src_clusters_cache, + edge_dst_property_t, int32_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/detail/refine_sg_v64_e64.cu b/cpp/src/community/detail/refine_sg_v64_e64.cu new file mode 100644 index 00000000000..97ed43b3de0 --- /dev/null +++ b/cpp/src/community/detail/refine_sg_v64_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023-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. + */ +#include "community/detail/refine_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + float total_edge_weight, + float resolution, + float theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, float> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +template std::tuple, + std::pair, rmm::device_uvector>> +refine_clustering( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + cugraph::graph_view_t const& graph_view, + std::optional> edge_weight_view, + double total_edge_weight, + double resolution, + double theta, + rmm::device_uvector const& vertex_weights_v, + rmm::device_uvector&& cluster_keys_v, + rmm::device_uvector&& cluster_weights_v, + rmm::device_uvector&& next_clusters_v, + edge_src_property_t, double> const& + src_vertex_weights_cache, + edge_src_property_t, int64_t> const& + src_clusters_cache, + edge_dst_property_t, int64_t> const& + dst_clusters_cache, + bool up_down); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/community/ecg_mg.cu b/cpp/src/community/ecg_mg.cu deleted file mode 100644 index d9ba8fe18f2..00000000000 --- a/cpp/src/community/ecg_mg.cu +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "community/ecg_impl.cuh" - -namespace cugraph { -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -} // namespace cugraph diff --git a/cpp/src/community/ecg_mg_v32_e32.cu b/cpp/src/community/ecg_mg_v32_e32.cu new file mode 100644 index 00000000000..38aa72015ef --- /dev/null +++ b/cpp/src/community/ecg_mg_v32_e32.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/ecg_mg_v32_e64.cu b/cpp/src/community/ecg_mg_v32_e64.cu new file mode 100644 index 00000000000..6e9dde68dea --- /dev/null +++ b/cpp/src/community/ecg_mg_v32_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/ecg_mg_v64_e64.cu b/cpp/src/community/ecg_mg_v64_e64.cu new file mode 100644 index 00000000000..ae861a45687 --- /dev/null +++ b/cpp/src/community/ecg_mg_v64_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/ecg_sg.cu b/cpp/src/community/ecg_sg.cu deleted file mode 100644 index 8c4054aa10f..00000000000 --- a/cpp/src/community/ecg_sg.cu +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "community/ecg_impl.cuh" - -namespace cugraph { -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, float> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - float min_weight, - size_t ensemble_size, - size_t max_level, - float threshold, - float resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -template std::tuple, size_t, double> ecg( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - - double min_weight, - size_t ensemble_size, - size_t max_level, - double threshold, - double resolution); - -} // namespace cugraph diff --git a/cpp/src/community/ecg_sg_v32_e32.cu b/cpp/src/community/ecg_sg_v32_e32.cu new file mode 100644 index 00000000000..af824c66123 --- /dev/null +++ b/cpp/src/community/ecg_sg_v32_e32.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/ecg_sg_v32_e64.cu b/cpp/src/community/ecg_sg_v32_e64.cu new file mode 100644 index 00000000000..9fa1a2429f1 --- /dev/null +++ b/cpp/src/community/ecg_sg_v32_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/ecg_sg_v64_e64.cu b/cpp/src/community/ecg_sg_v64_e64.cu new file mode 100644 index 00000000000..3dc7a3b5be4 --- /dev/null +++ b/cpp/src/community/ecg_sg_v64_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/ecg_impl.cuh" + +namespace cugraph { +template std::tuple, size_t, float> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + float min_weight, + size_t ensemble_size, + size_t max_level, + float threshold, + float resolution); + +template std::tuple, size_t, double> ecg( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + + double min_weight, + size_t ensemble_size, + size_t max_level, + double threshold, + double resolution); + +} // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_mg.cu b/cpp/src/community/edge_triangle_count_mg_v32_e32.cu similarity index 69% rename from cpp/src/community/edge_triangle_count_mg.cu rename to cpp/src/community/edge_triangle_count_mg_v32_e32.cu index 254a0807e56..1212a13323b 100644 --- a/cpp/src/community/edge_triangle_count_mg.cu +++ b/cpp/src/community/edge_triangle_count_mg_v32_e32.cu @@ -22,12 +22,4 @@ template edge_property_t, int32_t> e raft::handle_t const& handle, cugraph::graph_view_t const& graph_view); -template edge_property_t, int64_t> edge_triangle_count( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view); - -template edge_property_t, int64_t> edge_triangle_count( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view); - } // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_mg_v32_e64.cu b/cpp/src/community/edge_triangle_count_mg_v32_e64.cu new file mode 100644 index 00000000000..64ee195c7ee --- /dev/null +++ b/cpp/src/community/edge_triangle_count_mg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "community/edge_triangle_count_impl.cuh" + +namespace cugraph { + +// SG instantiation +template edge_property_t, int64_t> edge_triangle_count( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view); + +} // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_mg_v64_e64.cu b/cpp/src/community/edge_triangle_count_mg_v64_e64.cu new file mode 100644 index 00000000000..67c19e5ac52 --- /dev/null +++ b/cpp/src/community/edge_triangle_count_mg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "community/edge_triangle_count_impl.cuh" + +namespace cugraph { + +// SG instantiation +template edge_property_t, int64_t> edge_triangle_count( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view); + +} // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_sg.cu b/cpp/src/community/edge_triangle_count_sg_v32_e32.cu similarity index 68% rename from cpp/src/community/edge_triangle_count_sg.cu rename to cpp/src/community/edge_triangle_count_sg_v32_e32.cu index 4ccb968458d..d6a215aa456 100644 --- a/cpp/src/community/edge_triangle_count_sg.cu +++ b/cpp/src/community/edge_triangle_count_sg_v32_e32.cu @@ -22,12 +22,4 @@ template edge_property_t, int32_t> raft::handle_t const& handle, cugraph::graph_view_t const& graph_view); -template edge_property_t, int64_t> edge_triangle_count( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view); - -template edge_property_t, int64_t> edge_triangle_count( - raft::handle_t const& handle, - cugraph::graph_view_t const& graph_view); - } // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_sg_v32_e64.cu b/cpp/src/community/edge_triangle_count_sg_v32_e64.cu new file mode 100644 index 00000000000..e70fa45c257 --- /dev/null +++ b/cpp/src/community/edge_triangle_count_sg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "community/edge_triangle_count_impl.cuh" + +namespace cugraph { + +// SG instantiation +template edge_property_t, int64_t> edge_triangle_count( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view); + +} // namespace cugraph diff --git a/cpp/src/community/edge_triangle_count_sg_v64_e64.cu b/cpp/src/community/edge_triangle_count_sg_v64_e64.cu new file mode 100644 index 00000000000..849603f781b --- /dev/null +++ b/cpp/src/community/edge_triangle_count_sg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "community/edge_triangle_count_impl.cuh" + +namespace cugraph { + +// SG instantiation +template edge_property_t, int64_t> edge_triangle_count( + raft::handle_t const& handle, + cugraph::graph_view_t const& graph_view); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_mg.cu b/cpp/src/community/egonet_mg.cu deleted file mode 100644 index 6cf9fb2d13b..00000000000 --- a/cpp/src/community/egonet_mg.cu +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "community/egonet_impl.cuh" - -namespace cugraph { - -// MG FP32 - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int32_t*, - int32_t, - int32_t); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> - -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int32_t*, - int32_t, - int32_t); -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> - -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int64_t*, - int64_t, - int64_t); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int64_t radius, - bool do_expensive_check); - -// MG FP64 - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int32_t*, - int32_t, - int32_t); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int32_t*, - int32_t, - int32_t); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const&, - graph_view_t const&, - std::optional>, - int64_t*, - int64_t, - int64_t); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int64_t radius, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/community/egonet_mg_v32_e32.cu b/cpp/src/community/egonet_mg_v32_e32.cu new file mode 100644 index 00000000000..b7c37d3d7fd --- /dev/null +++ b/cpp/src/community/egonet_mg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// MG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int32_t*, + int32_t, + int32_t); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int32_t*, + int32_t, + int32_t); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_mg_v32_e64.cu b/cpp/src/community/egonet_mg_v32_e64.cu new file mode 100644 index 00000000000..f9e27b6cf26 --- /dev/null +++ b/cpp/src/community/egonet_mg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// MG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> + +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int32_t*, + int32_t, + int32_t); +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int32_t*, + int32_t, + int32_t); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_mg_v64_e64.cu b/cpp/src/community/egonet_mg_v64_e64.cu new file mode 100644 index 00000000000..da6c501c170 --- /dev/null +++ b/cpp/src/community/egonet_mg_v64_e64.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// MG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> + +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int64_t*, + int64_t, + int64_t); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int64_t radius, + bool do_expensive_check); + +// MG FP64 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const&, + graph_view_t const&, + std::optional>, + int64_t*, + int64_t, + int64_t); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int64_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_sg.cu b/cpp/src/community/egonet_sg.cu deleted file mode 100644 index c53f41334ea..00000000000 --- a/cpp/src/community/egonet_sg.cu +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "community/egonet_impl.cuh" - -namespace cugraph { - -// SG FP32 - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - int32_t* source_vertex, - int32_t n_subgraphs, - int32_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - int32_t* source_vertex, - int32_t n_subgraphs, - int32_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - int64_t* source_vertex, - int64_t n_subgraphs, - int64_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int64_t radius, - bool do_expensive_check); - -// SG FP64 - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const&, - graph_view_t const& graph_view, - std::optional>, - int32_t* source_vertex, - int32_t n_subgraphs, - int32_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - int32_t* source_vertex, - int32_t n_subgraphs, - int32_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - int64_t* source_vertex, - int64_t n_subgraphs, - int64_t radius); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int32_t radius, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_ego(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional>, - raft::device_span source_vertex, - int64_t radius, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/community/egonet_sg_v32_e32.cu b/cpp/src/community/egonet_sg_v32_e32.cu new file mode 100644 index 00000000000..22dc7ac6a25 --- /dev/null +++ b/cpp/src/community/egonet_sg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// SG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + int32_t* source_vertex, + int32_t n_subgraphs, + int32_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const&, + graph_view_t const& graph_view, + std::optional>, + int32_t* source_vertex, + int32_t n_subgraphs, + int32_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_sg_v32_e64.cu b/cpp/src/community/egonet_sg_v32_e64.cu new file mode 100644 index 00000000000..4bb79120445 --- /dev/null +++ b/cpp/src/community/egonet_sg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// SG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + int32_t* source_vertex, + int32_t n_subgraphs, + int32_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + int32_t* source_vertex, + int32_t n_subgraphs, + int32_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int32_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/egonet_sg_v64_e64.cu b/cpp/src/community/egonet_sg_v64_e64.cu new file mode 100644 index 00000000000..412eb881399 --- /dev/null +++ b/cpp/src/community/egonet_sg_v64_e64.cu @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021-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. + */ +#include "community/egonet_impl.cuh" + +namespace cugraph { + +// SG FP32 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + int64_t* source_vertex, + int64_t n_subgraphs, + int64_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int64_t radius, + bool do_expensive_check); + +// SG FP64 + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + int64_t* source_vertex, + int64_t n_subgraphs, + int64_t radius); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_ego(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional>, + raft::device_span source_vertex, + int64_t radius, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/k_truss_sg.cu b/cpp/src/community/k_truss_sg.cu deleted file mode 100644 index dfea62182f5..00000000000 --- a/cpp/src/community/k_truss_sg.cu +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "community/k_truss_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t k, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t k, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t k, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t k, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t k, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_truss(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t k, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/community/k_truss_sg_v32_e32.cu b/cpp/src/community/k_truss_sg_v32_e32.cu new file mode 100644 index 00000000000..80160f1aae7 --- /dev/null +++ b/cpp/src/community/k_truss_sg_v32_e32.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/k_truss_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t k, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/k_truss_sg_v32_e64.cu b/cpp/src/community/k_truss_sg_v32_e64.cu new file mode 100644 index 00000000000..87a86d3f95d --- /dev/null +++ b/cpp/src/community/k_truss_sg_v32_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/k_truss_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t k, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/k_truss_sg_v64_e64.cu b/cpp/src/community/k_truss_sg_v64_e64.cu new file mode 100644 index 00000000000..5c84477c944 --- /dev/null +++ b/cpp/src/community/k_truss_sg_v64_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/k_truss_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t k, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_truss(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/leiden_mg.cu b/cpp/src/community/leiden_mg.cu deleted file mode 100644 index 63e46d02221..00000000000 --- a/cpp/src/community/leiden_mg.cu +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "community/leiden_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - double, - double); - -} // namespace cugraph diff --git a/cpp/src/community/leiden_mg_v32_e32.cu b/cpp/src/community/leiden_mg_v32_e32.cu new file mode 100644 index 00000000000..a2d64d5020e --- /dev/null +++ b/cpp/src/community/leiden_mg_v32_e32.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/leiden_mg_v32_e64.cu b/cpp/src/community/leiden_mg_v32_e64.cu new file mode 100644 index 00000000000..bce08617feb --- /dev/null +++ b/cpp/src/community/leiden_mg_v32_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/leiden_mg_v64_e64.cu b/cpp/src/community/leiden_mg_v64_e64.cu new file mode 100644 index 00000000000..4bd1ccfd94a --- /dev/null +++ b/cpp/src/community/leiden_mg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + double, + double); + +} // namespace cugraph diff --git a/cpp/src/community/leiden_sg.cu b/cpp/src/community/leiden_sg.cu deleted file mode 100644 index 85e0d9d4673..00000000000 --- a/cpp/src/community/leiden_sg.cu +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "community/leiden_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, float> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - float resolution, - float theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair>, double> leiden( - raft::handle_t const& handle, - raft::random::RngState& rng_state, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t max_level, - double resolution, - double theta); - -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair leiden(raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - float, - float); -template std::pair leiden( - raft::handle_t const&, - raft::random::RngState&, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - double, - double); - -} // namespace cugraph diff --git a/cpp/src/community/leiden_sg_v32_e32.cu b/cpp/src/community/leiden_sg_v32_e32.cu new file mode 100644 index 00000000000..86af826bf2d --- /dev/null +++ b/cpp/src/community/leiden_sg_v32_e32.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/leiden_sg_v32_e64.cu b/cpp/src/community/leiden_sg_v32_e64.cu new file mode 100644 index 00000000000..518b2c0b0e0 --- /dev/null +++ b/cpp/src/community/leiden_sg_v32_e64.cu @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/leiden_sg_v64_e64.cu b/cpp/src/community/leiden_sg_v64_e64.cu new file mode 100644 index 00000000000..a0033da74ea --- /dev/null +++ b/cpp/src/community/leiden_sg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/leiden_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::pair>, float> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + float resolution, + float theta); + +template std::pair>, double> leiden( + raft::handle_t const& handle, + raft::random::RngState& rng_state, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t max_level, + double resolution, + double theta); + +template std::pair leiden(raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + float, + float); +template std::pair leiden( + raft::handle_t const&, + raft::random::RngState&, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + double, + double); + +} // namespace cugraph diff --git a/cpp/src/community/louvain_mg.cu b/cpp/src/community/louvain_mg.cu deleted file mode 100644 index e6a609ce87c..00000000000 --- a/cpp/src/community/louvain_mg.cu +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2020-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. - */ - -#include "community/louvain_impl.cuh" - -namespace cugraph { - -// Explicit template instantations - -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); - -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - double, - double); - -} // namespace cugraph diff --git a/cpp/src/community/louvain_mg_v32_e32.cu b/cpp/src/community/louvain_mg_v32_e32.cu new file mode 100644 index 00000000000..1fd2cd534db --- /dev/null +++ b/cpp/src/community/louvain_mg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/louvain_mg_v32_e64.cu b/cpp/src/community/louvain_mg_v32_e64.cu new file mode 100644 index 00000000000..f25102af2a2 --- /dev/null +++ b/cpp/src/community/louvain_mg_v32_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/louvain_mg_v64_e64.cu b/cpp/src/community/louvain_mg_v64_e64.cu new file mode 100644 index 00000000000..3392621a4d8 --- /dev/null +++ b/cpp/src/community/louvain_mg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); + +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + double, + double); + +} // namespace cugraph diff --git a/cpp/src/community/louvain_sg.cu b/cpp/src/community/louvain_sg.cu deleted file mode 100644 index 9a775684ab3..00000000000 --- a/cpp/src/community/louvain_sg.cu +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2020-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. - */ - -#include "community/louvain_impl.cuh" - -namespace cugraph { - -// Explicit template instantations - -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, float> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - float, - float); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); -template std::pair>, double> louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - size_t, - double, - double); - -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int32_t*, - size_t, - double, - double); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - float, - float); -template std::pair louvain( - raft::handle_t const&, - std::optional>, - graph_view_t const&, - std::optional>, - int64_t*, - size_t, - double, - double); - -} // namespace cugraph diff --git a/cpp/src/community/louvain_sg_v32_e32.cu b/cpp/src/community/louvain_sg_v32_e32.cu new file mode 100644 index 00000000000..1cd3a7f1cca --- /dev/null +++ b/cpp/src/community/louvain_sg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/louvain_sg_v32_e64.cu b/cpp/src/community/louvain_sg_v32_e64.cu new file mode 100644 index 00000000000..fc972bdee61 --- /dev/null +++ b/cpp/src/community/louvain_sg_v32_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int32_t*, + size_t, + double, + double); +} // namespace cugraph diff --git a/cpp/src/community/louvain_sg_v64_e64.cu b/cpp/src/community/louvain_sg_v64_e64.cu new file mode 100644 index 00000000000..7a653e423be --- /dev/null +++ b/cpp/src/community/louvain_sg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020-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. + */ + +#include "community/louvain_impl.cuh" + +namespace cugraph { + +// Explicit template instantations + +template std::pair>, float> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + float, + float); +template std::pair>, double> louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + size_t, + double, + double); + +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + float, + float); +template std::pair louvain( + raft::handle_t const&, + std::optional>, + graph_view_t const&, + std::optional>, + int64_t*, + size_t, + double, + double); + +} // namespace cugraph diff --git a/cpp/src/community/triangle_count_mg.cu b/cpp/src/community/triangle_count_mg_v32_e32.cu similarity index 59% rename from cpp/src/community/triangle_count_mg.cu rename to cpp/src/community/triangle_count_mg_v32_e32.cu index 299f3390003..fef213cf4f3 100644 --- a/cpp/src/community/triangle_count_mg.cu +++ b/cpp/src/community/triangle_count_mg_v32_e32.cu @@ -24,16 +24,4 @@ template void triangle_count(raft::handle_t const& handle, raft::device_span counts, bool do_expensive_check); -template void triangle_count(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> vertices, - raft::device_span counts, - bool do_expensive_check); - -template void triangle_count(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> vertices, - raft::device_span counts, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/community/triangle_count_mg_v32_e64.cu b/cpp/src/community/triangle_count_mg_v32_e64.cu new file mode 100644 index 00000000000..50ccc074f63 --- /dev/null +++ b/cpp/src/community/triangle_count_mg_v32_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/triangle_count_impl.cuh" + +namespace cugraph { + +template void triangle_count(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> vertices, + raft::device_span counts, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/triangle_count_mg_v64_e64.cu b/cpp/src/community/triangle_count_mg_v64_e64.cu new file mode 100644 index 00000000000..1d518c86a68 --- /dev/null +++ b/cpp/src/community/triangle_count_mg_v64_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/triangle_count_impl.cuh" + +namespace cugraph { + +template void triangle_count(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> vertices, + raft::device_span counts, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/triangle_count_sg.cu b/cpp/src/community/triangle_count_sg_v32_e32.cu similarity index 59% rename from cpp/src/community/triangle_count_sg.cu rename to cpp/src/community/triangle_count_sg_v32_e32.cu index 481ac099c6c..c5b5750f934 100644 --- a/cpp/src/community/triangle_count_sg.cu +++ b/cpp/src/community/triangle_count_sg_v32_e32.cu @@ -24,16 +24,4 @@ template void triangle_count(raft::handle_t const& handle, raft::device_span counts, bool do_expensive_check); -template void triangle_count(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> vertices, - raft::device_span counts, - bool do_expensive_check); - -template void triangle_count(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> vertices, - raft::device_span counts, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/community/triangle_count_sg_v32_e64.cu b/cpp/src/community/triangle_count_sg_v32_e64.cu new file mode 100644 index 00000000000..6f7c3a87298 --- /dev/null +++ b/cpp/src/community/triangle_count_sg_v32_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/triangle_count_impl.cuh" + +namespace cugraph { + +template void triangle_count(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> vertices, + raft::device_span counts, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/community/triangle_count_sg_v64_e64.cu b/cpp/src/community/triangle_count_sg_v64_e64.cu new file mode 100644 index 00000000000..00842c94ba3 --- /dev/null +++ b/cpp/src/community/triangle_count_sg_v64_e64.cu @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "community/triangle_count_impl.cuh" + +namespace cugraph { + +template void triangle_count(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> vertices, + raft::device_span counts, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/components/mis_mg.cu b/cpp/src/components/mis_mg_v32_e32.cu similarity index 68% rename from cpp/src/components/mis_mg.cu rename to cpp/src/components/mis_mg_v32_e32.cu index 2418b38dd0b..b0f4ee8c155 100644 --- a/cpp/src/components/mis_mg.cu +++ b/cpp/src/components/mis_mg_v32_e32.cu @@ -21,14 +21,4 @@ template rmm::device_uvector maximal_independent_set( graph_view_t const& graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector maximal_independent_set( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector maximal_independent_set( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - } // namespace cugraph diff --git a/cpp/src/components/mis_mg_v32_e64.cu b/cpp/src/components/mis_mg_v32_e64.cu new file mode 100644 index 00000000000..793d170b433 --- /dev/null +++ b/cpp/src/components/mis_mg_v32_e64.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023-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. + */ +#include "mis_impl.cuh" +namespace cugraph { + +template rmm::device_uvector maximal_independent_set( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/mis_mg_v64_e64.cu b/cpp/src/components/mis_mg_v64_e64.cu new file mode 100644 index 00000000000..cc9c84a6ffa --- /dev/null +++ b/cpp/src/components/mis_mg_v64_e64.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2023-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. + */ +#include "mis_impl.cuh" +namespace cugraph { + +template rmm::device_uvector maximal_independent_set( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/mis_sg.cu b/cpp/src/components/mis_sg_v32_e32.cu similarity index 68% rename from cpp/src/components/mis_sg.cu rename to cpp/src/components/mis_sg_v32_e32.cu index fea4c4f2765..490e5471f0e 100644 --- a/cpp/src/components/mis_sg.cu +++ b/cpp/src/components/mis_sg_v32_e32.cu @@ -22,14 +22,4 @@ template rmm::device_uvector maximal_independent_set( graph_view_t const& graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector maximal_independent_set( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector maximal_independent_set( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - } // namespace cugraph diff --git a/cpp/src/components/mis_sg_v32_e64.cu b/cpp/src/components/mis_sg_v32_e64.cu new file mode 100644 index 00000000000..a3a29cb751b --- /dev/null +++ b/cpp/src/components/mis_sg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023-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. + */ +#include "mis_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector maximal_independent_set( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/mis_sg_v64_e64.cu b/cpp/src/components/mis_sg_v64_e64.cu new file mode 100644 index 00000000000..9be8abb75ab --- /dev/null +++ b/cpp/src/components/mis_sg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023-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. + */ +#include "mis_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector maximal_independent_set( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_mg.cu b/cpp/src/components/vertex_coloring_mg_v32_e32.cu similarity index 69% rename from cpp/src/components/vertex_coloring_mg.cu rename to cpp/src/components/vertex_coloring_mg_v32_e32.cu index 8f87e8bd534..19b36d32b84 100644 --- a/cpp/src/components/vertex_coloring_mg.cu +++ b/cpp/src/components/vertex_coloring_mg_v32_e32.cu @@ -22,14 +22,4 @@ template rmm::device_uvector vertex_coloring( graph_view_t const& graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector vertex_coloring( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector vertex_coloring( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - } // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_mg_v32_e64.cu b/cpp/src/components/vertex_coloring_mg_v32_e64.cu new file mode 100644 index 00000000000..04facb7cda8 --- /dev/null +++ b/cpp/src/components/vertex_coloring_mg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "vertex_coloring_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector vertex_coloring( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_mg_v64_e64.cu b/cpp/src/components/vertex_coloring_mg_v64_e64.cu new file mode 100644 index 00000000000..2955c5dc7f1 --- /dev/null +++ b/cpp/src/components/vertex_coloring_mg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "vertex_coloring_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector vertex_coloring( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_sg.cu b/cpp/src/components/vertex_coloring_sg_v32_e32.cu similarity index 69% rename from cpp/src/components/vertex_coloring_sg.cu rename to cpp/src/components/vertex_coloring_sg_v32_e32.cu index 427bc0b2c81..389276d9bfd 100644 --- a/cpp/src/components/vertex_coloring_sg.cu +++ b/cpp/src/components/vertex_coloring_sg_v32_e32.cu @@ -22,14 +22,4 @@ template rmm::device_uvector vertex_coloring( graph_view_t const& graph_view, raft::random::RngState& rng_state); -template rmm::device_uvector vertex_coloring( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - -template rmm::device_uvector vertex_coloring( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::random::RngState& rng_state); - } // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_sg_v32_e64.cu b/cpp/src/components/vertex_coloring_sg_v32_e64.cu new file mode 100644 index 00000000000..bf510a1f571 --- /dev/null +++ b/cpp/src/components/vertex_coloring_sg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "vertex_coloring_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector vertex_coloring( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/vertex_coloring_sg_v64_e64.cu b/cpp/src/components/vertex_coloring_sg_v64_e64.cu new file mode 100644 index 00000000000..08183db1df1 --- /dev/null +++ b/cpp/src/components/vertex_coloring_sg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * 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. + */ +#include "vertex_coloring_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector vertex_coloring( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::random::RngState& rng_state); + +} // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_mg.cu b/cpp/src/components/weakly_connected_components_mg_v32_e32.cu similarity index 70% rename from cpp/src/components/weakly_connected_components_mg.cu rename to cpp/src/components/weakly_connected_components_mg_v32_e32.cu index ba9298d7f11..a5a5a721300 100644 --- a/cpp/src/components/weakly_connected_components_mg.cu +++ b/cpp/src/components/weakly_connected_components_mg_v32_e32.cu @@ -26,16 +26,4 @@ template void weakly_connected_components( int32_t* components, bool do_expensive_check); -template void weakly_connected_components( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t* components, - bool do_expensive_check); - -template void weakly_connected_components( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* components, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_mg_v32_e64.cu b/cpp/src/components/weakly_connected_components_mg_v32_e64.cu new file mode 100644 index 00000000000..edbc8cc5eb5 --- /dev/null +++ b/cpp/src/components/weakly_connected_components_mg_v32_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "components/weakly_connected_components_impl.cuh" + +namespace cugraph { + +// MG instantiations + +template void weakly_connected_components( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t* components, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_mg_v64_e64.cu b/cpp/src/components/weakly_connected_components_mg_v64_e64.cu new file mode 100644 index 00000000000..7a8a14f5055 --- /dev/null +++ b/cpp/src/components/weakly_connected_components_mg_v64_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "components/weakly_connected_components_impl.cuh" + +namespace cugraph { + +// MG instantiations + +template void weakly_connected_components( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* components, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_sg.cu b/cpp/src/components/weakly_connected_components_sg_v32_e32.cu similarity index 70% rename from cpp/src/components/weakly_connected_components_sg.cu rename to cpp/src/components/weakly_connected_components_sg_v32_e32.cu index 3aad0e6a3a2..937552e3d15 100644 --- a/cpp/src/components/weakly_connected_components_sg.cu +++ b/cpp/src/components/weakly_connected_components_sg_v32_e32.cu @@ -26,16 +26,4 @@ template void weakly_connected_components( int32_t* components, bool do_expensive_check); -template void weakly_connected_components( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t* components, - bool do_expensive_check); - -template void weakly_connected_components( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* components, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_sg_v32_e64.cu b/cpp/src/components/weakly_connected_components_sg_v32_e64.cu new file mode 100644 index 00000000000..813d2711674 --- /dev/null +++ b/cpp/src/components/weakly_connected_components_sg_v32_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "components/weakly_connected_components_impl.cuh" + +namespace cugraph { + +// SG instantiations + +template void weakly_connected_components( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t* components, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/components/weakly_connected_components_sg_v64_e64.cu b/cpp/src/components/weakly_connected_components_sg_v64_e64.cu new file mode 100644 index 00000000000..14805864150 --- /dev/null +++ b/cpp/src/components/weakly_connected_components_sg_v64_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "components/weakly_connected_components_impl.cuh" + +namespace cugraph { + +// SG instantiations + +template void weakly_connected_components( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* components, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/core_number_mg.cu b/cpp/src/cores/core_number_mg_v32_e32.cu similarity index 58% rename from cpp/src/cores/core_number_mg.cu rename to cpp/src/cores/core_number_mg_v32_e32.cu index 662fa9f3853..e295249dceb 100644 --- a/cpp/src/cores/core_number_mg.cu +++ b/cpp/src/cores/core_number_mg_v32_e32.cu @@ -28,20 +28,4 @@ template void core_number(raft::handle_t const& handle, size_t k_last, bool do_expensive_check); -template void core_number(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* core_numbers, - k_core_degree_type_t degree_type, - size_t k_first, - size_t k_last, - bool do_expensive_check); - -template void core_number(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* core_numbers, - k_core_degree_type_t degree_type, - size_t k_first, - size_t k_last, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/cores/core_number_mg_v32_e64.cu b/cpp/src/cores/core_number_mg_v32_e64.cu new file mode 100644 index 00000000000..f41f9cd8a17 --- /dev/null +++ b/cpp/src/cores/core_number_mg_v32_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "cores/core_number_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void core_number(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* core_numbers, + k_core_degree_type_t degree_type, + size_t k_first, + size_t k_last, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/core_number_mg_v64_e64.cu b/cpp/src/cores/core_number_mg_v64_e64.cu new file mode 100644 index 00000000000..f541b48c764 --- /dev/null +++ b/cpp/src/cores/core_number_mg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "cores/core_number_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void core_number(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* core_numbers, + k_core_degree_type_t degree_type, + size_t k_first, + size_t k_last, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/core_number_sg.cu b/cpp/src/cores/core_number_sg_v32_e32.cu similarity index 58% rename from cpp/src/cores/core_number_sg.cu rename to cpp/src/cores/core_number_sg_v32_e32.cu index 94c270aa5c9..d503f0543e4 100644 --- a/cpp/src/cores/core_number_sg.cu +++ b/cpp/src/cores/core_number_sg_v32_e32.cu @@ -28,20 +28,4 @@ template void core_number(raft::handle_t const& handle, size_t k_last, bool do_expensive_check); -template void core_number(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* core_numbers, - k_core_degree_type_t degree_type, - size_t k_first, - size_t k_last, - bool do_expensive_check); - -template void core_number(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* core_numbers, - k_core_degree_type_t degree_type, - size_t k_first, - size_t k_last, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/cores/core_number_sg_v32_e64.cu b/cpp/src/cores/core_number_sg_v32_e64.cu new file mode 100644 index 00000000000..63a6d0069a3 --- /dev/null +++ b/cpp/src/cores/core_number_sg_v32_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "cores/core_number_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void core_number(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* core_numbers, + k_core_degree_type_t degree_type, + size_t k_first, + size_t k_last, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/core_number_sg_v64_e64.cu b/cpp/src/cores/core_number_sg_v64_e64.cu new file mode 100644 index 00000000000..26a7f4980a0 --- /dev/null +++ b/cpp/src/cores/core_number_sg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "cores/core_number_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void core_number(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* core_numbers, + k_core_degree_type_t degree_type, + size_t k_first, + size_t k_last, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_mg.cu b/cpp/src/cores/k_core_mg.cu deleted file mode 100644 index b797a4454cb..00000000000 --- a/cpp/src/cores/k_core_mg.cu +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "cores/k_core_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/cores/k_core_mg_v32_e32.cu b/cpp/src/cores/k_core_mg_v32_e32.cu new file mode 100644 index 00000000000..3049d84643d --- /dev/null +++ b/cpp/src/cores/k_core_mg_v32_e32.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_mg_v32_e64.cu b/cpp/src/cores/k_core_mg_v32_e64.cu new file mode 100644 index 00000000000..b2329997cb6 --- /dev/null +++ b/cpp/src/cores/k_core_mg_v32_e64.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_mg_v64_e64.cu b/cpp/src/cores/k_core_mg_v64_e64.cu new file mode 100644 index 00000000000..205f668fc0d --- /dev/null +++ b/cpp/src/cores/k_core_mg_v64_e64.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_sg.cu b/cpp/src/cores/k_core_sg.cu deleted file mode 100644 index d61c8f8d196..00000000000 --- a/cpp/src/cores/k_core_sg.cu +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "cores/k_core_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>> -k_core(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - size_t k, - std::optional degree_type, - std::optional> core_numbers, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/cores/k_core_sg_v32_e32.cu b/cpp/src/cores/k_core_sg_v32_e32.cu new file mode 100644 index 00000000000..0cec4e89ed0 --- /dev/null +++ b/cpp/src/cores/k_core_sg_v32_e32.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_sg_v32_e64.cu b/cpp/src/cores/k_core_sg_v32_e64.cu new file mode 100644 index 00000000000..642f6673168 --- /dev/null +++ b/cpp/src/cores/k_core_sg_v32_e64.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/cores/k_core_sg_v64_e64.cu b/cpp/src/cores/k_core_sg_v64_e64.cu new file mode 100644 index 00000000000..f2b0e8074b1 --- /dev/null +++ b/cpp/src/cores/k_core_sg_v64_e64.cu @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "cores/k_core_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>> +k_core(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + size_t k, + std::optional degree_type, + std::optional> core_numbers, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/detail/collect_comm_wrapper.cuh b/cpp/src/detail/collect_comm_wrapper.cuh new file mode 100644 index 00000000000..b5e6a7dbcf7 --- /dev/null +++ b/cpp/src/detail/collect_comm_wrapper.cuh @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023-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. + */ + +#pragma once + +#include "c_api/capi_helper.hpp" +#include "structure/detail/structure_utils.cuh" +#include "utilities/collect_comm.cuh" + +#include +#include + +#include +#include + +namespace cugraph { +namespace detail { + +template +rmm::device_uvector device_allgatherv(raft::handle_t const& handle, + raft::comms::comms_t const& comm, + raft::device_span d_input) +{ + auto gathered_v = cugraph::device_allgatherv(handle, comm, d_input); + + return gathered_v; +} + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_comm_wrapper_mg_v32_e32.cu b/cpp/src/detail/collect_comm_wrapper_mg_v32_e32.cu new file mode 100644 index 00000000000..89a028531c0 --- /dev/null +++ b/cpp/src/detail/collect_comm_wrapper_mg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "c_api/capi_helper.hpp" +#include "detail/collect_comm_wrapper.cuh" +#include "structure/detail/structure_utils.cuh" +#include "utilities/collect_comm.cuh" + +#include +#include + +#include +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, + raft::comms::comms_t const& comm, + raft::device_span d_input); + +template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, + raft::comms::comms_t const& comm, + raft::device_span d_input); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_comm_wrapper.cu b/cpp/src/detail/collect_comm_wrapper_mg_v64_e64.cu similarity index 63% rename from cpp/src/detail/collect_comm_wrapper.cu rename to cpp/src/detail/collect_comm_wrapper_mg_v64_e64.cu index 20bb1409a54..2eb856779a7 100644 --- a/cpp/src/detail/collect_comm_wrapper.cu +++ b/cpp/src/detail/collect_comm_wrapper_mg_v64_e64.cu @@ -15,6 +15,7 @@ */ #include "c_api/capi_helper.hpp" +#include "detail/collect_comm_wrapper.cuh" #include "structure/detail/structure_utils.cuh" #include "utilities/collect_comm.cuh" @@ -27,28 +28,10 @@ namespace cugraph { namespace detail { -template -rmm::device_uvector device_allgatherv(raft::handle_t const& handle, - raft::comms::comms_t const& comm, - raft::device_span d_input) -{ - auto gathered_v = cugraph::device_allgatherv(handle, comm, d_input); - - return gathered_v; -} - -template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, - raft::comms::comms_t const& comm, - raft::device_span d_input); - template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, raft::comms::comms_t const& comm, raft::device_span d_input); -template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, - raft::comms::comms_t const& comm, - raft::device_span d_input); - template rmm::device_uvector device_allgatherv(raft::handle_t const& handle, raft::comms::comms_t const& comm, raft::device_span d_input); diff --git a/cpp/src/detail/collect_local_vertex_values.cu b/cpp/src/detail/collect_local_vertex_values.cu deleted file mode 100644 index 2726e33b922..00000000000 --- a/cpp/src/detail/collect_local_vertex_values.cu +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ - -#include "detail/graph_partition_utils.cuh" - -#include -#include - -#include - -namespace cugraph { -namespace detail { - -template -rmm::device_uvector collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - vertex_t local_vertex_first, - vertex_t local_vertex_last, - value_t default_value, - bool do_expensive_check) -{ - rmm::device_uvector d_local_values(0, handle.get_stream()); - - if constexpr (multi_gpu) { - auto& comm = handle.get_comms(); - auto const comm_size = comm.get_size(); - auto& major_comm = handle.get_subcomm(cugraph::partition_manager::major_comm_name()); - auto const major_comm_size = major_comm.get_size(); - auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); - auto const minor_comm_size = minor_comm.get_size(); - - std::tie(d_vertices, d_values, std::ignore) = cugraph::groupby_gpu_id_and_shuffle_kv_pairs( - comm, - d_vertices.begin(), - d_vertices.end(), - d_values.begin(), - cugraph::detail::compute_gpu_id_from_ext_vertex_t{ - comm_size, major_comm_size, minor_comm_size}, - handle.get_stream()); - } - - // Now I can renumber locally - renumber_local_ext_vertices(handle, - d_vertices.data(), - d_vertices.size(), - number_map.data(), - local_vertex_first, - local_vertex_last, - do_expensive_check); - - auto vertex_iterator = thrust::make_transform_iterator( - d_vertices.begin(), - cuda::proclaim_return_type( - [local_vertex_first] __device__(vertex_t v) { return v - local_vertex_first; })); - - d_local_values.resize(local_vertex_last - local_vertex_first, handle.get_stream()); - thrust::fill( - handle.get_thrust_policy(), d_local_values.begin(), d_local_values.end(), default_value); - - thrust::scatter(handle.get_thrust_policy(), - d_values.begin(), - d_values.end(), - vertex_iterator, - d_local_values.begin()); - - return d_local_values; -} - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - float default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - float default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - double default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - double default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - float default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - float default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - double default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - double default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - int32_t default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - int64_t default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - int64_t default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - int32_t default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int32_t local_vertex_first, - int32_t local_vertex_last, - int64_t default_value, - bool do_expensive_check); - -template rmm::device_uvector -collect_local_vertex_values_from_ext_vertex_value_pairs( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - rmm::device_uvector const& number_map, - int64_t local_vertex_first, - int64_t local_vertex_last, - int64_t default_value, - bool do_expensive_check); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values.cuh b/cpp/src/detail/collect_local_vertex_values.cuh new file mode 100644 index 00000000000..0ccea7dfe16 --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values.cuh @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2021-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. + */ + +#pragma once + +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template +rmm::device_uvector collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + vertex_t local_vertex_first, + vertex_t local_vertex_last, + value_t default_value, + bool do_expensive_check) +{ + rmm::device_uvector d_local_values(0, handle.get_stream()); + + if constexpr (multi_gpu) { + auto& comm = handle.get_comms(); + auto const comm_size = comm.get_size(); + auto& major_comm = handle.get_subcomm(cugraph::partition_manager::major_comm_name()); + auto const major_comm_size = major_comm.get_size(); + auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); + auto const minor_comm_size = minor_comm.get_size(); + + std::tie(d_vertices, d_values, std::ignore) = cugraph::groupby_gpu_id_and_shuffle_kv_pairs( + comm, + d_vertices.begin(), + d_vertices.end(), + d_values.begin(), + cugraph::detail::compute_gpu_id_from_ext_vertex_t{ + comm_size, major_comm_size, minor_comm_size}, + handle.get_stream()); + } + + // Now I can renumber locally + renumber_local_ext_vertices(handle, + d_vertices.data(), + d_vertices.size(), + number_map.data(), + local_vertex_first, + local_vertex_last, + do_expensive_check); + + auto vertex_iterator = thrust::make_transform_iterator( + d_vertices.begin(), + cuda::proclaim_return_type( + [local_vertex_first] __device__(vertex_t v) { return v - local_vertex_first; })); + + d_local_values.resize(local_vertex_last - local_vertex_first, handle.get_stream()); + thrust::fill( + handle.get_thrust_policy(), d_local_values.begin(), d_local_values.end(), default_value); + + thrust::scatter(handle.get_thrust_policy(), + d_values.begin(), + d_values.end(), + vertex_iterator, + d_local_values.begin()); + + return d_local_values; +} + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_mg_v32_e32.cu b/cpp/src/detail/collect_local_vertex_values_mg_v32_e32.cu new file mode 100644 index 00000000000..3b6059a0ce8 --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_mg_v32_e32.cu @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + float default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + int32_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_mg_v32_e64.cu b/cpp/src/detail/collect_local_vertex_values_mg_v32_e64.cu new file mode 100644 index 00000000000..e33b6fe7a68 --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_mg_v32_e64.cu @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + double default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + int64_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_mg_v64_e64.cu b/cpp/src/detail/collect_local_vertex_values_mg_v64_e64.cu new file mode 100644 index 00000000000..fa1c969939e --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_mg_v64_e64.cu @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + float default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + double default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + int64_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_sg_v32_e32.cu b/cpp/src/detail/collect_local_vertex_values_sg_v32_e32.cu new file mode 100644 index 00000000000..c544d009aef --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_sg_v32_e32.cu @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + float default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + int32_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_sg_v32_e64.cu b/cpp/src/detail/collect_local_vertex_values_sg_v32_e64.cu new file mode 100644 index 00000000000..99817a70e61 --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_sg_v32_e64.cu @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + double default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int32_t local_vertex_first, + int32_t local_vertex_last, + int64_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/collect_local_vertex_values_sg_v64_e64.cu b/cpp/src/detail/collect_local_vertex_values_sg_v64_e64.cu new file mode 100644 index 00000000000..8f65c6d7f0d --- /dev/null +++ b/cpp/src/detail/collect_local_vertex_values_sg_v64_e64.cu @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/collect_local_vertex_values.cuh" +#include "detail/graph_partition_utils.cuh" + +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + float default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + double default_value, + bool do_expensive_check); + +template rmm::device_uvector +collect_local_vertex_values_from_ext_vertex_value_pairs( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + rmm::device_uvector const& number_map, + int64_t local_vertex_first, + int64_t local_vertex_last, + int64_t default_value, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/groupby_and_count.cu b/cpp/src/detail/groupby_and_count.cuh similarity index 81% rename from cpp/src/detail/groupby_and_count.cu rename to cpp/src/detail/groupby_and_count.cuh index 81557153e9c..a452bcaeea2 100644 --- a/cpp/src/detail/groupby_and_count.cu +++ b/cpp/src/detail/groupby_and_count.cuh @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#pragma once #include "detail/graph_partition_utils.cuh" #include @@ -263,59 +265,5 @@ rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( return result; } -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - -template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( - raft::handle_t const& handle, - rmm::device_uvector& d_edgelist_majors, - rmm::device_uvector& d_edgelist_minors, - std::optional>& d_edgelist_weights, - std::optional>& d_edgelist_edge_ids, - std::optional>& d_edgelist_edge_types, - bool groupby_and_counts_local_partition); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/detail/groupby_and_count_mg_v32_e32.cu b/cpp/src/detail/groupby_and_count_mg_v32_e32.cu new file mode 100644 index 00000000000..9f07585c202 --- /dev/null +++ b/cpp/src/detail/groupby_and_count_mg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021-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. + */ +#include "detail/graph_partition_utils.cuh" +#include "detail/groupby_and_count.cuh" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/groupby_and_count_mg_v32_e64.cu b/cpp/src/detail/groupby_and_count_mg_v32_e64.cu new file mode 100644 index 00000000000..ec9cbc89aa2 --- /dev/null +++ b/cpp/src/detail/groupby_and_count_mg_v32_e64.cu @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021-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. + */ +#include "detail/graph_partition_utils.cuh" +#include "detail/groupby_and_count.cuh" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +namespace cugraph { +namespace detail { +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/groupby_and_count_mg_v64_e64.cu b/cpp/src/detail/groupby_and_count_mg_v64_e64.cu new file mode 100644 index 00000000000..edbb14346cf --- /dev/null +++ b/cpp/src/detail/groupby_and_count_mg_v64_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021-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. + */ +#include "detail/graph_partition_utils.cuh" +#include "detail/groupby_and_count.cuh" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include + +namespace cugraph { +namespace detail { + +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +template rmm::device_uvector groupby_and_count_edgelist_by_local_partition_id( + raft::handle_t const& handle, + rmm::device_uvector& d_edgelist_majors, + rmm::device_uvector& d_edgelist_minors, + std::optional>& d_edgelist_weights, + std::optional>& d_edgelist_edge_ids, + std::optional>& d_edgelist_edge_types, + bool groupby_and_counts_local_partition); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/permute_range.cu b/cpp/src/detail/permute_range.cuh similarity index 88% rename from cpp/src/detail/permute_range.cu rename to cpp/src/detail/permute_range.cuh index cc77f022616..c7cd57c2048 100644 --- a/cpp/src/detail/permute_range.cu +++ b/cpp/src/detail/permute_range.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include #include #include @@ -169,19 +171,5 @@ rmm::device_uvector permute_range(raft::handle_t const& handle, return permuted_integers; } -template rmm::device_uvector permute_range(raft::handle_t const& handle, - raft::random::RngState& rng_state, - int32_t local_range_start, - int32_t local_range_size, - bool multi_gpu, - bool do_expensive_check); - -template rmm::device_uvector permute_range(raft::handle_t const& handle, - raft::random::RngState& rng_state, - int64_t local_range_start, - int64_t local_range_size, - bool multi_gpu, - bool do_expensive_check); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/detail/permute_range_v32.cu b/cpp/src/detail/permute_range_v32.cu new file mode 100644 index 00000000000..6a7bc059901 --- /dev/null +++ b/cpp/src/detail/permute_range_v32.cu @@ -0,0 +1,48 @@ +/* + * 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. + */ + +#include "detail/permute_range.cuh" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +namespace cugraph { + +namespace detail { + +template rmm::device_uvector permute_range(raft::handle_t const& handle, + raft::random::RngState& rng_state, + int32_t local_range_start, + int32_t local_range_size, + bool multi_gpu, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/permute_range_v64.cu b/cpp/src/detail/permute_range_v64.cu new file mode 100644 index 00000000000..ad7daf16419 --- /dev/null +++ b/cpp/src/detail/permute_range_v64.cu @@ -0,0 +1,48 @@ +/* + * 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. + */ + +#include "detail/permute_range.cuh" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +namespace cugraph { + +namespace detail { + +template rmm::device_uvector permute_range(raft::handle_t const& handle, + raft::random::RngState& rng_state, + int64_t local_range_start, + int64_t local_range_size, + bool multi_gpu, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/utility_wrappers.cu b/cpp/src/detail/utility_wrappers.cu deleted file mode 100644 index 6d6158a16e7..00000000000 --- a/cpp/src/detail/utility_wrappers.cu +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace cugraph { -namespace detail { - -template -void uniform_random_fill(rmm::cuda_stream_view const& stream_view, - value_t* d_value, - size_t size, - value_t min_value, - value_t max_value, - raft::random::RngState& rng_state) -{ - if constexpr (std::is_integral::value) { - raft::random::uniformInt( - rng_state, d_value, size, min_value, max_value, stream_view.value()); - } else { - raft::random::uniform( - rng_state, d_value, size, min_value, max_value, stream_view.value()); - } -} - -template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, - int32_t* d_value, - size_t size, - int32_t min_value, - int32_t max_value, - raft::random::RngState& rng_state); - -template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, - int64_t* d_value, - size_t size, - int64_t min_value, - int64_t max_value, - raft::random::RngState& rng_state); - -template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, - float* d_value, - size_t size, - float min_value, - float max_value, - raft::random::RngState& rng_state); - -template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, - double* d_value, - size_t size, - double min_value, - double max_value, - raft::random::RngState& rng_state); - -template -void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, value_t value) -{ - thrust::fill_n(handle.get_thrust_policy(), d_value, size, value); -} - -template void scalar_fill(raft::handle_t const& handle, - int32_t* d_value, - size_t size, - int32_t value); - -template void scalar_fill(raft::handle_t const& handle, - int64_t* d_value, - size_t size, - int64_t value); - -template void scalar_fill(raft::handle_t const& handle, size_t* d_value, size_t size, size_t value); - -template void scalar_fill(raft::handle_t const& handle, float* d_value, size_t size, float value); - -template void scalar_fill(raft::handle_t const& handle, double* d_value, size_t size, double value); - -template -void sequence_fill(rmm::cuda_stream_view const& stream_view, - value_t* d_value, - size_t size, - value_t start_value) -{ - thrust::sequence(rmm::exec_policy(stream_view), d_value, d_value + size, start_value); -} - -template void sequence_fill(rmm::cuda_stream_view const& stream_view, - int32_t* d_value, - size_t size, - int32_t start_value); - -template void sequence_fill(rmm::cuda_stream_view const& stream_view, - int64_t* d_value, - size_t size, - int64_t start_value); - -template void sequence_fill(rmm::cuda_stream_view const& stream_view, - uint64_t* d_value, - size_t size, - uint64_t start_value); - -template -vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, - vertex_t const* d_edgelist_srcs, - vertex_t const* d_edgelist_dsts, - size_t num_edges) -{ - auto edge_first = thrust::make_zip_iterator(thrust::make_tuple(d_edgelist_srcs, d_edgelist_dsts)); - - return thrust::transform_reduce( - rmm::exec_policy(stream_view), - edge_first, - edge_first + num_edges, - cuda::proclaim_return_type( - [] __device__(auto e) -> vertex_t { return std::max(thrust::get<0>(e), thrust::get<1>(e)); }), - vertex_t{0}, - thrust::maximum()); -} - -template int32_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, - int32_t const* d_edgelist_srcs, - int32_t const* d_edgelist_dsts, - size_t num_edges); - -template int64_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, - int64_t const* d_edgelist_srcs, - int64_t const* d_edgelist_dsts, - size_t num_edges); - -template -std::tuple, rmm::device_uvector> filter_degree_0_vertices( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_out_degs) -{ - auto zip_iter = - thrust::make_zip_iterator(thrust::make_tuple(d_vertices.begin(), d_out_degs.begin())); - - CUGRAPH_EXPECTS(d_vertices.size() < static_cast(std::numeric_limits::max()), - "remove_if will fail, d_vertices.size() is too large"); - - // FIXME: remove_if has a 32-bit overflow issue (https://github.com/NVIDIA/thrust/issues/1302) - // Seems unlikely here so not going to work around this for now. - auto zip_iter_end = - thrust::remove_if(handle.get_thrust_policy(), - zip_iter, - zip_iter + d_vertices.size(), - zip_iter, - [] __device__(auto pair) { return thrust::get<1>(pair) == 0; }); - - auto new_size = thrust::distance(zip_iter, zip_iter_end); - d_vertices.resize(new_size, handle.get_stream()); - d_out_degs.resize(new_size, handle.get_stream()); - - return std::make_tuple(std::move(d_vertices), std::move(d_out_degs)); -} - -template std::tuple, rmm::device_uvector> -filter_degree_0_vertices(raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_out_degs); - -template std::tuple, rmm::device_uvector> -filter_degree_0_vertices(raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_out_degs); - -template std::tuple, rmm::device_uvector> -filter_degree_0_vertices(raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_out_degs); - -template -bool is_sorted(raft::handle_t const& handle, raft::device_span span) -{ - return thrust::is_sorted(handle.get_thrust_policy(), span.begin(), span.end()); -} - -template bool is_sorted(raft::handle_t const& handle, raft::device_span span); -template bool is_sorted(raft::handle_t const& handle, raft::device_span span); -template bool is_sorted(raft::handle_t const& handle, raft::device_span span); -template bool is_sorted(raft::handle_t const& handle, raft::device_span span); - -template -bool is_equal(raft::handle_t const& handle, - raft::device_span span1, - raft::device_span span2) -{ - return thrust::equal(handle.get_thrust_policy(), span1.begin(), span1.end(), span2.begin()); -} - -template bool is_equal(raft::handle_t const& handle, - raft::device_span span1, - raft::device_span span2); -template bool is_equal(raft::handle_t const& handle, - raft::device_span span1, - raft::device_span span2); -template bool is_equal(raft::handle_t const& handle, - raft::device_span span1, - raft::device_span span2); -template bool is_equal(raft::handle_t const& handle, - raft::device_span span1, - raft::device_span span2); - -template -size_t count_values(raft::handle_t const& handle, - raft::device_span span, - data_t value) -{ - return thrust::count(handle.get_thrust_policy(), span.begin(), span.end(), value); -} - -template size_t count_values(raft::handle_t const& handle, - raft::device_span span, - int32_t value); -template size_t count_values(raft::handle_t const& handle, - raft::device_span span, - int64_t value); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/detail/utility_wrappers.cuh b/cpp/src/detail/utility_wrappers.cuh new file mode 100644 index 00000000000..ce8549db9f8 --- /dev/null +++ b/cpp/src/detail/utility_wrappers.cuh @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2021-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. + */ + +#pragma once + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cugraph { +namespace detail { + +template +void uniform_random_fill(rmm::cuda_stream_view const& stream_view, + value_t* d_value, + size_t size, + value_t min_value, + value_t max_value, + raft::random::RngState& rng_state) +{ + if constexpr (std::is_integral::value) { + raft::random::uniformInt( + rng_state, d_value, size, min_value, max_value, stream_view.value()); + } else { + raft::random::uniform( + rng_state, d_value, size, min_value, max_value, stream_view.value()); + } +} + +template +void scalar_fill(raft::handle_t const& handle, value_t* d_value, size_t size, value_t value) +{ + thrust::fill_n(handle.get_thrust_policy(), d_value, size, value); +} + +template +void sequence_fill(rmm::cuda_stream_view const& stream_view, + value_t* d_value, + size_t size, + value_t start_value) +{ + thrust::sequence(rmm::exec_policy(stream_view), d_value, d_value + size, start_value); +} + +template +vertex_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, + vertex_t const* d_edgelist_srcs, + vertex_t const* d_edgelist_dsts, + size_t num_edges) +{ + auto edge_first = thrust::make_zip_iterator(thrust::make_tuple(d_edgelist_srcs, d_edgelist_dsts)); + + return thrust::transform_reduce( + rmm::exec_policy(stream_view), + edge_first, + edge_first + num_edges, + cuda::proclaim_return_type( + [] __device__(auto e) -> vertex_t { return std::max(thrust::get<0>(e), thrust::get<1>(e)); }), + vertex_t{0}, + thrust::maximum()); +} + +template +std::tuple, rmm::device_uvector> filter_degree_0_vertices( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_out_degs) +{ + auto zip_iter = + thrust::make_zip_iterator(thrust::make_tuple(d_vertices.begin(), d_out_degs.begin())); + + CUGRAPH_EXPECTS(d_vertices.size() < static_cast(std::numeric_limits::max()), + "remove_if will fail, d_vertices.size() is too large"); + + // FIXME: remove_if has a 32-bit overflow issue (https://github.com/NVIDIA/thrust/issues/1302) + // Seems unlikely here so not going to work around this for now. + auto zip_iter_end = + thrust::remove_if(handle.get_thrust_policy(), + zip_iter, + zip_iter + d_vertices.size(), + zip_iter, + [] __device__(auto pair) { return thrust::get<1>(pair) == 0; }); + + auto new_size = thrust::distance(zip_iter, zip_iter_end); + d_vertices.resize(new_size, handle.get_stream()); + d_out_degs.resize(new_size, handle.get_stream()); + + return std::make_tuple(std::move(d_vertices), std::move(d_out_degs)); +} + +template +bool is_sorted(raft::handle_t const& handle, raft::device_span span) +{ + return thrust::is_sorted(handle.get_thrust_policy(), span.begin(), span.end()); +} + +template +bool is_equal(raft::handle_t const& handle, + raft::device_span span1, + raft::device_span span2) +{ + return thrust::equal(handle.get_thrust_policy(), span1.begin(), span1.end(), span2.begin()); +} + +template +size_t count_values(raft::handle_t const& handle, + raft::device_span span, + data_t value) +{ + return thrust::count(handle.get_thrust_policy(), span.begin(), span.end(), value); +} + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/utility_wrappers_32.cu b/cpp/src/detail/utility_wrappers_32.cu new file mode 100644 index 00000000000..6ab5ae375ca --- /dev/null +++ b/cpp/src/detail/utility_wrappers_32.cu @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/utility_wrappers.cuh" + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cugraph { +namespace detail { + +template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, + int32_t* d_value, + size_t size, + int32_t min_value, + int32_t max_value, + raft::random::RngState& rng_state); + +template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, + float* d_value, + size_t size, + float min_value, + float max_value, + raft::random::RngState& rng_state); + +template void scalar_fill(raft::handle_t const& handle, + int32_t* d_value, + size_t size, + int32_t value); + +template void scalar_fill(raft::handle_t const& handle, size_t* d_value, size_t size, size_t value); + +template void scalar_fill(raft::handle_t const& handle, float* d_value, size_t size, float value); + +template void sequence_fill(rmm::cuda_stream_view const& stream_view, + int32_t* d_value, + size_t size, + int32_t start_value); + +template int32_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, + int32_t const* d_edgelist_srcs, + int32_t const* d_edgelist_dsts, + size_t num_edges); + +template std::tuple, rmm::device_uvector> +filter_degree_0_vertices(raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_out_degs); + +template bool is_sorted(raft::handle_t const& handle, raft::device_span span); +template bool is_sorted(raft::handle_t const& handle, raft::device_span span); + +template bool is_equal(raft::handle_t const& handle, + raft::device_span span1, + raft::device_span span2); +template bool is_equal(raft::handle_t const& handle, + raft::device_span span1, + raft::device_span span2); + +template size_t count_values(raft::handle_t const& handle, + raft::device_span span, + int32_t value); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/detail/utility_wrappers_64.cu b/cpp/src/detail/utility_wrappers_64.cu new file mode 100644 index 00000000000..a12bc3e952d --- /dev/null +++ b/cpp/src/detail/utility_wrappers_64.cu @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/utility_wrappers.cuh" + +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cugraph { +namespace detail { + +template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, + int64_t* d_value, + size_t size, + int64_t min_value, + int64_t max_value, + raft::random::RngState& rng_state); + +template void uniform_random_fill(rmm::cuda_stream_view const& stream_view, + double* d_value, + size_t size, + double min_value, + double max_value, + raft::random::RngState& rng_state); + +template void scalar_fill(raft::handle_t const& handle, + int64_t* d_value, + size_t size, + int64_t value); + +template void scalar_fill(raft::handle_t const& handle, double* d_value, size_t size, double value); + +template void sequence_fill(rmm::cuda_stream_view const& stream_view, + int64_t* d_value, + size_t size, + int64_t start_value); + +template void sequence_fill(rmm::cuda_stream_view const& stream_view, + uint64_t* d_value, + size_t size, + uint64_t start_value); + +template int64_t compute_maximum_vertex_id(rmm::cuda_stream_view const& stream_view, + int64_t const* d_edgelist_srcs, + int64_t const* d_edgelist_dsts, + size_t num_edges); + +template std::tuple, rmm::device_uvector> +filter_degree_0_vertices(raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_out_degs); + +template std::tuple, rmm::device_uvector> +filter_degree_0_vertices(raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_out_degs); + +template bool is_sorted(raft::handle_t const& handle, raft::device_span span); +template bool is_sorted(raft::handle_t const& handle, raft::device_span span); + +template bool is_equal(raft::handle_t const& handle, + raft::device_span span1, + raft::device_span span2); +template bool is_equal(raft::handle_t const& handle, + raft::device_span span1, + raft::device_span span2); + +template size_t count_values(raft::handle_t const& handle, + raft::device_span span, + int64_t value); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/generators/erdos_renyi_generator.cu b/cpp/src/generators/erdos_renyi_generator.cuh similarity index 71% rename from cpp/src/generators/erdos_renyi_generator.cu rename to cpp/src/generators/erdos_renyi_generator.cuh index 97b944b0a55..cd461ee1aa2 100644 --- a/cpp/src/generators/erdos_renyi_generator.cu +++ b/cpp/src/generators/erdos_renyi_generator.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include #include @@ -88,32 +90,4 @@ generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, CUGRAPH_FAIL("Not implemented"); } -template std::tuple, rmm::device_uvector> -generate_erdos_renyi_graph_edgelist_gnp(raft::handle_t const& handle, - int32_t num_vertices, - float p, - int32_t base_vertex_id, - uint64_t seed); - -template std::tuple, rmm::device_uvector> -generate_erdos_renyi_graph_edgelist_gnp(raft::handle_t const& handle, - int64_t num_vertices, - float p, - int64_t base_vertex_id, - uint64_t seed); - -template std::tuple, rmm::device_uvector> -generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, - int32_t num_vertices, - size_t m, - int32_t base_vertex_id, - uint64_t seed); - -template std::tuple, rmm::device_uvector> -generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, - int64_t num_vertices, - size_t m, - int64_t base_vertex_id, - uint64_t seed); - } // namespace cugraph diff --git a/cpp/src/generators/erdos_renyi_generator_sg_v32_e32.cu b/cpp/src/generators/erdos_renyi_generator_sg_v32_e32.cu new file mode 100644 index 00000000000..1776bcc30d9 --- /dev/null +++ b/cpp/src/generators/erdos_renyi_generator_sg_v32_e32.cu @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/erdos_renyi_generator.cuh" + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_erdos_renyi_graph_edgelist_gnp(raft::handle_t const& handle, + int32_t num_vertices, + float p, + int32_t base_vertex_id, + uint64_t seed); + +template std::tuple, rmm::device_uvector> +generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, + int32_t num_vertices, + size_t m, + int32_t base_vertex_id, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/generators/erdos_renyi_generator_sg_v64_e64.cu b/cpp/src/generators/erdos_renyi_generator_sg_v64_e64.cu new file mode 100644 index 00000000000..8ce8c3259cb --- /dev/null +++ b/cpp/src/generators/erdos_renyi_generator_sg_v64_e64.cu @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/erdos_renyi_generator.cuh" + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_erdos_renyi_graph_edgelist_gnp(raft::handle_t const& handle, + int64_t num_vertices, + float p, + int64_t base_vertex_id, + uint64_t seed); + +template std::tuple, rmm::device_uvector> +generate_erdos_renyi_graph_edgelist_gnm(raft::handle_t const& handle, + int64_t num_vertices, + size_t m, + int64_t base_vertex_id, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/generators/generate_bipartite_rmat_edgelist.cu b/cpp/src/generators/generate_bipartite_rmat_edgelist.cuh similarity index 81% rename from cpp/src/generators/generate_bipartite_rmat_edgelist.cu rename to cpp/src/generators/generate_bipartite_rmat_edgelist.cuh index bb284b588a5..dc70cde6b7d 100644 --- a/cpp/src/generators/generate_bipartite_rmat_edgelist.cu +++ b/cpp/src/generators/generate_bipartite_rmat_edgelist.cuh @@ -14,6 +14,7 @@ * limitations under the License. */ +#pragma once #include #include #include @@ -118,24 +119,4 @@ generate_bipartite_rmat_edgelist(raft::handle_t const& handle, return std::make_tuple(std::move(srcs), std::move(dsts)); } -template std::tuple, rmm::device_uvector> -generate_bipartite_rmat_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t src_scale, - size_t dst_scale, - size_t num_edges, - double a, - double b, - double c); - -template std::tuple, rmm::device_uvector> -generate_bipartite_rmat_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t src_scale, - size_t dst_scale, - size_t num_edges, - double a, - double b, - double c); - } // namespace cugraph diff --git a/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v32_e32.cu b/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v32_e32.cu new file mode 100644 index 00000000000..5b7d1a71201 --- /dev/null +++ b/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v32_e32.cu @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "generate_bipartite_rmat_edgelist.cuh" + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_bipartite_rmat_edgelist(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t src_scale, + size_t dst_scale, + size_t num_edges, + double a, + double b, + double c); + +} // namespace cugraph diff --git a/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v64_e64.cu b/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..efed98cd0da --- /dev/null +++ b/cpp/src/generators/generate_bipartite_rmat_edgelist_sg_v64_e64.cu @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "generate_bipartite_rmat_edgelist.cuh" + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_bipartite_rmat_edgelist(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t src_scale, + size_t dst_scale, + size_t num_edges, + double a, + double b, + double c); + +} // namespace cugraph diff --git a/cpp/src/generators/generate_rmat_edgelist.cu b/cpp/src/generators/generate_rmat_edgelist.cuh similarity index 65% rename from cpp/src/generators/generate_rmat_edgelist.cu rename to cpp/src/generators/generate_rmat_edgelist.cuh index 82f992a8fcd..dd6e30330cc 100644 --- a/cpp/src/generators/generate_rmat_edgelist.cu +++ b/cpp/src/generators/generate_rmat_edgelist.cuh @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +#pragma once #include #include #include @@ -228,97 +228,4 @@ generate_rmat_edgelists(raft::handle_t const& handle, scramble_vertex_ids); } -template std::tuple, rmm::device_uvector> -generate_rmat_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t scale, - size_t num_edges, - double a, - double b, - double c, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::tuple, rmm::device_uvector> -generate_rmat_edgelist(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t scale, - size_t num_edges, - double a, - double b, - double c, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::vector, rmm::device_uvector>> -generate_rmat_edgelists(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t n_edgelists, - size_t min_scale, - size_t max_scale, - size_t edge_factor, - generator_distribution_t size_distribution, - generator_distribution_t edge_distribution, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::vector, rmm::device_uvector>> -generate_rmat_edgelists(raft::handle_t const& handle, - raft::random::RngState& rng_state, - size_t n_edgelists, - size_t min_scale, - size_t max_scale, - size_t edge_factor, - generator_distribution_t size_distribution, - generator_distribution_t edge_distribution, - bool clip_and_flip, - bool scramble_vertex_ids); - -/* DEPRECATED */ -template std::tuple, rmm::device_uvector> -generate_rmat_edgelist(raft::handle_t const& handle, - size_t scale, - size_t num_edges, - double a, - double b, - double c, - uint64_t seed, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::tuple, rmm::device_uvector> -generate_rmat_edgelist(raft::handle_t const& handle, - size_t scale, - size_t num_edges, - double a, - double b, - double c, - uint64_t seed, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::vector, rmm::device_uvector>> -generate_rmat_edgelists(raft::handle_t const& handle, - size_t n_edgelists, - size_t min_scale, - size_t max_scale, - size_t edge_factor, - generator_distribution_t size_distribution, - generator_distribution_t edge_distribution, - uint64_t seed, - bool clip_and_flip, - bool scramble_vertex_ids); - -template std::vector, rmm::device_uvector>> -generate_rmat_edgelists(raft::handle_t const& handle, - size_t n_edgelists, - size_t min_scale, - size_t max_scale, - size_t edge_factor, - generator_distribution_t size_distribution, - generator_distribution_t edge_distribution, - uint64_t seed, - bool clip_and_flip, - bool scramble_vertex_ids); - } // namespace cugraph diff --git a/cpp/src/generators/generate_rmat_edgelist_sg_v32_e32.cu b/cpp/src/generators/generate_rmat_edgelist_sg_v32_e32.cu new file mode 100644 index 00000000000..3ccf278ba16 --- /dev/null +++ b/cpp/src/generators/generate_rmat_edgelist_sg_v32_e32.cu @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generate_rmat_edgelist.cuh" + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_rmat_edgelist(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t scale, + size_t num_edges, + double a, + double b, + double c, + bool clip_and_flip, + bool scramble_vertex_ids); + +template std::vector, rmm::device_uvector>> +generate_rmat_edgelists(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t n_edgelists, + size_t min_scale, + size_t max_scale, + size_t edge_factor, + generator_distribution_t size_distribution, + generator_distribution_t edge_distribution, + bool clip_and_flip, + bool scramble_vertex_ids); + +/* DEPRECATED */ +template std::tuple, rmm::device_uvector> +generate_rmat_edgelist(raft::handle_t const& handle, + size_t scale, + size_t num_edges, + double a, + double b, + double c, + uint64_t seed, + bool clip_and_flip, + bool scramble_vertex_ids); + +template std::vector, rmm::device_uvector>> +generate_rmat_edgelists(raft::handle_t const& handle, + size_t n_edgelists, + size_t min_scale, + size_t max_scale, + size_t edge_factor, + generator_distribution_t size_distribution, + generator_distribution_t edge_distribution, + uint64_t seed, + bool clip_and_flip, + bool scramble_vertex_ids); + +} // namespace cugraph diff --git a/cpp/src/generators/generate_rmat_edgelist_sg_v64_e64.cu b/cpp/src/generators/generate_rmat_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..b71953f99c2 --- /dev/null +++ b/cpp/src/generators/generate_rmat_edgelist_sg_v64_e64.cu @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generate_rmat_edgelist.cuh" + +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_rmat_edgelist(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t scale, + size_t num_edges, + double a, + double b, + double c, + bool clip_and_flip, + bool scramble_vertex_ids); + +template std::vector, rmm::device_uvector>> +generate_rmat_edgelists(raft::handle_t const& handle, + raft::random::RngState& rng_state, + size_t n_edgelists, + size_t min_scale, + size_t max_scale, + size_t edge_factor, + generator_distribution_t size_distribution, + generator_distribution_t edge_distribution, + bool clip_and_flip, + bool scramble_vertex_ids); + +template std::tuple, rmm::device_uvector> +generate_rmat_edgelist(raft::handle_t const& handle, + size_t scale, + size_t num_edges, + double a, + double b, + double c, + uint64_t seed, + bool clip_and_flip, + bool scramble_vertex_ids); + +template std::vector, rmm::device_uvector>> +generate_rmat_edgelists(raft::handle_t const& handle, + size_t n_edgelists, + size_t min_scale, + size_t max_scale, + size_t edge_factor, + generator_distribution_t size_distribution, + generator_distribution_t edge_distribution, + uint64_t seed, + bool clip_and_flip, + bool scramble_vertex_ids); + +} // namespace cugraph diff --git a/cpp/src/generators/generator_tools.cu b/cpp/src/generators/generator_tools.cuh similarity index 68% rename from cpp/src/generators/generator_tools.cu rename to cpp/src/generators/generator_tools.cuh index f2ca48c4c43..62b880c0fad 100644 --- a/cpp/src/generators/generator_tools.cu +++ b/cpp/src/generators/generator_tools.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include "generators/scramble.cuh" #include @@ -258,100 +260,4 @@ symmetrize_edgelist_from_triangular( optional_d_weights_v ? std::move(optional_d_weights_v) : std::nullopt); } -template rmm::device_uvector scramble_vertex_ids(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - size_t lgN); - -template rmm::device_uvector scramble_vertex_ids(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - size_t lgN); - -template std::tuple, rmm::device_uvector> scramble_vertex_ids( - raft::handle_t const& handle, - rmm::device_uvector&& srcs, - rmm::device_uvector&& dsts, - size_t lgN); - -template std::tuple, rmm::device_uvector> scramble_vertex_ids( - raft::handle_t const& handle, - rmm::device_uvector&& srcs, - rmm::device_uvector&& dsts, - size_t lgN); - -template std::tuple, - rmm::device_uvector, - std::optional>> -combine_edgelists(raft::handle_t const& handle, - std::vector>&& sources, - std::vector>&& dests, - std::optional>>&& optional_d_weights, - bool remove_multi_edges); - -template std::tuple, - rmm::device_uvector, - std::optional>> -combine_edgelists(raft::handle_t const& handle, - std::vector>&& sources, - std::vector>&& dests, - std::optional>>&& optional_d_weights, - bool remove_multi_edges); - -template std::tuple, - rmm::device_uvector, - std::optional>> -combine_edgelists(raft::handle_t const& handle, - std::vector>&& sources, - std::vector>&& dests, - std::optional>>&& optional_d_weights, - bool remove_multi_edges); - -template std::tuple, - rmm::device_uvector, - std::optional>> -combine_edgelists(raft::handle_t const& handle, - std::vector>&& sources, - std::vector>&& dests, - std::optional>>&& optional_d_weights, - bool remove_multi_edges); - -template std::tuple, - rmm::device_uvector, - std::optional>> -symmetrize_edgelist_from_triangular( - raft::handle_t const& handle, - rmm::device_uvector&& d_src_v, - rmm::device_uvector&& d_dst_v, - std::optional>&& optional_d_weights_v, - bool check_diagonal); - -template std::tuple, - rmm::device_uvector, - std::optional>> -symmetrize_edgelist_from_triangular( - raft::handle_t const& handle, - rmm::device_uvector&& d_src_v, - rmm::device_uvector&& d_dst_v, - std::optional>&& optional_d_weights_v, - bool check_diagonal); - -template std::tuple, - rmm::device_uvector, - std::optional>> -symmetrize_edgelist_from_triangular( - raft::handle_t const& handle, - rmm::device_uvector&& d_src_v, - rmm::device_uvector&& d_dst_v, - std::optional>&& optional_d_weights_v, - bool check_diagonal); - -template std::tuple, - rmm::device_uvector, - std::optional>> -symmetrize_edgelist_from_triangular( - raft::handle_t const& handle, - rmm::device_uvector&& d_src_v, - rmm::device_uvector&& d_dst_v, - std::optional>&& optional_d_weights_v, - bool check_diagonal); - } // namespace cugraph diff --git a/cpp/src/generators/generator_tools_sg_v32_e32.cu b/cpp/src/generators/generator_tools_sg_v32_e32.cu new file mode 100644 index 00000000000..626475998c5 --- /dev/null +++ b/cpp/src/generators/generator_tools_sg_v32_e32.cu @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/generator_tools.cuh" +#include "generators/scramble.cuh" + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace cugraph { + +template rmm::device_uvector scramble_vertex_ids(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + size_t lgN); + +template std::tuple, rmm::device_uvector> scramble_vertex_ids( + raft::handle_t const& handle, + rmm::device_uvector&& srcs, + rmm::device_uvector&& dsts, + size_t lgN); + +template std::tuple, + rmm::device_uvector, + std::optional>> +combine_edgelists(raft::handle_t const& handle, + std::vector>&& sources, + std::vector>&& dests, + std::optional>>&& optional_d_weights, + bool remove_multi_edges); + +template std::tuple, + rmm::device_uvector, + std::optional>> +combine_edgelists(raft::handle_t const& handle, + std::vector>&& sources, + std::vector>&& dests, + std::optional>>&& optional_d_weights, + bool remove_multi_edges); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist_from_triangular( + raft::handle_t const& handle, + rmm::device_uvector&& d_src_v, + rmm::device_uvector&& d_dst_v, + std::optional>&& optional_d_weights_v, + bool check_diagonal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist_from_triangular( + raft::handle_t const& handle, + rmm::device_uvector&& d_src_v, + rmm::device_uvector&& d_dst_v, + std::optional>&& optional_d_weights_v, + bool check_diagonal); + +} // namespace cugraph diff --git a/cpp/src/generators/generator_tools_sg_v64_e64.cu b/cpp/src/generators/generator_tools_sg_v64_e64.cu new file mode 100644 index 00000000000..c8892dbc546 --- /dev/null +++ b/cpp/src/generators/generator_tools_sg_v64_e64.cu @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/generator_tools.cuh" +#include "generators/scramble.cuh" + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace cugraph { + +template rmm::device_uvector scramble_vertex_ids(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + size_t lgN); + +template std::tuple, rmm::device_uvector> scramble_vertex_ids( + raft::handle_t const& handle, + rmm::device_uvector&& srcs, + rmm::device_uvector&& dsts, + size_t lgN); + +template std::tuple, + rmm::device_uvector, + std::optional>> +combine_edgelists(raft::handle_t const& handle, + std::vector>&& sources, + std::vector>&& dests, + std::optional>>&& optional_d_weights, + bool remove_multi_edges); + +template std::tuple, + rmm::device_uvector, + std::optional>> +combine_edgelists(raft::handle_t const& handle, + std::vector>&& sources, + std::vector>&& dests, + std::optional>>&& optional_d_weights, + bool remove_multi_edges); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist_from_triangular( + raft::handle_t const& handle, + rmm::device_uvector&& d_src_v, + rmm::device_uvector&& d_dst_v, + std::optional>&& optional_d_weights_v, + bool check_diagonal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist_from_triangular( + raft::handle_t const& handle, + rmm::device_uvector&& d_src_v, + rmm::device_uvector&& d_dst_v, + std::optional>&& optional_d_weights_v, + bool check_diagonal); + +} // namespace cugraph diff --git a/cpp/src/generators/simple_generators.cu b/cpp/src/generators/simple_generators.cuh similarity index 87% rename from cpp/src/generators/simple_generators.cu rename to cpp/src/generators/simple_generators.cuh index a6de94f5fa0..a3f1a6ea754 100644 --- a/cpp/src/generators/simple_generators.cu +++ b/cpp/src/generators/simple_generators.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include #include @@ -302,40 +304,4 @@ generate_complete_graph_edgelist( return std::make_tuple(std::move(d_src_v), std::move(d_dst_v)); } -template std::tuple, rmm::device_uvector> -generate_path_graph_edgelist(raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_path_graph_edgelist(raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_2d_mesh_graph_edgelist( - raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_2d_mesh_graph_edgelist( - raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_3d_mesh_graph_edgelist( - raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_3d_mesh_graph_edgelist( - raft::handle_t const& handle, - std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_complete_graph_edgelist( - raft::handle_t const& handle, std::vector> const& component_parms_v); - -template std::tuple, rmm::device_uvector> -generate_complete_graph_edgelist( - raft::handle_t const& handle, std::vector> const& component_parms_v); - } // namespace cugraph diff --git a/cpp/src/generators/simple_generators_sg_v32_e32.cu b/cpp/src/generators/simple_generators_sg_v32_e32.cu new file mode 100644 index 00000000000..8868bb0284d --- /dev/null +++ b/cpp/src/generators/simple_generators_sg_v32_e32.cu @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/simple_generators.cuh" + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_path_graph_edgelist(raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_2d_mesh_graph_edgelist( + raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_3d_mesh_graph_edgelist( + raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_complete_graph_edgelist( + raft::handle_t const& handle, std::vector> const& component_parms_v); + +} // namespace cugraph diff --git a/cpp/src/generators/simple_generators_sg_v64_e64.cu b/cpp/src/generators/simple_generators_sg_v64_e64.cu new file mode 100644 index 00000000000..08eabceb0ca --- /dev/null +++ b/cpp/src/generators/simple_generators_sg_v64_e64.cu @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "generators/simple_generators.cuh" + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace cugraph { + +template std::tuple, rmm::device_uvector> +generate_path_graph_edgelist(raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_2d_mesh_graph_edgelist( + raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_3d_mesh_graph_edgelist( + raft::handle_t const& handle, + std::vector> const& component_parms_v); + +template std::tuple, rmm::device_uvector> +generate_complete_graph_edgelist( + raft::handle_t const& handle, std::vector> const& component_parms_v); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/hits_mg.cu b/cpp/src/link_analysis/hits_mg_v32_e32.cu similarity index 52% rename from cpp/src/link_analysis/hits_mg.cu rename to cpp/src/link_analysis/hits_mg_v32_e32.cu index ae1295a9c3b..6d7c1b38983 100644 --- a/cpp/src/link_analysis/hits_mg.cu +++ b/cpp/src/link_analysis/hits_mg_v32_e32.cu @@ -41,48 +41,4 @@ template std::tuple hits( bool normalize, bool do_expensive_check); -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - float* const hubs, - float* const authorities, - float epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - double* const hubs, - double* const authorities, - double epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - float* const hubs, - float* const authorities, - float epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - double* const hubs, - double* const authorities, - double epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/link_analysis/hits_mg_v32_e64.cu b/cpp/src/link_analysis/hits_mg_v32_e64.cu new file mode 100644 index 00000000000..a0a99f61822 --- /dev/null +++ b/cpp/src/link_analysis/hits_mg_v32_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "link_analysis/hits_impl.cuh" + +namespace cugraph { + +// MG instantiation +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + float* const hubs, + float* const authorities, + float epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + double* const hubs, + double* const authorities, + double epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/hits_mg_v64_e64.cu b/cpp/src/link_analysis/hits_mg_v64_e64.cu new file mode 100644 index 00000000000..6254ebdbee7 --- /dev/null +++ b/cpp/src/link_analysis/hits_mg_v64_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "link_analysis/hits_impl.cuh" + +namespace cugraph { + +// MG instantiation +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + float* const hubs, + float* const authorities, + float epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + double* const hubs, + double* const authorities, + double epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/hits_sg.cu b/cpp/src/link_analysis/hits_sg_v32_e32.cu similarity index 51% rename from cpp/src/link_analysis/hits_sg.cu rename to cpp/src/link_analysis/hits_sg_v32_e32.cu index 21bfcea143e..4a498afa6a6 100644 --- a/cpp/src/link_analysis/hits_sg.cu +++ b/cpp/src/link_analysis/hits_sg_v32_e32.cu @@ -41,48 +41,4 @@ template std::tuple hits( bool normalize, bool do_expensive_check); -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - float* const hubs, - float* const authorities, - float epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - double* const hubs, - double* const authorities, - double epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - float* const hubs, - float* const authorities, - float epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - -template std::tuple hits( - raft::handle_t const& handle, - graph_view_t const& graph_view, - double* const hubs, - double* const authorities, - double epsilon, - size_t max_iterations, - bool has_initial_hubs_guess, - bool normalize, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/link_analysis/hits_sg_v32_e64.cu b/cpp/src/link_analysis/hits_sg_v32_e64.cu new file mode 100644 index 00000000000..10eb4579f15 --- /dev/null +++ b/cpp/src/link_analysis/hits_sg_v32_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "link_analysis/hits_impl.cuh" + +namespace cugraph { + +// SG instantiation +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + float* const hubs, + float* const authorities, + float epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + double* const hubs, + double* const authorities, + double epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/hits_sg_v64_e64.cu b/cpp/src/link_analysis/hits_sg_v64_e64.cu new file mode 100644 index 00000000000..0da40a34d67 --- /dev/null +++ b/cpp/src/link_analysis/hits_sg_v64_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "link_analysis/hits_impl.cuh" + +namespace cugraph { + +// SG instantiation +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + float* const hubs, + float* const authorities, + float epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +template std::tuple hits( + raft::handle_t const& handle, + graph_view_t const& graph_view, + double* const hubs, + double* const authorities, + double epsilon, + size_t max_iterations, + bool has_initial_hubs_guess, + bool normalize, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_mg.cu b/cpp/src/link_analysis/pagerank_mg.cu deleted file mode 100644 index 136c8355817..00000000000 --- a/cpp/src/link_analysis/pagerank_mg.cu +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "link_analysis/pagerank_impl.cuh" - -namespace cugraph { - -// MG instantiation -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_mg_v32_e32.cu b/cpp/src/link_analysis/pagerank_mg_v32_e32.cu new file mode 100644 index 00000000000..6bd2aaef944 --- /dev/null +++ b/cpp/src/link_analysis/pagerank_mg_v32_e32.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// MG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_mg_v32_e64.cu b/cpp/src/link_analysis/pagerank_mg_v32_e64.cu new file mode 100644 index 00000000000..c3a3b1b6f52 --- /dev/null +++ b/cpp/src/link_analysis/pagerank_mg_v32_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// MG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_mg_v64_e64.cu b/cpp/src/link_analysis/pagerank_mg_v64_e64.cu new file mode 100644 index 00000000000..68c7311a221 --- /dev/null +++ b/cpp/src/link_analysis/pagerank_mg_v64_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// MG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_sg.cu b/cpp/src/link_analysis/pagerank_sg.cu deleted file mode 100644 index 3156ebb8c9b..00000000000 --- a/cpp/src/link_analysis/pagerank_sg.cu +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "link_analysis/pagerank_impl.cuh" - -namespace cugraph { - -// SG instantiation -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - float* pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template void pagerank(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional precomputed_vertex_out_weight_sums, - std::optional personalization_vertices, - std::optional personalization_values, - std::optional personalization_vector_size, - double* pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool has_initial_guess, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - float alpha, - float epsilon, - size_t max_iterations, - bool do_expensive_check); - -template std::tuple, centrality_algorithm_metadata_t> pagerank( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> precomputed_vertex_out_weight_sums, - std::optional, raft::device_span>> - personalization, - std::optional> initial_pageranks, - double alpha, - double epsilon, - size_t max_iterations, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_sg_v32_e32.cu b/cpp/src/link_analysis/pagerank_sg_v32_e32.cu new file mode 100644 index 00000000000..192f7723b8e --- /dev/null +++ b/cpp/src/link_analysis/pagerank_sg_v32_e32.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// SG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_sg_v32_e64.cu b/cpp/src/link_analysis/pagerank_sg_v32_e64.cu new file mode 100644 index 00000000000..0e515a55024 --- /dev/null +++ b/cpp/src/link_analysis/pagerank_sg_v32_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// SG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_analysis/pagerank_sg_v64_e64.cu b/cpp/src/link_analysis/pagerank_sg_v64_e64.cu new file mode 100644 index 00000000000..ebce6448e29 --- /dev/null +++ b/cpp/src/link_analysis/pagerank_sg_v64_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021-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. + */ +#include "link_analysis/pagerank_impl.cuh" + +namespace cugraph { + +// SG instantiation +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + float* pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template void pagerank(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional precomputed_vertex_out_weight_sums, + std::optional personalization_vertices, + std::optional personalization_values, + std::optional personalization_vector_size, + double* pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool has_initial_guess, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + float alpha, + float epsilon, + size_t max_iterations, + bool do_expensive_check); + +template std::tuple, centrality_algorithm_metadata_t> pagerank( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> precomputed_vertex_out_weight_sums, + std::optional, raft::device_span>> + personalization, + std::optional> initial_pageranks, + double alpha, + double epsilon, + size_t max_iterations, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_mg.cu b/cpp/src/link_prediction/cosine_mg.cu deleted file mode 100644 index 71b8e7030df..00000000000 --- a/cpp/src/link_prediction/cosine_mg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/cosine_similarity_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_mg_v32_e32.cu b/cpp/src/link_prediction/cosine_mg_v32_e32.cu new file mode 100644 index 00000000000..d43b50d0d47 --- /dev/null +++ b/cpp/src/link_prediction/cosine_mg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_mg_v32_e64.cu b/cpp/src/link_prediction/cosine_mg_v32_e64.cu new file mode 100644 index 00000000000..c6efa6b8c30 --- /dev/null +++ b/cpp/src/link_prediction/cosine_mg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_mg_v64_e64.cu b/cpp/src/link_prediction/cosine_mg_v64_e64.cu new file mode 100644 index 00000000000..2fce2a4c6ee --- /dev/null +++ b/cpp/src/link_prediction/cosine_mg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_sg.cu b/cpp/src/link_prediction/cosine_sg.cu deleted file mode 100644 index bf0cb79d802..00000000000 --- a/cpp/src/link_prediction/cosine_sg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/cosine_similarity_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector cosine_similarity_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - cosine_similarity_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_sg_v32_e32.cu b/cpp/src/link_prediction/cosine_sg_v32_e32.cu new file mode 100644 index 00000000000..0135bca25e1 --- /dev/null +++ b/cpp/src/link_prediction/cosine_sg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_sg_v32_e64.cu b/cpp/src/link_prediction/cosine_sg_v32_e64.cu new file mode 100644 index 00000000000..80a3b31faab --- /dev/null +++ b/cpp/src/link_prediction/cosine_sg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/cosine_sg_v64_e64.cu b/cpp/src/link_prediction/cosine_sg_v64_e64.cu new file mode 100644 index 00000000000..0eaf3d1cc94 --- /dev/null +++ b/cpp/src/link_prediction/cosine_sg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/cosine_similarity_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector cosine_similarity_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + cosine_similarity_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_mg.cu b/cpp/src/link_prediction/jaccard_mg.cu deleted file mode 100644 index f53d173c6dd..00000000000 --- a/cpp/src/link_prediction/jaccard_mg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/jaccard_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_mg_v32_e32.cu b/cpp/src/link_prediction/jaccard_mg_v32_e32.cu new file mode 100644 index 00000000000..3f2205e3f49 --- /dev/null +++ b/cpp/src/link_prediction/jaccard_mg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_mg_v32_e64.cu b/cpp/src/link_prediction/jaccard_mg_v32_e64.cu new file mode 100644 index 00000000000..a359458a3c0 --- /dev/null +++ b/cpp/src/link_prediction/jaccard_mg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_mg_v64_e64.cu b/cpp/src/link_prediction/jaccard_mg_v64_e64.cu new file mode 100644 index 00000000000..03737e027d4 --- /dev/null +++ b/cpp/src/link_prediction/jaccard_mg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_sg.cu b/cpp/src/link_prediction/jaccard_sg.cu deleted file mode 100644 index 6bb89a21368..00000000000 --- a/cpp/src/link_prediction/jaccard_sg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/jaccard_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector jaccard_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - jaccard_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_sg_v32_e32.cu b/cpp/src/link_prediction/jaccard_sg_v32_e32.cu new file mode 100644 index 00000000000..1cff3b5507b --- /dev/null +++ b/cpp/src/link_prediction/jaccard_sg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_sg_v32_e64.cu b/cpp/src/link_prediction/jaccard_sg_v32_e64.cu new file mode 100644 index 00000000000..eaa01f13c5e --- /dev/null +++ b/cpp/src/link_prediction/jaccard_sg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/jaccard_sg_v64_e64.cu b/cpp/src/link_prediction/jaccard_sg_v64_e64.cu new file mode 100644 index 00000000000..4899e97c36a --- /dev/null +++ b/cpp/src/link_prediction/jaccard_sg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/jaccard_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector jaccard_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + jaccard_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_mg.cu b/cpp/src/link_prediction/overlap_mg.cu deleted file mode 100644 index a88159e682b..00000000000 --- a/cpp/src/link_prediction/overlap_mg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/overlap_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_mg_v32_e32.cu b/cpp/src/link_prediction/overlap_mg_v32_e32.cu new file mode 100644 index 00000000000..0c2f58bf15e --- /dev/null +++ b/cpp/src/link_prediction/overlap_mg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_mg_v32_e64.cu b/cpp/src/link_prediction/overlap_mg_v32_e64.cu new file mode 100644 index 00000000000..c493a50a5db --- /dev/null +++ b/cpp/src/link_prediction/overlap_mg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_mg_v64_e64.cu b/cpp/src/link_prediction/overlap_mg_v64_e64.cu new file mode 100644 index 00000000000..14b99a2ecb7 --- /dev/null +++ b/cpp/src/link_prediction/overlap_mg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_sg.cu b/cpp/src/link_prediction/overlap_sg.cu deleted file mode 100644 index 17e4bafdcbe..00000000000 --- a/cpp/src/link_prediction/overlap_sg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/overlap_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector overlap_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - overlap_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_sg_v32_e32.cu b/cpp/src/link_prediction/overlap_sg_v32_e32.cu new file mode 100644 index 00000000000..42989966cc4 --- /dev/null +++ b/cpp/src/link_prediction/overlap_sg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_sg_v32_e64.cu b/cpp/src/link_prediction/overlap_sg_v32_e64.cu new file mode 100644 index 00000000000..31adbcf0238 --- /dev/null +++ b/cpp/src/link_prediction/overlap_sg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/overlap_sg_v64_e64.cu b/cpp/src/link_prediction/overlap_sg_v64_e64.cu new file mode 100644 index 00000000000..4d334e21782 --- /dev/null +++ b/cpp/src/link_prediction/overlap_sg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/overlap_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector overlap_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + overlap_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_mg.cu b/cpp/src/link_prediction/sorensen_mg.cu deleted file mode 100644 index c3d010f8503..00000000000 --- a/cpp/src/link_prediction/sorensen_mg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/sorensen_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_mg_v32_e32.cu b/cpp/src/link_prediction/sorensen_mg_v32_e32.cu new file mode 100644 index 00000000000..9ca81e2e29e --- /dev/null +++ b/cpp/src/link_prediction/sorensen_mg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_mg_v32_e64.cu b/cpp/src/link_prediction/sorensen_mg_v32_e64.cu new file mode 100644 index 00000000000..9c5f5cc9716 --- /dev/null +++ b/cpp/src/link_prediction/sorensen_mg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_mg_v64_e64.cu b/cpp/src/link_prediction/sorensen_mg_v64_e64.cu new file mode 100644 index 00000000000..1fb73dd271d --- /dev/null +++ b/cpp/src/link_prediction/sorensen_mg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_sg.cu b/cpp/src/link_prediction/sorensen_sg.cu deleted file mode 100644 index c129cd40ca4..00000000000 --- a/cpp/src/link_prediction/sorensen_sg.cu +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ -#include "link_prediction/sorensen_impl.cuh" - -namespace cugraph { - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template rmm::device_uvector sorensen_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::tuple, raft::device_span> vertex_pairs, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - sorensen_all_pairs_coefficients( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> vertices, - std::optional topk, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_sg_v32_e32.cu b/cpp/src/link_prediction/sorensen_sg_v32_e32.cu new file mode 100644 index 00000000000..bff6adba4b4 --- /dev/null +++ b/cpp/src/link_prediction/sorensen_sg_v32_e32.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_sg_v32_e64.cu b/cpp/src/link_prediction/sorensen_sg_v32_e64.cu new file mode 100644 index 00000000000..20cd5e621e2 --- /dev/null +++ b/cpp/src/link_prediction/sorensen_sg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/link_prediction/sorensen_sg_v64_e64.cu b/cpp/src/link_prediction/sorensen_sg_v64_e64.cu new file mode 100644 index 00000000000..9f6d7bfa2ba --- /dev/null +++ b/cpp/src/link_prediction/sorensen_sg_v64_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022-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. + */ +#include "link_prediction/sorensen_impl.cuh" + +namespace cugraph { + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template rmm::device_uvector sorensen_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::tuple, raft::device_span> vertex_pairs, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + sorensen_all_pairs_coefficients( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> vertices, + std::optional topk, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_pairs_result.cu b/cpp/src/mtmg/vertex_pairs_result.cuh similarity index 57% rename from cpp/src/mtmg/vertex_pairs_result.cu rename to cpp/src/mtmg/vertex_pairs_result.cuh index 55b855d676d..1a905e9292e 100644 --- a/cpp/src/mtmg/vertex_pairs_result.cu +++ b/cpp/src/mtmg/vertex_pairs_result.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include "detail/graph_partition_utils.cuh" #include @@ -165,113 +167,5 @@ std:: return std::make_tuple(std::move(v1), std::move(v2), std::move(result)); } -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - -template std:: - tuple, rmm::device_uvector, rmm::device_uvector> - vertex_pair_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view); - } // namespace mtmg } // namespace cugraph diff --git a/cpp/src/mtmg/vertex_pairs_result_mg_v32_e32.cu b/cpp/src/mtmg/vertex_pairs_result_mg_v32_e32.cu new file mode 100644 index 00000000000..96963a17ed5 --- /dev/null +++ b/cpp/src/mtmg/vertex_pairs_result_mg_v32_e32.cu @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_pairs_result.cuh" + +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_pairs_result_mg_v64_e64.cu b/cpp/src/mtmg/vertex_pairs_result_mg_v64_e64.cu new file mode 100644 index 00000000000..1d223ee2405 --- /dev/null +++ b/cpp/src/mtmg/vertex_pairs_result_mg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_pairs_result.cuh" + +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_pairs_result_sg_v32_e32.cu b/cpp/src/mtmg/vertex_pairs_result_sg_v32_e32.cu new file mode 100644 index 00000000000..c9427e9eeb9 --- /dev/null +++ b/cpp/src/mtmg/vertex_pairs_result_sg_v32_e32.cu @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_pairs_result.cuh" + +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_pairs_result_sg_v64_e64.cu b/cpp/src/mtmg/vertex_pairs_result_sg_v64_e64.cu new file mode 100644 index 00000000000..fec0a287af0 --- /dev/null +++ b/cpp/src/mtmg/vertex_pairs_result_sg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * 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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_pairs_result.cuh" + +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + vertex_pair_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_result.cu b/cpp/src/mtmg/vertex_result.cuh similarity index 55% rename from cpp/src/mtmg/vertex_result.cu rename to cpp/src/mtmg/vertex_result.cuh index 1dc6b876d52..50c9cc10483 100644 --- a/cpp/src/mtmg/vertex_result.cu +++ b/cpp/src/mtmg/vertex_result.cuh @@ -14,6 +14,8 @@ * limitations under the License. */ +#pragma once + #include "detail/graph_partition_utils.cuh" #include @@ -146,101 +148,5 @@ rmm::device_uvector vertex_result_view_t::gather( return result; } -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - float default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - float default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - float default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - float default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - double default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - double default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - double default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - double default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - int32_t default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - int32_t default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - int64_t default_value); - -template rmm::device_uvector vertex_result_view_t::gather( - handle_t const& handle, - raft::device_span vertices, - std::vector const& vertex_partition_range_lasts, - vertex_partition_view_t vertex_partition_view, - std::optional>& renumber_map_view, - int64_t default_value); - } // namespace mtmg } // namespace cugraph diff --git a/cpp/src/mtmg/vertex_result_mg_v32_e32.cu b/cpp/src/mtmg/vertex_result_mg_v32_e32.cu new file mode 100644 index 00000000000..14f4d2f3f45 --- /dev/null +++ b/cpp/src/mtmg/vertex_result_mg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_result.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + float default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + double default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + int32_t default_value); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_result_mg_v64_e64.cu b/cpp/src/mtmg/vertex_result_mg_v64_e64.cu new file mode 100644 index 00000000000..cc29503e712 --- /dev/null +++ b/cpp/src/mtmg/vertex_result_mg_v64_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_result.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + float default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + double default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + int64_t default_value); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_result_sg_v32_e32.cu b/cpp/src/mtmg/vertex_result_sg_v32_e32.cu new file mode 100644 index 00000000000..5d67b8db20c --- /dev/null +++ b/cpp/src/mtmg/vertex_result_sg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_result.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + float default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + double default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + int32_t default_value); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/mtmg/vertex_result_sg_v64_e64.cu b/cpp/src/mtmg/vertex_result_sg_v64_e64.cu new file mode 100644 index 00000000000..55b6dd962a9 --- /dev/null +++ b/cpp/src/mtmg/vertex_result_sg_v64_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "mtmg/vertex_result.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +namespace cugraph { +namespace mtmg { + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + float default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + double default_value); + +template rmm::device_uvector vertex_result_view_t::gather( + handle_t const& handle, + raft::device_span vertices, + std::vector const& vertex_partition_range_lasts, + vertex_partition_view_t vertex_partition_view, + std::optional>& renumber_map_view, + int64_t default_value); + +} // namespace mtmg +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu new file mode 100644 index 00000000000..2dd596bb6a7 --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e32.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu new file mode 100644 index 00000000000..d7dd08b4cd5 --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v32_e64.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu new file mode 100644 index 00000000000..40d416baefc --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_mg_v64_e64.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu new file mode 100644 index 00000000000..57decd47d5c --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e32.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu new file mode 100644 index 00000000000..2a151b4d4e6 --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v32_e64.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..c1d1d3a6548 --- /dev/null +++ b/cpp/src/sampling/detail/gather_one_hop_edgelist_sg_v64_e64.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +gather_one_hop_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::device_span active_majors, + std::optional> active_major_labels, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/prepare_next_frontier_mg.cu b/cpp/src/sampling/detail/prepare_next_frontier_mg_v32_e32.cu similarity index 63% rename from cpp/src/sampling/detail/prepare_next_frontier_mg.cu rename to cpp/src/sampling/detail/prepare_next_frontier_mg_v32_e32.cu index 8a32a010f75..01465cff2a4 100644 --- a/cpp/src/sampling/detail/prepare_next_frontier_mg.cu +++ b/cpp/src/sampling/detail/prepare_next_frontier_mg_v32_e32.cu @@ -37,23 +37,5 @@ prepare_next_frontier( bool dedupe_sources, bool do_expensive_check); -template std::tuple, - std::optional>, - std::optional, - std::optional>>>> -prepare_next_frontier( - raft::handle_t const& handle, - raft::device_span sampled_src_vertices, - std::optional> sampled_src_vertex_labels, - raft::device_span sampled_dst_vertices, - std::optional> sampled_dst_vertex_labels, - std::optional, - std::optional>>>&& vertex_used_as_source, - vertex_partition_view_t vertex_partition, - std::vector const& vertex_partition_range_lasts, - prior_sources_behavior_t prior_sources_behavior, - bool dedupe_sources, - bool do_expensive_check); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu b/cpp/src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu new file mode 100644 index 00000000000..04c66cf6d3c --- /dev/null +++ b/cpp/src/sampling/detail/prepare_next_frontier_mg_v64_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/prepare_next_frontier_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::optional>, + std::optional, + std::optional>>>> +prepare_next_frontier( + raft::handle_t const& handle, + raft::device_span sampled_src_vertices, + std::optional> sampled_src_vertex_labels, + raft::device_span sampled_dst_vertices, + std::optional> sampled_dst_vertex_labels, + std::optional, + std::optional>>>&& vertex_used_as_source, + vertex_partition_view_t vertex_partition, + std::vector const& vertex_partition_range_lasts, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/prepare_next_frontier_sg.cu b/cpp/src/sampling/detail/prepare_next_frontier_sg_v32_e32.cu similarity index 63% rename from cpp/src/sampling/detail/prepare_next_frontier_sg.cu rename to cpp/src/sampling/detail/prepare_next_frontier_sg_v32_e32.cu index eae134488a1..b5fc04dca8d 100644 --- a/cpp/src/sampling/detail/prepare_next_frontier_sg.cu +++ b/cpp/src/sampling/detail/prepare_next_frontier_sg_v32_e32.cu @@ -37,23 +37,5 @@ prepare_next_frontier( bool dedupe_sources, bool do_expensive_check); -template std::tuple, - std::optional>, - std::optional, - std::optional>>>> -prepare_next_frontier( - raft::handle_t const& handle, - raft::device_span sampled_src_vertices, - std::optional> sampled_src_vertex_labels, - raft::device_span sampled_dst_vertices, - std::optional> sampled_dst_vertex_labels, - std::optional, - std::optional>>>&& vertex_used_as_source, - vertex_partition_view_t vertex_partition, - std::vector const& vertex_partition_range_lasts, - prior_sources_behavior_t prior_sources_behavior, - bool dedupe_sources, - bool do_expensive_check); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu b/cpp/src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu new file mode 100644 index 00000000000..f93874d89a9 --- /dev/null +++ b/cpp/src/sampling/detail/prepare_next_frontier_sg_v64_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/prepare_next_frontier_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + std::optional>, + std::optional, + std::optional>>>> +prepare_next_frontier( + raft::handle_t const& handle, + raft::device_span sampled_src_vertices, + std::optional> sampled_src_vertex_labels, + raft::device_span sampled_dst_vertices, + std::optional> sampled_dst_vertex_labels, + std::optional, + std::optional>>>&& vertex_used_as_source, + vertex_partition_view_t vertex_partition, + std::vector const& vertex_partition_range_lasts, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cu b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cuh similarity index 77% rename from cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cu rename to cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cuh index 82d16959f0f..f6793c4a157 100644 --- a/cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cu +++ b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier.cuh @@ -72,21 +72,5 @@ remove_visited_vertices_from_frontier( return std::make_tuple(std::move(frontier_vertices), std::move(frontier_vertex_labels)); } -template std::tuple, std::optional>> -remove_visited_vertices_from_frontier( - raft::handle_t const& handle, - rmm::device_uvector&& frontier_vertices, - std::optional>&& frontier_vertex_labels, - raft::device_span vertices_used_as_source, - std::optional> vertex_labels_used_as_source); - -template std::tuple, std::optional>> -remove_visited_vertices_from_frontier( - raft::handle_t const& handle, - rmm::device_uvector&& frontier_vertices, - std::optional>&& frontier_vertex_labels, - raft::device_span vertices_used_as_source, - std::optional> vertex_labels_used_as_source); - } // namespace detail } // namespace cugraph diff --git a/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu new file mode 100644 index 00000000000..89634253ee7 --- /dev/null +++ b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ +#include "sampling/detail/remove_visited_vertices_from_frontier.cuh" + +#include +#include + +#include + +#include +#include +#include +#include + +namespace cugraph { +namespace detail { + +template std::tuple, std::optional>> +remove_visited_vertices_from_frontier( + raft::handle_t const& handle, + rmm::device_uvector&& frontier_vertices, + std::optional>&& frontier_vertex_labels, + raft::device_span vertices_used_as_source, + std::optional> vertex_labels_used_as_source); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu new file mode 100644 index 00000000000..41cb7413bc4 --- /dev/null +++ b/cpp/src/sampling/detail/remove_visited_vertices_from_frontier_sg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ +#include "sampling/detail/remove_visited_vertices_from_frontier.cuh" + +#include +#include + +#include + +#include +#include +#include +#include + +namespace cugraph { +namespace detail { + +template std::tuple, std::optional>> +remove_visited_vertices_from_frontier( + raft::handle_t const& handle, + rmm::device_uvector&& frontier_vertices, + std::optional>&& frontier_vertex_labels, + raft::device_span vertices_used_as_source, + std::optional> vertex_labels_used_as_source); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_mg.cu b/cpp/src/sampling/detail/sample_edges_mg.cu deleted file mode 100644 index 3e5591f82b5..00000000000 --- a/cpp/src/sampling/detail/sample_edges_mg.cu +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "sampling/detail/sample_edges.cuh" - -namespace cugraph { -namespace detail { - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_mg_v32_e32.cu b/cpp/src/sampling/detail/sample_edges_mg_v32_e32.cu new file mode 100644 index 00000000000..e456d6c1af3 --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_mg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_mg_v32_e64.cu b/cpp/src/sampling/detail/sample_edges_mg_v32_e64.cu new file mode 100644 index 00000000000..8dad10fb7b4 --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_mg_v32_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_mg_v64_e64.cu b/cpp/src/sampling/detail/sample_edges_mg_v64_e64.cu new file mode 100644 index 00000000000..b3edfdda3dc --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_mg_v64_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_sg.cu b/cpp/src/sampling/detail/sample_edges_sg.cu deleted file mode 100644 index 103d1f02473..00000000000 --- a/cpp/src/sampling/detail/sample_edges_sg.cu +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "sampling/detail/sample_edges.cuh" - -namespace cugraph { -namespace detail { - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sample_edges(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::random::RngState& rng_state, - raft::device_span active_majors, - std::optional> active_major_labels, - size_t fanout, - bool with_replacement); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_sg_v32_e32.cu b/cpp/src/sampling/detail/sample_edges_sg_v32_e32.cu new file mode 100644 index 00000000000..f17e3c8a497 --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_sg_v32_e32.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_sg_v32_e64.cu b/cpp/src/sampling/detail/sample_edges_sg_v32_e64.cu new file mode 100644 index 00000000000..5571905b2b6 --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_sg_v32_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/sample_edges_sg_v64_e64.cu b/cpp/src/sampling/detail/sample_edges_sg_v64_e64.cu new file mode 100644 index 00000000000..6e1867eaa2a --- /dev/null +++ b/cpp/src/sampling/detail/sample_edges_sg_v64_e64.cu @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/sample_edges.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sample_edges(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_edge_type_view, + raft::random::RngState& rng_state, + raft::device_span active_majors, + std::optional> active_major_labels, + size_t fanout, + bool with_replacement); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/shuffle_and_organize_output_mg.cu b/cpp/src/sampling/detail/shuffle_and_organize_output_mg.cu deleted file mode 100644 index 966223bf5b1..00000000000 --- a/cpp/src/sampling/detail/shuffle_and_organize_output_mg.cu +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "sampling/detail/shuffle_and_organize_output_impl.cuh" - -namespace cugraph { -namespace detail { - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -shuffle_and_organize_output( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::optional>&& hops, - std::optional>&& labels, - std::optional, raft::device_span>> - label_to_output_comm_rank); - -} // namespace detail -} // namespace cugraph diff --git a/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu new file mode 100644 index 00000000000..73a152487ca --- /dev/null +++ b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e32.cu @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/shuffle_and_organize_output_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu new file mode 100644 index 00000000000..50fc3910aca --- /dev/null +++ b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v32_e64.cu @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/shuffle_and_organize_output_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu new file mode 100644 index 00000000000..ff7a716e609 --- /dev/null +++ b/cpp/src/sampling/detail/shuffle_and_organize_output_mg_v64_e64.cu @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/detail/shuffle_and_organize_output_impl.cuh" + +namespace cugraph { +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +shuffle_and_organize_output( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::optional>&& hops, + std::optional>&& labels, + std::optional, raft::device_span>> + label_to_output_comm_rank); + +} // namespace detail +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_mg.cu b/cpp/src/sampling/random_walks_mg.cu deleted file mode 100644 index 5352f3822b8..00000000000 --- a/cpp/src/sampling/random_walks_mg.cu +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "sampling/random_walks_impl.cuh" - -#include - -namespace cugraph { - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_mg_v32_e32.cu b/cpp/src/sampling/random_walks_mg_v32_e32.cu new file mode 100644 index 00000000000..421d3e9c818 --- /dev/null +++ b/cpp/src/sampling/random_walks_mg_v32_e32.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_mg_v32_e64.cu b/cpp/src/sampling/random_walks_mg_v32_e64.cu new file mode 100644 index 00000000000..d38af65a505 --- /dev/null +++ b/cpp/src/sampling/random_walks_mg_v32_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_mg_v64_e64.cu b/cpp/src/sampling/random_walks_mg_v64_e64.cu new file mode 100644 index 00000000000..9dedc893242 --- /dev/null +++ b/cpp/src/sampling/random_walks_mg_v64_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks.cu b/cpp/src/sampling/random_walks_old_sg.cu similarity index 100% rename from cpp/src/sampling/random_walks.cu rename to cpp/src/sampling/random_walks_old_sg.cu diff --git a/cpp/src/sampling/random_walks_old_sg_v32_e32.cu b/cpp/src/sampling/random_walks_old_sg_v32_e32.cu new file mode 100644 index 00000000000..8eb1c2a37cd --- /dev/null +++ b/cpp/src/sampling/random_walks_old_sg_v32_e32.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021-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. + */ + +// Andrei Schaffer, aschaffer@nvidia.com +// +#include "random_walks.cuh" + +namespace cugraph { +// template explicit instantiation directives (EIDir's): + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int32_t const* ptr_d_start, + int32_t num_paths, + int32_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int32_t const* ptr_d_start, + int32_t num_paths, + int32_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + convert_paths_to_coo(raft::handle_t const& handle, + int32_t coalesced_sz_v, + int32_t num_paths, + rmm::device_buffer&& d_coalesced_v, + rmm::device_buffer&& d_sizes); + +template std::tuple, + rmm::device_uvector, + rmm::device_uvector> +query_rw_sizes_offsets(raft::handle_t const& handle, int32_t num_paths, int32_t const* ptr_d_sizes); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_old_sg_v32_e64.cu b/cpp/src/sampling/random_walks_old_sg_v32_e64.cu new file mode 100644 index 00000000000..7dfbf964587 --- /dev/null +++ b/cpp/src/sampling/random_walks_old_sg_v32_e64.cu @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021-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. + */ + +// Andrei Schaffer, aschaffer@nvidia.com +// +#include "random_walks.cuh" + +namespace cugraph { +// template explicit instantiation directives (EIDir's): + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int32_t const* ptr_d_start, + int64_t num_paths, + int64_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int32_t const* ptr_d_start, + int64_t num_paths, + int64_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + convert_paths_to_coo(raft::handle_t const& handle, + int64_t coalesced_sz_v, + int64_t num_paths, + rmm::device_buffer&& d_coalesced_v, + rmm::device_buffer&& d_sizes); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_old_sg_v64_e64.cu b/cpp/src/sampling/random_walks_old_sg_v64_e64.cu new file mode 100644 index 00000000000..2f3884f480e --- /dev/null +++ b/cpp/src/sampling/random_walks_old_sg_v64_e64.cu @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2021-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. + */ + +// Andrei Schaffer, aschaffer@nvidia.com +// +#include "random_walks.cuh" + +namespace cugraph { +// template explicit instantiation directives (EIDir's): + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int64_t const* ptr_d_start, + int64_t num_paths, + int64_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + random_walks(raft::handle_t const& handle, + graph_view_t const& gview, + std::optional> edge_weight_view, + int64_t const* ptr_d_start, + int64_t num_paths, + int64_t max_depth, + bool use_padding, + std::unique_ptr sampling_strategy); + +template std:: + tuple, rmm::device_uvector, rmm::device_uvector> + convert_paths_to_coo(raft::handle_t const& handle, + int64_t coalesced_sz_v, + int64_t num_paths, + rmm::device_buffer&& d_coalesced_v, + rmm::device_buffer&& d_sizes); + +template std::tuple, + rmm::device_uvector, + rmm::device_uvector> +query_rw_sizes_offsets(raft::handle_t const& handle, int64_t num_paths, int64_t const* ptr_d_sizes); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_sg.cu b/cpp/src/sampling/random_walks_sg.cu deleted file mode 100644 index e91b369508e..00000000000 --- a/cpp/src/sampling/random_walks_sg.cu +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (c) 2022-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. - */ - -#include "sampling/random_walks_impl.cuh" - -#include - -namespace cugraph { - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -uniform_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -biased_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - float p, - float q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -template std::tuple, std::optional>> -node2vec_random_walks(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span start_vertices, - size_t max_length, - double p, - double q, - uint64_t seed); - -} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_sg_v32_e32.cu b/cpp/src/sampling/random_walks_sg_v32_e32.cu new file mode 100644 index 00000000000..7b64d107250 --- /dev/null +++ b/cpp/src/sampling/random_walks_sg_v32_e32.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_sg_v32_e64.cu b/cpp/src/sampling/random_walks_sg_v32_e64.cu new file mode 100644 index 00000000000..d9ea09f36ef --- /dev/null +++ b/cpp/src/sampling/random_walks_sg_v32_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/random_walks_sg_v64_e64.cu b/cpp/src/sampling/random_walks_sg_v64_e64.cu new file mode 100644 index 00000000000..0b9be107276 --- /dev/null +++ b/cpp/src/sampling/random_walks_sg_v64_e64.cu @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "sampling/random_walks_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +uniform_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +biased_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + float p, + float q, + uint64_t seed); + +template std::tuple, std::optional>> +node2vec_random_walks(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span start_vertices, + size_t max_length, + double p, + double q, + uint64_t seed); + +} // namespace cugraph diff --git a/cpp/src/sampling/renumber_sampled_edgelist_sg.cu b/cpp/src/sampling/renumber_sampled_edgelist_sg_v32_e32.cu similarity index 70% rename from cpp/src/sampling/renumber_sampled_edgelist_sg.cu rename to cpp/src/sampling/renumber_sampled_edgelist_sg_v32_e32.cu index c3aeb60e6bc..dee28c593ad 100644 --- a/cpp/src/sampling/renumber_sampled_edgelist_sg.cu +++ b/cpp/src/sampling/renumber_sampled_edgelist_sg_v32_e32.cu @@ -34,17 +34,4 @@ renumber_sampled_edgelist( label_offsets, bool do_expensive_check); -template std::tuple, - rmm::device_uvector, - rmm::device_uvector, - std::optional>> -renumber_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional> edgelist_hops, - std::optional, raft::device_span>> - label_offsets, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/sampling/renumber_sampled_edgelist_sg_v64_e64.cu b/cpp/src/sampling/renumber_sampled_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..99293c68f0c --- /dev/null +++ b/cpp/src/sampling/renumber_sampled_edgelist_sg_v64_e64.cu @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "renumber_sampled_edgelist_impl.cuh" + +#include + +// FIXME: deprecated, to be deleted +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + rmm::device_uvector, + std::optional>> +renumber_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional> edgelist_hops, + std::optional, raft::device_span>> + label_offsets, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/sampling_post_processing_sg.cu b/cpp/src/sampling/sampling_post_processing_sg.cu deleted file mode 100644 index 3c6734559ed..00000000000 --- a/cpp/src/sampling/sampling_post_processing_sg.cu +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "sampling_post_processing_impl.cuh" - -#include - -namespace cugraph { - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple>, - rmm::device_uvector, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_compress_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool compress_per_hop, - bool doubly_compress, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>, - rmm::device_uvector, - std::optional>> -renumber_and_sort_sampled_edgelist( - raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> seed_vertices, - std::optional> seed_vertex_label_offsets, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -sort_sampled_edgelist(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - std::optional>&& edgelist_hops, - std::optional> edgelist_label_offsets, - size_t num_labels, - size_t num_hops, - bool src_is_major, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/sampling/sampling_post_processing_sg_v32_e32.cu b/cpp/src/sampling/sampling_post_processing_sg_v32_e32.cu new file mode 100644 index 00000000000..6b8d8a07d92 --- /dev/null +++ b/cpp/src/sampling/sampling_post_processing_sg_v32_e32.cu @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "sampling_post_processing_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/sampling_post_processing_sg_v32_e64.cu b/cpp/src/sampling/sampling_post_processing_sg_v32_e64.cu new file mode 100644 index 00000000000..a4b083efd7c --- /dev/null +++ b/cpp/src/sampling/sampling_post_processing_sg_v32_e64.cu @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "sampling_post_processing_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/sampling_post_processing_sg_v64_e64.cu b/cpp/src/sampling/sampling_post_processing_sg_v64_e64.cu new file mode 100644 index 00000000000..a62ca2a0777 --- /dev/null +++ b/cpp/src/sampling/sampling_post_processing_sg_v64_e64.cu @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "sampling_post_processing_impl.cuh" + +#include + +namespace cugraph { + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple>, + rmm::device_uvector, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_compress_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool compress_per_hop, + bool doubly_compress, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + rmm::device_uvector, + std::optional>> +renumber_and_sort_sampled_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> seed_vertices, + std::optional> seed_vertex_label_offsets, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +sort_sampled_edgelist(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + std::optional>&& edgelist_hops, + std::optional> edgelist_label_offsets, + size_t num_labels, + size_t num_hops, + bool src_is_major, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e32.cpp b/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e32.cpp new file mode 100644 index 00000000000..3e816d8c9f9 --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e32.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e64.cpp b/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e64.cpp new file mode 100644 index 00000000000..3b1e6ba7d3e --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_mg_v32_e64.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_mg_v64_e64.cpp b/cpp/src/sampling/uniform_neighbor_sampling_mg_v64_e64.cpp new file mode 100644 index 00000000000..8989f5f4284 --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_mg_v64_e64.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e32.cpp b/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e32.cpp new file mode 100644 index 00000000000..2c32653eba8 --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e32.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e64.cpp b/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e64.cpp new file mode 100644 index 00000000000..23bb3137183 --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_sg_v32_e64.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/uniform_neighbor_sampling_sg_v64_e64.cpp b/cpp/src/sampling/uniform_neighbor_sampling_sg_v64_e64.cpp new file mode 100644 index 00000000000..eb35faada28 --- /dev/null +++ b/cpp/src/sampling/uniform_neighbor_sampling_sg_v64_e64.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022-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. + */ + +#include "uniform_neighbor_sampling_impl.hpp" + +#include + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>, + std::optional>> +uniform_neighbor_sample( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + raft::device_span starting_vertices, + std::optional> starting_vertex_labels, + std::optional, raft::device_span>> + label_to_output_comm_rank, + raft::host_span fan_out, + raft::random::RngState& rng_state, + bool return_hops, + bool with_replacement, + prior_sources_behavior_t prior_sources_behavior, + bool dedupe_sources, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_mg.cu b/cpp/src/structure/coarsen_graph_mg.cu deleted file mode 100644 index 776c3f603f3..00000000000 --- a/cpp/src/structure/coarsen_graph_mg.cu +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/coarsen_graph_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_mg_v32_e32.cu b/cpp/src/structure/coarsen_graph_mg_v32_e32.cu new file mode 100644 index 00000000000..de47527fc1e --- /dev/null +++ b/cpp/src/structure/coarsen_graph_mg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_mg_v32_e64.cu b/cpp/src/structure/coarsen_graph_mg_v32_e64.cu new file mode 100644 index 00000000000..c41d1071304 --- /dev/null +++ b/cpp/src/structure/coarsen_graph_mg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_mg_v64_e64.cu b/cpp/src/structure/coarsen_graph_mg_v64_e64.cu new file mode 100644 index 00000000000..623f2c38bd1 --- /dev/null +++ b/cpp/src/structure/coarsen_graph_mg_v64_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_sg.cu b/cpp/src/structure/coarsen_graph_sg.cu deleted file mode 100644 index fcd64276891..00000000000 --- a/cpp/src/structure/coarsen_graph_sg.cu +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/coarsen_graph_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int32_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -coarsen_graph(raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - int64_t const* labels, - bool renumber, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_sg_v32_e32.cu b/cpp/src/structure/coarsen_graph_sg_v32_e32.cu new file mode 100644 index 00000000000..5810280011d --- /dev/null +++ b/cpp/src/structure/coarsen_graph_sg_v32_e32.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_sg_v32_e64.cu b/cpp/src/structure/coarsen_graph_sg_v32_e64.cu new file mode 100644 index 00000000000..317bd5a3588 --- /dev/null +++ b/cpp/src/structure/coarsen_graph_sg_v32_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int32_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/coarsen_graph_sg_v64_e64.cu b/cpp/src/structure/coarsen_graph_sg_v64_e64.cu new file mode 100644 index 00000000000..65a5c29cce6 --- /dev/null +++ b/cpp/src/structure/coarsen_graph_sg_v64_e64.cu @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/coarsen_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +coarsen_graph(raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + int64_t const* labels, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_mg.cu b/cpp/src/structure/create_graph_from_edgelist_mg.cu deleted file mode 100644 index 8fb0272cef4..00000000000 --- a/cpp/src/structure/create_graph_from_edgelist_mg.cu +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/create_graph_from_edgelist_impl.cuh" - -namespace cugraph { - -// explicit instantiations - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_mg_v32_e32.cu b/cpp/src/structure/create_graph_from_edgelist_mg_v32_e32.cu new file mode 100644 index 00000000000..62eb4ccbd96 --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_mg_v32_e32.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_mg_v32_e64.cu b/cpp/src/structure/create_graph_from_edgelist_mg_v32_e64.cu new file mode 100644 index 00000000000..efbe8058c41 --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_mg_v32_e64.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_mg_v64_e64.cu b/cpp/src/structure/create_graph_from_edgelist_mg_v64_e64.cu new file mode 100644 index 00000000000..cc62166a7af --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_mg_v64_e64.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_sg.cu b/cpp/src/structure/create_graph_from_edgelist_sg.cu deleted file mode 100644 index 61ae77ccecd..00000000000 --- a/cpp/src/structure/create_graph_from_edgelist_sg.cu +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/create_graph_from_edgelist_impl.cuh" - -namespace cugraph { - -// explicit instantiations - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, float>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -template std::tuple< - cugraph::graph_t, - std::optional< - cugraph::edge_property_t, double>>, - std::optional< - cugraph::edge_property_t, int64_t>>, - std::optional< - cugraph::edge_property_t, int32_t>>, - std::optional>> -create_graph_from_edgelist( - raft::handle_t const& handle, - std::optional>&& vertex_span, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - graph_properties_t graph_properties, - bool renumber, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_sg_v32_e32.cu b/cpp/src/structure/create_graph_from_edgelist_sg_v32_e32.cu new file mode 100644 index 00000000000..34c91494c8b --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_sg_v32_e32.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_sg_v32_e64.cu b/cpp/src/structure/create_graph_from_edgelist_sg_v32_e64.cu new file mode 100644 index 00000000000..d09e50e0f81 --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_sg_v32_e64.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/create_graph_from_edgelist_sg_v64_e64.cu b/cpp/src/structure/create_graph_from_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..099c6801f0d --- /dev/null +++ b/cpp/src/structure/create_graph_from_edgelist_sg_v64_e64.cu @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/create_graph_from_edgelist_impl.cuh" + +namespace cugraph { + +// explicit instantiations + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, float>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +template std::tuple< + cugraph::graph_t, + std::optional< + cugraph::edge_property_t, double>>, + std::optional< + cugraph::edge_property_t, int64_t>>, + std::optional< + cugraph::edge_property_t, int32_t>>, + std::optional>> +create_graph_from_edgelist( + raft::handle_t const& handle, + std::optional>&& vertex_span, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + graph_properties_t graph_properties, + bool renumber, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_mg.cu b/cpp/src/structure/decompress_to_edgelist_mg.cu deleted file mode 100644 index f8177d0417d..00000000000 --- a/cpp/src/structure/decompress_to_edgelist_mg.cu +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/decompress_to_edgelist_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_mg_v32_e32.cu b/cpp/src/structure/decompress_to_edgelist_mg_v32_e32.cu new file mode 100644 index 00000000000..6eab5cd84a1 --- /dev/null +++ b/cpp/src/structure/decompress_to_edgelist_mg_v32_e32.cu @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/decompress_to_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_mg.cu b/cpp/src/structure/decompress_to_edgelist_mg_v32_e64.cu similarity index 50% rename from cpp/src/sampling/detail/gather_one_hop_edgelist_mg.cu rename to cpp/src/structure/decompress_to_edgelist_mg_v32_e64.cu index fa9e3b4fb51..082b058c3ae 100644 --- a/cpp/src/sampling/detail/gather_one_hop_edgelist_mg.cu +++ b/cpp/src/structure/decompress_to_edgelist_mg_v32_e64.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-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. @@ -13,107 +13,66 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" +#include "structure/decompress_to_edgelist_impl.cuh" namespace cugraph { -namespace detail { -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -gather_one_hop_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, - bool do_expensive_check); +// MG instantiation template std::tuple, rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -template std::tuple, - rmm::device_uvector, +template std::tuple, + rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, - graph_view_t const& graph_view, + graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -gather_one_hop_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -template std::tuple, - rmm::device_uvector, +template std::tuple, + rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, - graph_view_t const& graph_view, + graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -} // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_mg_v64_e64.cu b/cpp/src/structure/decompress_to_edgelist_mg_v64_e64.cu new file mode 100644 index 00000000000..52dae6a9ecf --- /dev/null +++ b/cpp/src/structure/decompress_to_edgelist_mg_v64_e64.cu @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/decompress_to_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_sg.cu b/cpp/src/structure/decompress_to_edgelist_sg.cu deleted file mode 100644 index f2c1e07fde6..00000000000 --- a/cpp/src/structure/decompress_to_edgelist_sg.cu +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/decompress_to_edgelist_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -decompress_to_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_type_view, - std::optional> renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_sg_v32_e32.cu b/cpp/src/structure/decompress_to_edgelist_sg_v32_e32.cu new file mode 100644 index 00000000000..05459cba181 --- /dev/null +++ b/cpp/src/structure/decompress_to_edgelist_sg_v32_e32.cu @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/decompress_to_edgelist_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/sampling/detail/gather_one_hop_edgelist_sg.cu b/cpp/src/structure/decompress_to_edgelist_sg_v32_e64.cu similarity index 50% rename from cpp/src/sampling/detail/gather_one_hop_edgelist_sg.cu rename to cpp/src/structure/decompress_to_edgelist_sg_v32_e64.cu index 32bf3f4a30f..035bea15e1c 100644 --- a/cpp/src/sampling/detail/gather_one_hop_edgelist_sg.cu +++ b/cpp/src/structure/decompress_to_edgelist_sg_v32_e64.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-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. @@ -13,107 +13,66 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include "sampling/detail/gather_one_hop_edgelist_impl.cuh" +#include "structure/decompress_to_edgelist_impl.cuh" namespace cugraph { -namespace detail { -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -gather_one_hop_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, - bool do_expensive_check); +// SG instantiation template std::tuple, rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -template std::tuple, - rmm::device_uvector, +template std::tuple, + rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, - graph_view_t const& graph_view, + graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>, - std::optional>> -gather_one_hop_edgelist( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); template std::tuple, rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -template std::tuple, - rmm::device_uvector, +template std::tuple, + rmm::device_uvector, std::optional>, std::optional>, - std::optional>, std::optional>> -gather_one_hop_edgelist( +decompress_to_edgelist( raft::handle_t const& handle, - graph_view_t const& graph_view, + graph_view_t const& graph_view, std::optional> edge_weight_view, std::optional> edge_id_view, - std::optional> edge_edge_type_view, - raft::device_span active_majors, - std::optional> active_major_labels, + std::optional> edge_type_view, + std::optional> renumber_map, bool do_expensive_check); -} // namespace detail } // namespace cugraph diff --git a/cpp/src/structure/decompress_to_edgelist_sg_v64_e64.cu b/cpp/src/structure/decompress_to_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..7621788bc70 --- /dev/null +++ b/cpp/src/structure/decompress_to_edgelist_sg_v64_e64.cu @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/decompress_to_edgelist_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +decompress_to_edgelist( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + std::optional> edge_id_view, + std::optional> edge_type_view, + std::optional> renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_mg.cu b/cpp/src/structure/graph_mg_v32_e32.cu similarity index 79% rename from cpp/src/structure/graph_mg.cu rename to cpp/src/structure/graph_mg_v32_e32.cu index b68e3fad719..ae443f041da 100644 --- a/cpp/src/structure/graph_mg.cu +++ b/cpp/src/structure/graph_mg_v32_e32.cu @@ -21,9 +21,5 @@ namespace cugraph { template class graph_t; template class graph_t; -template class graph_t; -template class graph_t; -template class graph_t; -template class graph_t; } // namespace cugraph diff --git a/cpp/src/structure/graph_mg_v32_e64.cu b/cpp/src/structure/graph_mg_v32_e64.cu new file mode 100644 index 00000000000..154ae2971dc --- /dev/null +++ b/cpp/src/structure/graph_mg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template class graph_t; +template class graph_t; + +} // namespace cugraph diff --git a/cpp/src/structure/graph_mg_v64_e64.cu b/cpp/src/structure/graph_mg_v64_e64.cu new file mode 100644 index 00000000000..f0f8d914090 --- /dev/null +++ b/cpp/src/structure/graph_mg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template class graph_t; +template class graph_t; + +} // namespace cugraph diff --git a/cpp/src/structure/graph_sg.cu b/cpp/src/structure/graph_sg_v32_e32.cu similarity index 78% rename from cpp/src/structure/graph_sg.cu rename to cpp/src/structure/graph_sg_v32_e32.cu index 93170690414..eed258e48ab 100644 --- a/cpp/src/structure/graph_sg.cu +++ b/cpp/src/structure/graph_sg_v32_e32.cu @@ -21,9 +21,5 @@ namespace cugraph { template class graph_t; template class graph_t; -template class graph_t; -template class graph_t; -template class graph_t; -template class graph_t; } // namespace cugraph diff --git a/cpp/src/structure/graph_sg_v32_e64.cu b/cpp/src/structure/graph_sg_v32_e64.cu new file mode 100644 index 00000000000..51f19cfc910 --- /dev/null +++ b/cpp/src/structure/graph_sg_v32_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template class graph_t; +template class graph_t; + +} // namespace cugraph diff --git a/cpp/src/structure/graph_sg_v64_e64.cu b/cpp/src/structure/graph_sg_v64_e64.cu new file mode 100644 index 00000000000..fd5eb53fa8f --- /dev/null +++ b/cpp/src/structure/graph_sg_v64_e64.cu @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template class graph_t; +template class graph_t; + +} // namespace cugraph diff --git a/cpp/src/structure/graph_view_mg_v32_e32.cu b/cpp/src/structure/graph_view_mg_v32_e32.cu new file mode 100644 index 00000000000..26a7db85577 --- /dev/null +++ b/cpp/src/structure/graph_view_mg_v32_e32.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_view_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template class graph_view_t; +template class graph_view_t; +} // namespace cugraph diff --git a/cpp/src/structure/graph_view_mg_v32_e64.cu b/cpp/src/structure/graph_view_mg_v32_e64.cu new file mode 100644 index 00000000000..1c6edc53706 --- /dev/null +++ b/cpp/src/structure/graph_view_mg_v32_e64.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_view_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template class graph_view_t; +template class graph_view_t; +} // namespace cugraph diff --git a/cpp/src/structure/graph_view_mg.cu b/cpp/src/structure/graph_view_mg_v64_e64.cu similarity index 77% rename from cpp/src/structure/graph_view_mg.cu rename to cpp/src/structure/graph_view_mg_v64_e64.cu index ce30ec285b9..befd3645abc 100644 --- a/cpp/src/structure/graph_view_mg.cu +++ b/cpp/src/structure/graph_view_mg_v64_e64.cu @@ -19,10 +19,6 @@ namespace cugraph { // MG instantiation -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; template class graph_view_t; template class graph_view_t; diff --git a/cpp/src/structure/graph_view_sg_v32_e32.cu b/cpp/src/structure/graph_view_sg_v32_e32.cu new file mode 100644 index 00000000000..3428bafe05d --- /dev/null +++ b/cpp/src/structure/graph_view_sg_v32_e32.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_view_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template class graph_view_t; +template class graph_view_t; +} // namespace cugraph diff --git a/cpp/src/structure/graph_view_sg_v32_e64.cu b/cpp/src/structure/graph_view_sg_v32_e64.cu new file mode 100644 index 00000000000..12b140e34a6 --- /dev/null +++ b/cpp/src/structure/graph_view_sg_v32_e64.cu @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_view_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template class graph_view_t; +template class graph_view_t; +} // namespace cugraph diff --git a/cpp/src/structure/graph_view_sg.cu b/cpp/src/structure/graph_view_sg_v64_e64.cu similarity index 77% rename from cpp/src/structure/graph_view_sg.cu rename to cpp/src/structure/graph_view_sg_v64_e64.cu index a671526ba9f..3f800d196d7 100644 --- a/cpp/src/structure/graph_view_sg.cu +++ b/cpp/src/structure/graph_view_sg_v64_e64.cu @@ -19,10 +19,6 @@ namespace cugraph { // SG instantiation -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; -template class graph_view_t; template class graph_view_t; template class graph_view_t; diff --git a/cpp/src/structure/graph_weight_utils_mg.cu b/cpp/src/structure/graph_weight_utils_mg.cu deleted file mode 100644 index 76e5f4b92fe..00000000000 --- a/cpp/src/structure/graph_weight_utils_mg.cu +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2020-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. - */ -#include "structure/graph_weight_utils_impl.cuh" - -namespace cugraph { - -// SG instantiation - -// compute_in_weight_sums - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_out_weight_sums - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_max_in_weight_sum - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_max_out_weight_sum - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_total_edge_weight - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_mg_v32_e32.cu b/cpp/src/structure/graph_weight_utils_mg_v32_e32.cu new file mode 100644 index 00000000000..f5b59f7f6cf --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_mg_v32_e32.cu @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_mg_v32_e64.cu b/cpp/src/structure/graph_weight_utils_mg_v32_e64.cu new file mode 100644 index 00000000000..a1fe84b2b85 --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_mg_v32_e64.cu @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_mg_v64_e64.cu b/cpp/src/structure/graph_weight_utils_mg_v64_e64.cu new file mode 100644 index 00000000000..b40f5527919 --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_mg_v64_e64.cu @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_out_weight_sums + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_max_in_weight_sum + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_max_out_weight_sum + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_total_edge_weight + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_sg.cu b/cpp/src/structure/graph_weight_utils_sg.cu deleted file mode 100644 index b2c55cff87f..00000000000 --- a/cpp/src/structure/graph_weight_utils_sg.cu +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 2020-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. - */ -#include "structure/graph_weight_utils_impl.cuh" - -namespace cugraph { - -// SG instantiation - -// compute_in_weight_sums - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_in_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_out_weight_sums - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector -compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector -compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector -compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template rmm::device_uvector compute_out_weight_sums( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_max_in_weight_sum - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_in_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_max_out_weight_sum - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_max_out_weight_sum( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -// compute_total_edge_weight - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template float compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -template double compute_total_edge_weight( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view); - -} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_sg_v32_e32.cu b/cpp/src/structure/graph_weight_utils_sg_v32_e32.cu new file mode 100644 index 00000000000..cb6fefa3c7f --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_sg_v32_e32.cu @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector +compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_sg_v32_e64.cu b/cpp/src/structure/graph_weight_utils_sg_v32_e64.cu new file mode 100644 index 00000000000..4d4ce7097bd --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_sg_v32_e64.cu @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector +compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/graph_weight_utils_sg_v64_e64.cu b/cpp/src/structure/graph_weight_utils_sg_v64_e64.cu new file mode 100644 index 00000000000..e60abf7a3d4 --- /dev/null +++ b/cpp/src/structure/graph_weight_utils_sg_v64_e64.cu @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2020-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. + */ +#include "structure/graph_weight_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +// compute_in_weight_sums + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_in_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_out_weight_sums + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector +compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template rmm::device_uvector compute_out_weight_sums( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_max_in_weight_sum + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_in_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_max_out_weight_sum + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_max_out_weight_sum( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +// compute_total_edge_weight + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template float compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +template double compute_total_edge_weight( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_mg.cu b/cpp/src/structure/induced_subgraph_mg.cu deleted file mode 100644 index 67ce627f769..00000000000 --- a/cpp/src/structure/induced_subgraph_mg.cu +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/induced_subgraph_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_mg_v32_e32.cu b/cpp/src/structure/induced_subgraph_mg_v32_e32.cu new file mode 100644 index 00000000000..880ba3a9f74 --- /dev/null +++ b/cpp/src/structure/induced_subgraph_mg_v32_e32.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_mg_v32_e64.cu b/cpp/src/structure/induced_subgraph_mg_v32_e64.cu new file mode 100644 index 00000000000..e83d101898f --- /dev/null +++ b/cpp/src/structure/induced_subgraph_mg_v32_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_mg_v64_e64.cu b/cpp/src/structure/induced_subgraph_mg_v64_e64.cu new file mode 100644 index 00000000000..774a95371bc --- /dev/null +++ b/cpp/src/structure/induced_subgraph_mg_v64_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_sg.cu b/cpp/src/structure/induced_subgraph_sg.cu deleted file mode 100644 index ee0aa0c91c1..00000000000 --- a/cpp/src/structure/induced_subgraph_sg.cu +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/induced_subgraph_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -template std::tuple, - rmm::device_uvector, - std::optional>, - rmm::device_uvector> -extract_induced_subgraphs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> edge_weight_view, - raft::device_span subgraph_offsets, - raft::device_span subgraph_vertices, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_sg_v32_e32.cu b/cpp/src/structure/induced_subgraph_sg_v32_e32.cu new file mode 100644 index 00000000000..694825f6b86 --- /dev/null +++ b/cpp/src/structure/induced_subgraph_sg_v32_e32.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_sg_v32_e64.cu b/cpp/src/structure/induced_subgraph_sg_v32_e64.cu new file mode 100644 index 00000000000..6a4c08f9682 --- /dev/null +++ b/cpp/src/structure/induced_subgraph_sg_v32_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/induced_subgraph_sg_v64_e64.cu b/cpp/src/structure/induced_subgraph_sg_v64_e64.cu new file mode 100644 index 00000000000..ddde4a04cb2 --- /dev/null +++ b/cpp/src/structure/induced_subgraph_sg_v64_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/induced_subgraph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +template std::tuple, + rmm::device_uvector, + std::optional>, + rmm::device_uvector> +extract_induced_subgraphs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> edge_weight_view, + raft::device_span subgraph_offsets, + raft::device_span subgraph_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/relabel_mg.cu b/cpp/src/structure/relabel_mg_v32_e32.cu similarity index 71% rename from cpp/src/structure/relabel_mg.cu rename to cpp/src/structure/relabel_mg_v32_e32.cu index 2c039d9d3d6..1f0da390640 100644 --- a/cpp/src/structure/relabel_mg.cu +++ b/cpp/src/structure/relabel_mg_v32_e32.cu @@ -28,12 +28,4 @@ template void relabel(raft::handle_t const& handle, bool skip_missing_labels, bool do_expensive_check); -template void relabel(raft::handle_t const& handle, - std::tuple old_new_label_pairs, - int64_t num_label_pairs, - int64_t* labels, - int64_t num_labels, - bool skip_missing_labels, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/relabel_mg_v64_e64.cu b/cpp/src/structure/relabel_mg_v64_e64.cu new file mode 100644 index 00000000000..182bc41da1b --- /dev/null +++ b/cpp/src/structure/relabel_mg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "structure/relabel_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void relabel(raft::handle_t const& handle, + std::tuple old_new_label_pairs, + int64_t num_label_pairs, + int64_t* labels, + int64_t num_labels, + bool skip_missing_labels, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/relabel_sg.cu b/cpp/src/structure/relabel_sg_v32_e32.cu similarity index 78% rename from cpp/src/structure/relabel_sg.cu rename to cpp/src/structure/relabel_sg_v32_e32.cu index f7416e723b8..2148dc78a2b 100644 --- a/cpp/src/structure/relabel_sg.cu +++ b/cpp/src/structure/relabel_sg_v32_e32.cu @@ -29,13 +29,4 @@ template void relabel( bool skip_missing_labels, bool do_expensive_check); -template void relabel( - raft::handle_t const& handle, - std::tuple old_new_label_pairs, - int64_t num_label_pairs, - int64_t* labels, - int64_t num_labels, - bool skip_missing_labels, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/relabel_sg_v64_e64.cu b/cpp/src/structure/relabel_sg_v64_e64.cu new file mode 100644 index 00000000000..72b7af75073 --- /dev/null +++ b/cpp/src/structure/relabel_sg_v64_e64.cu @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "structure/relabel_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void relabel( + raft::handle_t const& handle, + std::tuple old_new_label_pairs, + int64_t num_label_pairs, + int64_t* labels, + int64_t num_labels, + bool skip_missing_labels, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_multi_edges.cu b/cpp/src/structure/remove_multi_edges.cu deleted file mode 100644 index ae621a030bf..00000000000 --- a/cpp/src/structure/remove_multi_edges.cu +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ -#include "structure/remove_multi_edges_impl.cuh" - -namespace cugraph { - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_multi_edges(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types, - bool keep_min_value_edge); - -} // namespace cugraph diff --git a/cpp/src/structure/remove_multi_edges_sg_v32_e32.cu b/cpp/src/structure/remove_multi_edges_sg_v32_e32.cu new file mode 100644 index 00000000000..18b8da512f4 --- /dev/null +++ b/cpp/src/structure/remove_multi_edges_sg_v32_e32.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_multi_edges_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_multi_edges_sg_v32_e64.cu b/cpp/src/structure/remove_multi_edges_sg_v32_e64.cu new file mode 100644 index 00000000000..03b5a634158 --- /dev/null +++ b/cpp/src/structure/remove_multi_edges_sg_v32_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_multi_edges_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_multi_edges_sg_v64_e64.cu b/cpp/src/structure/remove_multi_edges_sg_v64_e64.cu new file mode 100644 index 00000000000..0dad6988a5c --- /dev/null +++ b/cpp/src/structure/remove_multi_edges_sg_v64_e64.cu @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_multi_edges_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_multi_edges(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types, + bool keep_min_value_edge); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_self_loops.cu b/cpp/src/structure/remove_self_loops.cu deleted file mode 100644 index 35375ea8603..00000000000 --- a/cpp/src/structure/remove_self_loops.cu +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ -#include "structure/remove_self_loops_impl.cuh" - -namespace cugraph { - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -remove_self_loops(raft::handle_t const& handle, - rmm::device_uvector&& edgelist_srcs, - rmm::device_uvector&& edgelist_dsts, - std::optional>&& edgelist_weights, - std::optional>&& edgelist_edge_ids, - std::optional>&& edgelist_edge_types); - -} // namespace cugraph diff --git a/cpp/src/structure/remove_self_loops_sg_v32_e32.cu b/cpp/src/structure/remove_self_loops_sg_v32_e32.cu new file mode 100644 index 00000000000..355eb846f29 --- /dev/null +++ b/cpp/src/structure/remove_self_loops_sg_v32_e32.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_self_loops_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_self_loops_sg_v32_e64.cu b/cpp/src/structure/remove_self_loops_sg_v32_e64.cu new file mode 100644 index 00000000000..0244e75353d --- /dev/null +++ b/cpp/src/structure/remove_self_loops_sg_v32_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_self_loops_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +} // namespace cugraph diff --git a/cpp/src/structure/remove_self_loops_sg_v64_e64.cu b/cpp/src/structure/remove_self_loops_sg_v64_e64.cu new file mode 100644 index 00000000000..76ae89387e4 --- /dev/null +++ b/cpp/src/structure/remove_self_loops_sg_v64_e64.cu @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023-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. + */ +#include "structure/remove_self_loops_impl.cuh" + +namespace cugraph { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +remove_self_loops(raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + std::optional>&& edgelist_edge_ids, + std::optional>&& edgelist_edge_types); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_mg.cu b/cpp/src/structure/renumber_edgelist_mg_v32_e32.cu similarity index 53% rename from cpp/src/structure/renumber_edgelist_mg.cu rename to cpp/src/structure/renumber_edgelist_mg_v32_e32.cu index 75b43056d26..fa1b29d5758 100644 --- a/cpp/src/structure/renumber_edgelist_mg.cu +++ b/cpp/src/structure/renumber_edgelist_mg_v32_e32.cu @@ -30,26 +30,4 @@ renumber_edgelist( bool store_transposed, bool do_expensive_check); -template std::tuple, renumber_meta_t> -renumber_edgelist( - raft::handle_t const& handle, - std::optional>&& local_vertices, - std::vector const& edgelist_srcs /* [INOUT] */, - std::vector const& edgelist_dsts /* [INOUT] */, - std::vector const& edgelist_edge_counts, - std::optional>> const& edgelist_intra_partition_segment_offsets, - bool store_transposed, - bool do_expensive_check); - -template std::tuple, renumber_meta_t> -renumber_edgelist( - raft::handle_t const& handle, - std::optional>&& local_vertices, - std::vector const& edgelist_srcs /* [INOUT] */, - std::vector const& edgelist_dsts /* [INOUT] */, - std::vector const& edgelist_edge_counts, - std::optional>> const& edgelist_intra_partition_segment_offsets, - bool store_transposed, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_mg_v32_e64.cu b/cpp/src/structure/renumber_edgelist_mg_v32_e64.cu new file mode 100644 index 00000000000..6d1414f918c --- /dev/null +++ b/cpp/src/structure/renumber_edgelist_mg_v32_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/renumber_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, renumber_meta_t> +renumber_edgelist( + raft::handle_t const& handle, + std::optional>&& local_vertices, + std::vector const& edgelist_srcs /* [INOUT] */, + std::vector const& edgelist_dsts /* [INOUT] */, + std::vector const& edgelist_edge_counts, + std::optional>> const& edgelist_intra_partition_segment_offsets, + bool store_transposed, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_mg_v64_e64.cu b/cpp/src/structure/renumber_edgelist_mg_v64_e64.cu new file mode 100644 index 00000000000..c5e3e427f0c --- /dev/null +++ b/cpp/src/structure/renumber_edgelist_mg_v64_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/renumber_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, renumber_meta_t> +renumber_edgelist( + raft::handle_t const& handle, + std::optional>&& local_vertices, + std::vector const& edgelist_srcs /* [INOUT] */, + std::vector const& edgelist_dsts /* [INOUT] */, + std::vector const& edgelist_edge_counts, + std::optional>> const& edgelist_intra_partition_segment_offsets, + bool store_transposed, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_sg.cu b/cpp/src/structure/renumber_edgelist_sg_v32_e32.cu similarity index 51% rename from cpp/src/structure/renumber_edgelist_sg.cu rename to cpp/src/structure/renumber_edgelist_sg_v32_e32.cu index 974a5cd3e7e..ac23ecd9967 100644 --- a/cpp/src/structure/renumber_edgelist_sg.cu +++ b/cpp/src/structure/renumber_edgelist_sg_v32_e32.cu @@ -28,22 +28,4 @@ renumber_edgelist(raft::handle_t const& handle, bool store_transposed, bool do_expensive_check); -template std::tuple, renumber_meta_t> -renumber_edgelist(raft::handle_t const& handle, - std::optional>&& vertices, - int32_t* edgelist_srcs /* [INOUT] */, - int32_t* edgelist_dsts /* [INOUT] */, - int64_t num_edgelist_edges, - bool store_transposed, - bool do_expensive_check); - -template std::tuple, renumber_meta_t> -renumber_edgelist(raft::handle_t const& handle, - std::optional>&& vertices, - int64_t* edgelist_srcs /* [INOUT] */, - int64_t* edgelist_dsts /* [INOUT] */, - int64_t num_edgelist_edges, - bool store_transposed, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_sg_v32_e64.cu b/cpp/src/structure/renumber_edgelist_sg_v32_e64.cu new file mode 100644 index 00000000000..5214ec15f3e --- /dev/null +++ b/cpp/src/structure/renumber_edgelist_sg_v32_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/renumber_edgelist_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, renumber_meta_t> +renumber_edgelist(raft::handle_t const& handle, + std::optional>&& vertices, + int32_t* edgelist_srcs /* [INOUT] */, + int32_t* edgelist_dsts /* [INOUT] */, + int64_t num_edgelist_edges, + bool store_transposed, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_edgelist_sg_v64_e64.cu b/cpp/src/structure/renumber_edgelist_sg_v64_e64.cu new file mode 100644 index 00000000000..a9252887d0c --- /dev/null +++ b/cpp/src/structure/renumber_edgelist_sg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/renumber_edgelist_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, renumber_meta_t> +renumber_edgelist(raft::handle_t const& handle, + std::optional>&& vertices, + int64_t* edgelist_srcs /* [INOUT] */, + int64_t* edgelist_dsts /* [INOUT] */, + int64_t num_edgelist_edges, + bool store_transposed, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_utils_mg.cu b/cpp/src/structure/renumber_utils_mg_v32_e32.cu similarity index 56% rename from cpp/src/structure/renumber_utils_mg.cu rename to cpp/src/structure/renumber_utils_mg_v32_e32.cu index 32fdafe280f..93b18aeab86 100644 --- a/cpp/src/structure/renumber_utils_mg.cu +++ b/cpp/src/structure/renumber_utils_mg_v32_e32.cu @@ -28,14 +28,6 @@ template void renumber_ext_vertices(raft::handle_t const& handle, int32_t local_int_vertex_last, bool do_expensive_check); -template void renumber_ext_vertices(raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - int64_t local_int_vertex_first, - int64_t local_int_vertex_last, - bool do_expensive_check); - template void renumber_local_ext_vertices(raft::handle_t const& handle, int32_t* vertices, size_t num_vertices, @@ -44,14 +36,6 @@ template void renumber_local_ext_vertices(raft::handle_t const& h int32_t local_int_vertex_last, bool do_expensive_check); -template void renumber_local_ext_vertices(raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - int64_t local_int_vertex_first, - int64_t local_int_vertex_last, - bool do_expensive_check); - template void unrenumber_int_vertices( raft::handle_t const& handle, int32_t* vertices, @@ -60,14 +44,6 @@ template void unrenumber_int_vertices( std::vector const& vertex_partition_range_lasts, bool do_expensive_check); -template void unrenumber_int_vertices( - raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - std::vector const& vertex_partition_range_lasts, - bool do_expensive_check); - template void unrenumber_local_int_edges( raft::handle_t const& handle, std::vector const& edgelist_srcs /* [INOUT] */, @@ -88,24 +64,4 @@ template void unrenumber_local_int_edges( std::optional>> const& edgelist_intra_partition_segment_offsets, bool do_expensive_check); -template void unrenumber_local_int_edges( - raft::handle_t const& handle, - std::vector const& edgelist_srcs /* [INOUT] */, - std::vector const& edgelist_dsts /* [INOUT] */, - std::vector const& edgelist_edge_counts, - int64_t const* renumber_map_labels, - std::vector const& vertex_partition_range_lasts, - std::optional>> const& edgelist_intra_partition_segment_offsets, - bool do_expensive_check); - -template void unrenumber_local_int_edges( - raft::handle_t const& handle, - std::vector const& edgelist_srcs /* [INOUT] */, - std::vector const& edgelist_dsts /* [INOUT] */, - std::vector const& edgelist_edge_counts, - int64_t const* renumber_map_labels, - std::vector const& vertex_partition_range_lasts, - std::optional>> const& edgelist_intra_partition_segment_offsets, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/renumber_utils_mg_v64_e64.cu b/cpp/src/structure/renumber_utils_mg_v64_e64.cu new file mode 100644 index 00000000000..d528ade2a4c --- /dev/null +++ b/cpp/src/structure/renumber_utils_mg_v64_e64.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "structure/renumber_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void renumber_ext_vertices(raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + int64_t local_int_vertex_first, + int64_t local_int_vertex_last, + bool do_expensive_check); + +template void renumber_local_ext_vertices(raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + int64_t local_int_vertex_first, + int64_t local_int_vertex_last, + bool do_expensive_check); + +template void unrenumber_int_vertices( + raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + std::vector const& vertex_partition_range_lasts, + bool do_expensive_check); + +template void unrenumber_local_int_edges( + raft::handle_t const& handle, + std::vector const& edgelist_srcs /* [INOUT] */, + std::vector const& edgelist_dsts /* [INOUT] */, + std::vector const& edgelist_edge_counts, + int64_t const* renumber_map_labels, + std::vector const& vertex_partition_range_lasts, + std::optional>> const& edgelist_intra_partition_segment_offsets, + bool do_expensive_check); + +template void unrenumber_local_int_edges( + raft::handle_t const& handle, + std::vector const& edgelist_srcs /* [INOUT] */, + std::vector const& edgelist_dsts /* [INOUT] */, + std::vector const& edgelist_edge_counts, + int64_t const* renumber_map_labels, + std::vector const& vertex_partition_range_lasts, + std::optional>> const& edgelist_intra_partition_segment_offsets, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/renumber_utils_sg.cu b/cpp/src/structure/renumber_utils_sg_v32_e32.cu similarity index 55% rename from cpp/src/structure/renumber_utils_sg.cu rename to cpp/src/structure/renumber_utils_sg_v32_e32.cu index e39bb30a960..c1f4807d4a5 100644 --- a/cpp/src/structure/renumber_utils_sg.cu +++ b/cpp/src/structure/renumber_utils_sg_v32_e32.cu @@ -28,14 +28,6 @@ template void renumber_ext_vertices(raft::handle_t const& handle int32_t local_int_vertex_last, bool do_expensive_check); -template void renumber_ext_vertices(raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - int64_t local_int_vertex_first, - int64_t local_int_vertex_last, - bool do_expensive_check); - template void renumber_local_ext_vertices(raft::handle_t const& handle, int32_t* vertices, size_t num_vertices, @@ -44,14 +36,6 @@ template void renumber_local_ext_vertices(raft::handle_t const& int32_t local_int_vertex_last, bool do_expensive_check); -template void renumber_local_ext_vertices(raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - int64_t local_int_vertex_first, - int64_t local_int_vertex_last, - bool do_expensive_check); - template void unrenumber_local_int_vertices(raft::handle_t const& handle, int32_t* vertices, size_t num_vertices, @@ -60,14 +44,6 @@ template void unrenumber_local_int_vertices(raft::handle_t const& handl int32_t local_int_vertex_last, bool do_expensive_check); -template void unrenumber_local_int_vertices(raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - int64_t local_int_vertex_first, - int64_t local_int_vertex_last, - bool do_expensive_check); - template void unrenumber_int_vertices( raft::handle_t const& handle, int32_t* vertices, @@ -76,14 +52,6 @@ template void unrenumber_int_vertices( std::vector const& vertex_partition_range_lasts, bool do_expensive_check); -template void unrenumber_int_vertices( - raft::handle_t const& handle, - int64_t* vertices, - size_t num_vertices, - int64_t const* renumber_map_labels, - std::vector const& vertex_partition_range_lasts, - bool do_expensive_check); - template void unrenumber_local_int_edges( raft::handle_t const& handle, int32_t* edgelist_srcs /* [INOUT] */, @@ -101,21 +69,4 @@ template void unrenumber_local_int_edges(raft::handle_t co int32_t num_vertices, bool do_expensive_check); -template void unrenumber_local_int_edges( - raft::handle_t const& handle, - int64_t* edgelist_srcs /* [INOUT] */, - int64_t* edgelist_dsts /* [INOUT] */, - size_t num_edgelist_edges, - int64_t const* renumber_map_labels, - int64_t num_vertices, - bool do_expensive_check); - -template void unrenumber_local_int_edges(raft::handle_t const& handle, - int64_t* edgelist_srcs /* [INOUT] */, - int64_t* edgelist_dsts /* [INOUT] */, - size_t num_edgelist_edges, - int64_t const* renumber_map_labels, - int64_t num_vertices, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/structure/renumber_utils_sg_v64_e64.cu b/cpp/src/structure/renumber_utils_sg_v64_e64.cu new file mode 100644 index 00000000000..7a6e5d368a9 --- /dev/null +++ b/cpp/src/structure/renumber_utils_sg_v64_e64.cu @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "structure/renumber_utils_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void renumber_ext_vertices(raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + int64_t local_int_vertex_first, + int64_t local_int_vertex_last, + bool do_expensive_check); + +template void renumber_local_ext_vertices(raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + int64_t local_int_vertex_first, + int64_t local_int_vertex_last, + bool do_expensive_check); + +template void unrenumber_local_int_vertices(raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + int64_t local_int_vertex_first, + int64_t local_int_vertex_last, + bool do_expensive_check); + +template void unrenumber_int_vertices( + raft::handle_t const& handle, + int64_t* vertices, + size_t num_vertices, + int64_t const* renumber_map_labels, + std::vector const& vertex_partition_range_lasts, + bool do_expensive_check); + +template void unrenumber_local_int_edges( + raft::handle_t const& handle, + int64_t* edgelist_srcs /* [INOUT] */, + int64_t* edgelist_dsts /* [INOUT] */, + size_t num_edgelist_edges, + int64_t const* renumber_map_labels, + int64_t num_vertices, + bool do_expensive_check); + +template void unrenumber_local_int_edges(raft::handle_t const& handle, + int64_t* edgelist_srcs /* [INOUT] */, + int64_t* edgelist_dsts /* [INOUT] */, + size_t num_edgelist_edges, + int64_t const* renumber_map_labels, + int64_t num_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_mg.cu b/cpp/src/structure/select_random_vertices_mg.cu deleted file mode 100644 index 79777be7b3d..00000000000 --- a/cpp/src/structure/select_random_vertices_mg.cu +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "structure/select_random_vertices_impl.hpp" - -namespace cugraph { - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_mg_v32_e32.cu b/cpp/src/structure/select_random_vertices_mg_v32_e32.cu new file mode 100644 index 00000000000..532f3f019bd --- /dev/null +++ b/cpp/src/structure/select_random_vertices_mg_v32_e32.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_mg_v32_e64.cu b/cpp/src/structure/select_random_vertices_mg_v32_e64.cu new file mode 100644 index 00000000000..16b5243bcd4 --- /dev/null +++ b/cpp/src/structure/select_random_vertices_mg_v32_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_mg_v64_e64.cu b/cpp/src/structure/select_random_vertices_mg_v64_e64.cu new file mode 100644 index 00000000000..16c18bfd827 --- /dev/null +++ b/cpp/src/structure/select_random_vertices_mg_v64_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_sg.cu b/cpp/src/structure/select_random_vertices_sg.cu deleted file mode 100644 index 701852a5111..00000000000 --- a/cpp/src/structure/select_random_vertices_sg.cu +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ - -#include "structure/select_random_vertices_impl.hpp" - -namespace cugraph { - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -template rmm::device_uvector select_random_vertices( - raft::handle_t const& handle, - graph_view_t const& graph_view, - std::optional> given_set, - raft::random::RngState& rng_state, - size_t select_count, - bool with_replacement, - bool sort_vertices, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_sg_v32_e32.cu b/cpp/src/structure/select_random_vertices_sg_v32_e32.cu new file mode 100644 index 00000000000..7205d2ef305 --- /dev/null +++ b/cpp/src/structure/select_random_vertices_sg_v32_e32.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_sg_v32_e64.cu b/cpp/src/structure/select_random_vertices_sg_v32_e64.cu new file mode 100644 index 00000000000..21842ba76f8 --- /dev/null +++ b/cpp/src/structure/select_random_vertices_sg_v32_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/select_random_vertices_sg_v64_e64.cu b/cpp/src/structure/select_random_vertices_sg_v64_e64.cu new file mode 100644 index 00000000000..bbfdbd895c0 --- /dev/null +++ b/cpp/src/structure/select_random_vertices_sg_v64_e64.cu @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023-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. + */ + +#include "structure/select_random_vertices_impl.hpp" + +namespace cugraph { + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +template rmm::device_uvector select_random_vertices( + raft::handle_t const& handle, + graph_view_t const& graph_view, + std::optional> given_set, + raft::random::RngState& rng_state, + size_t select_count, + bool with_replacement, + bool sort_vertices, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_edgelist_mg_v32_e32.cu b/cpp/src/structure/symmetrize_edgelist_mg_v32_e32.cu new file mode 100644 index 00000000000..da744a410c0 --- /dev/null +++ b/cpp/src/structure/symmetrize_edgelist_mg_v32_e32.cu @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_edgelist_mg_v64_e64.cu b/cpp/src/structure/symmetrize_edgelist_mg_v64_e64.cu new file mode 100644 index 00000000000..c4192fef43b --- /dev/null +++ b/cpp/src/structure/symmetrize_edgelist_mg_v64_e64.cu @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_edgelist_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +template std::tuple, + rmm::device_uvector, + std::optional>> +symmetrize_edgelist( + raft::handle_t const& handle, + rmm::device_uvector&& edgelist_srcs, + rmm::device_uvector&& edgelist_dsts, + std::optional>&& edgelist_weights, + bool reciprocal); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_edgelist_sg.cu b/cpp/src/structure/symmetrize_edgelist_sg_v32_e32.cu similarity index 100% rename from cpp/src/structure/symmetrize_edgelist_sg.cu rename to cpp/src/structure/symmetrize_edgelist_sg_v32_e32.cu diff --git a/cpp/src/structure/symmetrize_edgelist_mg.cu b/cpp/src/structure/symmetrize_edgelist_sg_v64_e64.cu similarity index 89% rename from cpp/src/structure/symmetrize_edgelist_mg.cu rename to cpp/src/structure/symmetrize_edgelist_sg_v64_e64.cu index 657da529483..6b446627b3f 100644 --- a/cpp/src/structure/symmetrize_edgelist_mg.cu +++ b/cpp/src/structure/symmetrize_edgelist_sg_v64_e64.cu @@ -17,12 +17,12 @@ namespace cugraph { -// MG instantiation +// SG instantiation template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -32,7 +32,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -42,7 +42,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -52,7 +52,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -62,7 +62,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -72,7 +72,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -82,7 +82,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, @@ -92,7 +92,7 @@ symmetrize_edgelist( template std::tuple, rmm::device_uvector, std::optional>> -symmetrize_edgelist( +symmetrize_edgelist( raft::handle_t const& handle, rmm::device_uvector&& edgelist_srcs, rmm::device_uvector&& edgelist_dsts, diff --git a/cpp/src/structure/symmetrize_graph_mg.cu b/cpp/src/structure/symmetrize_graph_mg.cu deleted file mode 100644 index f4d81b3f144..00000000000 --- a/cpp/src/structure/symmetrize_graph_mg.cu +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/symmetrize_graph_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_mg_v32_e32.cu b/cpp/src/structure/symmetrize_graph_mg_v32_e32.cu new file mode 100644 index 00000000000..e1324cbe221 --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_mg_v32_e32.cu @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_mg_v32_e64.cu b/cpp/src/structure/symmetrize_graph_mg_v32_e64.cu new file mode 100644 index 00000000000..db077e676bd --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_mg_v32_e64.cu @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_mg_v64_e64.cu b/cpp/src/structure/symmetrize_graph_mg_v64_e64.cu new file mode 100644 index 00000000000..466c97be323 --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_mg_v64_e64.cu @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_sg.cu b/cpp/src/structure/symmetrize_graph_sg.cu deleted file mode 100644 index def1ab9f0c0..00000000000 --- a/cpp/src/structure/symmetrize_graph_sg.cu +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/symmetrize_graph_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -symmetrize_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool reciprocal, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_sg_v32_e32.cu b/cpp/src/structure/symmetrize_graph_sg_v32_e32.cu new file mode 100644 index 00000000000..acc415c524c --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_sg_v32_e32.cu @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_sg_v32_e64.cu b/cpp/src/structure/symmetrize_graph_sg_v32_e64.cu new file mode 100644 index 00000000000..a819207874d --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_sg_v32_e64.cu @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/symmetrize_graph_sg_v64_e64.cu b/cpp/src/structure/symmetrize_graph_sg_v64_e64.cu new file mode 100644 index 00000000000..1b39157f7ed --- /dev/null +++ b/cpp/src/structure/symmetrize_graph_sg_v64_e64.cu @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/symmetrize_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +symmetrize_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool reciprocal, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_mg.cu b/cpp/src/structure/transpose_graph_mg.cu deleted file mode 100644 index 075ce63f3d7..00000000000 --- a/cpp/src/structure/transpose_graph_mg.cu +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/transpose_graph_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_mg_v32_e32.cu b/cpp/src/structure/transpose_graph_mg_v32_e32.cu new file mode 100644 index 00000000000..362ac1bc20c --- /dev/null +++ b/cpp/src/structure/transpose_graph_mg_v32_e32.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_mg_v32_e64.cu b/cpp/src/structure/transpose_graph_mg_v32_e64.cu new file mode 100644 index 00000000000..6bf9b9e4011 --- /dev/null +++ b/cpp/src/structure/transpose_graph_mg_v32_e64.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_mg_v64_e64.cu b/cpp/src/structure/transpose_graph_mg_v64_e64.cu new file mode 100644 index 00000000000..7188754d83d --- /dev/null +++ b/cpp/src/structure/transpose_graph_mg_v64_e64.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_sg.cu b/cpp/src/structure/transpose_graph_sg.cu deleted file mode 100644 index 82a980736e3..00000000000 --- a/cpp/src/structure/transpose_graph_sg.cu +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/transpose_graph_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_sg_v32_e32.cu b/cpp/src/structure/transpose_graph_sg_v32_e32.cu new file mode 100644 index 00000000000..b198b5d5cd9 --- /dev/null +++ b/cpp/src/structure/transpose_graph_sg_v32_e32.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_sg_v32_e64.cu b/cpp/src/structure/transpose_graph_sg_v32_e64.cu new file mode 100644 index 00000000000..af64aa7b20b --- /dev/null +++ b/cpp/src/structure/transpose_graph_sg_v32_e64.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_sg_v64_e64.cu b/cpp/src/structure/transpose_graph_sg_v64_e64.cu new file mode 100644 index 00000000000..d4a33e3e3ce --- /dev/null +++ b/cpp/src/structure/transpose_graph_sg_v64_e64.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_mg.cu b/cpp/src/structure/transpose_graph_storage_mg.cu deleted file mode 100644 index c9c4dc89374..00000000000 --- a/cpp/src/structure/transpose_graph_storage_mg.cu +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/transpose_graph_storage_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_mg_v32_e32.cu b/cpp/src/structure/transpose_graph_storage_mg_v32_e32.cu new file mode 100644 index 00000000000..de1ab744c82 --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_mg_v32_e32.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_mg_v32_e64.cu b/cpp/src/structure/transpose_graph_storage_mg_v32_e64.cu new file mode 100644 index 00000000000..15488e2ba17 --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_mg_v32_e64.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_mg_v64_e64.cu b/cpp/src/structure/transpose_graph_storage_mg_v64_e64.cu new file mode 100644 index 00000000000..393ebac77fd --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_mg_v64_e64.cu @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_sg.cu b/cpp/src/structure/transpose_graph_storage_sg.cu deleted file mode 100644 index d4691847570..00000000000 --- a/cpp/src/structure/transpose_graph_storage_sg.cu +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "structure/transpose_graph_storage_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, float>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, float>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -template std::tuple< - graph_t, - std::optional, double>>, - std::optional>> -transpose_graph_storage( - raft::handle_t const& handle, - graph_t&& graph, - std::optional, double>>&& - edge_weights, - std::optional>&& renumber_map, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_sg_v32_e32.cu b/cpp/src/structure/transpose_graph_storage_sg_v32_e32.cu new file mode 100644 index 00000000000..1b3ea9b6a14 --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_sg_v32_e32.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_sg_v32_e64.cu b/cpp/src/structure/transpose_graph_storage_sg_v32_e64.cu new file mode 100644 index 00000000000..ac8787582dd --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_sg_v32_e64.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/structure/transpose_graph_storage_sg_v64_e64.cu b/cpp/src/structure/transpose_graph_storage_sg_v64_e64.cu new file mode 100644 index 00000000000..9a808e243c2 --- /dev/null +++ b/cpp/src/structure/transpose_graph_storage_sg_v64_e64.cu @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2021-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. + */ +#include "structure/transpose_graph_storage_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, float>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, float>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +template std::tuple< + graph_t, + std::optional, double>>, + std::optional>> +transpose_graph_storage( + raft::handle_t const& handle, + graph_t&& graph, + std::optional, double>>&& + edge_weights, + std::optional>&& renumber_map, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/bfs_mg.cu b/cpp/src/traversal/bfs_mg_v32_e32.cu similarity index 57% rename from cpp/src/traversal/bfs_mg.cu rename to cpp/src/traversal/bfs_mg_v32_e32.cu index 9a8b724b4a4..11b9d74809a 100644 --- a/cpp/src/traversal/bfs_mg.cu +++ b/cpp/src/traversal/bfs_mg_v32_e32.cu @@ -30,24 +30,4 @@ template void bfs(raft::handle_t const& handle, int32_t depth_limit, bool do_expensive_check); -template void bfs(raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t* distances, - int32_t* predecessors, - int32_t const* sources, - size_t n_sources, - bool direction_optimizing, - int32_t depth_limit, - bool do_expensive_check); - -template void bfs(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* distances, - int64_t* predecessors, - int64_t const* sources, - size_t n_sources, - bool direction_optimizing, - int64_t depth_limit, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/traversal/bfs_mg_v32_e64.cu b/cpp/src/traversal/bfs_mg_v32_e64.cu new file mode 100644 index 00000000000..5fde01e0fcc --- /dev/null +++ b/cpp/src/traversal/bfs_mg_v32_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/bfs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void bfs(raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t* distances, + int32_t* predecessors, + int32_t const* sources, + size_t n_sources, + bool direction_optimizing, + int32_t depth_limit, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/bfs_mg_v64_e64.cu b/cpp/src/traversal/bfs_mg_v64_e64.cu new file mode 100644 index 00000000000..3798bec0fc8 --- /dev/null +++ b/cpp/src/traversal/bfs_mg_v64_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/bfs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void bfs(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* distances, + int64_t* predecessors, + int64_t const* sources, + size_t n_sources, + bool direction_optimizing, + int64_t depth_limit, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/bfs_sg.cu b/cpp/src/traversal/bfs_sg_v32_e32.cu similarity index 57% rename from cpp/src/traversal/bfs_sg.cu rename to cpp/src/traversal/bfs_sg_v32_e32.cu index b56a62aa762..e19d52fe6f9 100644 --- a/cpp/src/traversal/bfs_sg.cu +++ b/cpp/src/traversal/bfs_sg_v32_e32.cu @@ -30,24 +30,4 @@ template void bfs(raft::handle_t const& handle, int32_t depth_limit, bool do_expensive_check); -template void bfs(raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t* distances, - int32_t* predecessors, - int32_t const* sources, - size_t n_sources, - bool direction_optimizing, - int32_t depth_limit, - bool do_expensive_check); - -template void bfs(raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t* distances, - int64_t* predecessors, - int64_t const* sources, - size_t n_sources, - bool direction_optimizing, - int64_t depth_limit, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/traversal/bfs_sg_v32_e64.cu b/cpp/src/traversal/bfs_sg_v32_e64.cu new file mode 100644 index 00000000000..3a6a7ef01de --- /dev/null +++ b/cpp/src/traversal/bfs_sg_v32_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/bfs_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void bfs(raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t* distances, + int32_t* predecessors, + int32_t const* sources, + size_t n_sources, + bool direction_optimizing, + int32_t depth_limit, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/bfs_sg_v64_e64.cu b/cpp/src/traversal/bfs_sg_v64_e64.cu new file mode 100644 index 00000000000..dd10e2873cf --- /dev/null +++ b/cpp/src/traversal/bfs_sg_v64_e64.cu @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/bfs_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void bfs(raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t* distances, + int64_t* predecessors, + int64_t const* sources, + size_t n_sources, + bool direction_optimizing, + int64_t depth_limit, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_mg.cu b/cpp/src/traversal/extract_bfs_paths_mg_v32_e32.cu similarity index 63% rename from cpp/src/traversal/extract_bfs_paths_mg.cu rename to cpp/src/traversal/extract_bfs_paths_mg_v32_e32.cu index ee3237b4773..3c7e9e28136 100644 --- a/cpp/src/traversal/extract_bfs_paths_mg.cu +++ b/cpp/src/traversal/extract_bfs_paths_mg_v32_e32.cu @@ -28,20 +28,4 @@ template std::tuple, int32_t> extract_bfs_paths( int32_t const* destinations, size_t n_destinations); -template std::tuple, int32_t> extract_bfs_paths( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t const* distances, - int32_t const* predecessors, - int32_t const* destinations, - size_t n_destinations); - -template std::tuple, int64_t> extract_bfs_paths( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t const* distances, - int64_t const* predecessors, - int64_t const* destinations, - size_t n_destinations); - } // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_mg_v32_e64.cu b/cpp/src/traversal/extract_bfs_paths_mg_v32_e64.cu new file mode 100644 index 00000000000..00aacc50c47 --- /dev/null +++ b/cpp/src/traversal/extract_bfs_paths_mg_v32_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/extract_bfs_paths_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, int32_t> extract_bfs_paths( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t const* distances, + int32_t const* predecessors, + int32_t const* destinations, + size_t n_destinations); + +} // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_mg_v64_e64.cu b/cpp/src/traversal/extract_bfs_paths_mg_v64_e64.cu new file mode 100644 index 00000000000..a76eb3d59fd --- /dev/null +++ b/cpp/src/traversal/extract_bfs_paths_mg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/extract_bfs_paths_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, int64_t> extract_bfs_paths( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t const* distances, + int64_t const* predecessors, + int64_t const* destinations, + size_t n_destinations); + +} // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_sg.cu b/cpp/src/traversal/extract_bfs_paths_sg_v32_e32.cu similarity index 63% rename from cpp/src/traversal/extract_bfs_paths_sg.cu rename to cpp/src/traversal/extract_bfs_paths_sg_v32_e32.cu index d4c8a5fd404..e717b624772 100644 --- a/cpp/src/traversal/extract_bfs_paths_sg.cu +++ b/cpp/src/traversal/extract_bfs_paths_sg_v32_e32.cu @@ -28,20 +28,4 @@ template std::tuple, int32_t> extract_bfs_paths( int32_t const* destinations, size_t n_destinations); -template std::tuple, int32_t> extract_bfs_paths( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int32_t const* distances, - int32_t const* predecessors, - int32_t const* destinations, - size_t n_destinations); - -template std::tuple, int64_t> extract_bfs_paths( - raft::handle_t const& handle, - graph_view_t const& graph_view, - int64_t const* distances, - int64_t const* predecessors, - int64_t const* destinations, - size_t n_destinations); - } // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_sg_v32_e64.cu b/cpp/src/traversal/extract_bfs_paths_sg_v32_e64.cu new file mode 100644 index 00000000000..369ae9efa1a --- /dev/null +++ b/cpp/src/traversal/extract_bfs_paths_sg_v32_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/extract_bfs_paths_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, int32_t> extract_bfs_paths( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int32_t const* distances, + int32_t const* predecessors, + int32_t const* destinations, + size_t n_destinations); + +} // namespace cugraph diff --git a/cpp/src/traversal/extract_bfs_paths_sg_v64_e64.cu b/cpp/src/traversal/extract_bfs_paths_sg_v64_e64.cu new file mode 100644 index 00000000000..635d7e910c7 --- /dev/null +++ b/cpp/src/traversal/extract_bfs_paths_sg_v64_e64.cu @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "traversal/extract_bfs_paths_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template std::tuple, int64_t> extract_bfs_paths( + raft::handle_t const& handle, + graph_view_t const& graph_view, + int64_t const* distances, + int64_t const* predecessors, + int64_t const* destinations, + size_t n_destinations); + +} // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_mg.cu b/cpp/src/traversal/k_hop_nbrs_mg_v32_e32.cu similarity index 64% rename from cpp/src/traversal/k_hop_nbrs_mg.cu rename to cpp/src/traversal/k_hop_nbrs_mg_v32_e32.cu index 200d943a477..876d308db31 100644 --- a/cpp/src/traversal/k_hop_nbrs_mg.cu +++ b/cpp/src/traversal/k_hop_nbrs_mg_v32_e32.cu @@ -26,18 +26,4 @@ template std::tuple, rmm::device_uvector> k size_t k, bool do_expensive_check); -template std::tuple, rmm::device_uvector> k_hop_nbrs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::device_span start_vertices, - size_t k, - bool do_expensive_check); - -template std::tuple, rmm::device_uvector> k_hop_nbrs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::device_span start_vertices, - size_t k, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_mg_v32_e64.cu b/cpp/src/traversal/k_hop_nbrs_mg_v32_e64.cu new file mode 100644 index 00000000000..31049883166 --- /dev/null +++ b/cpp/src/traversal/k_hop_nbrs_mg_v32_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022-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. + */ +#include "traversal/k_hop_nbrs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, rmm::device_uvector> k_hop_nbrs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::device_span start_vertices, + size_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_mg_v64_e64.cu b/cpp/src/traversal/k_hop_nbrs_mg_v64_e64.cu new file mode 100644 index 00000000000..84e93a3e7da --- /dev/null +++ b/cpp/src/traversal/k_hop_nbrs_mg_v64_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022-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. + */ +#include "traversal/k_hop_nbrs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, rmm::device_uvector> k_hop_nbrs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::device_span start_vertices, + size_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_sg.cu b/cpp/src/traversal/k_hop_nbrs_sg_v32_e32.cu similarity index 64% rename from cpp/src/traversal/k_hop_nbrs_sg.cu rename to cpp/src/traversal/k_hop_nbrs_sg_v32_e32.cu index 2a57224b188..75f30d3d16d 100644 --- a/cpp/src/traversal/k_hop_nbrs_sg.cu +++ b/cpp/src/traversal/k_hop_nbrs_sg_v32_e32.cu @@ -26,18 +26,4 @@ template std::tuple, rmm::device_uvector> k size_t k, bool do_expensive_check); -template std::tuple, rmm::device_uvector> k_hop_nbrs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::device_span start_vertices, - size_t k, - bool do_expensive_check); - -template std::tuple, rmm::device_uvector> k_hop_nbrs( - raft::handle_t const& handle, - graph_view_t const& graph_view, - raft::device_span start_vertices, - size_t k, - bool do_expensive_check); - } // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_sg_v32_e64.cu b/cpp/src/traversal/k_hop_nbrs_sg_v32_e64.cu new file mode 100644 index 00000000000..cd47f81361f --- /dev/null +++ b/cpp/src/traversal/k_hop_nbrs_sg_v32_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022-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. + */ +#include "traversal/k_hop_nbrs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, rmm::device_uvector> k_hop_nbrs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::device_span start_vertices, + size_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/k_hop_nbrs_sg_v64_e64.cu b/cpp/src/traversal/k_hop_nbrs_sg_v64_e64.cu new file mode 100644 index 00000000000..205bd41ae6f --- /dev/null +++ b/cpp/src/traversal/k_hop_nbrs_sg_v64_e64.cu @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022-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. + */ +#include "traversal/k_hop_nbrs_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template std::tuple, rmm::device_uvector> k_hop_nbrs( + raft::handle_t const& handle, + graph_view_t const& graph_view, + raft::device_span start_vertices, + size_t k, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/od_shortest_distances_sg.cu b/cpp/src/traversal/od_shortest_distances_sg.cu deleted file mode 100644 index a22793a2fad..00000000000 --- a/cpp/src/traversal/od_shortest_distances_sg.cu +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2023-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. - */ -#include "traversal/od_shortest_distances_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - float cutoff, - bool do_expensive_check); - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - double cutoff, - bool do_expensive_check); - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - float cutoff, - bool do_expensive_check); - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - double cutoff, - bool do_expensive_check); - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - float cutoff, - bool do_expensive_check); - -template rmm::device_uvector od_shortest_distances( - raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - raft::device_span origins, - raft::device_span destinations, - double cutoff, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/traversal/od_shortest_distances_sg_v32_e32.cu b/cpp/src/traversal/od_shortest_distances_sg_v32_e32.cu new file mode 100644 index 00000000000..2a9875f42f0 --- /dev/null +++ b/cpp/src/traversal/od_shortest_distances_sg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ +#include "traversal/od_shortest_distances_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + float cutoff, + bool do_expensive_check); + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/od_shortest_distances_sg_v32_e64.cu b/cpp/src/traversal/od_shortest_distances_sg_v32_e64.cu new file mode 100644 index 00000000000..880bc775589 --- /dev/null +++ b/cpp/src/traversal/od_shortest_distances_sg_v32_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ +#include "traversal/od_shortest_distances_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + float cutoff, + bool do_expensive_check); + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/od_shortest_distances_sg_v64_e64.cu b/cpp/src/traversal/od_shortest_distances_sg_v64_e64.cu new file mode 100644 index 00000000000..9c309fa3a66 --- /dev/null +++ b/cpp/src/traversal/od_shortest_distances_sg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023-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. + */ +#include "traversal/od_shortest_distances_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + float cutoff, + bool do_expensive_check); + +template rmm::device_uvector od_shortest_distances( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + raft::device_span origins, + raft::device_span destinations, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_mg.cu b/cpp/src/traversal/sssp_mg.cu deleted file mode 100644 index a89902059bf..00000000000 --- a/cpp/src/traversal/sssp_mg.cu +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "traversal/sssp_impl.cuh" - -namespace cugraph { - -// MG instantiation - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int32_t* predecessors, - int32_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int32_t* predecessors, - int32_t source_vertex, - double cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int32_t* predecessors, - int32_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int32_t* predecessors, - int32_t source_vertex, - double cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int64_t* predecessors, - int64_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int64_t* predecessors, - int64_t source_vertex, - double cutoff, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/traversal/sssp_mg_v32_e32.cu b/cpp/src/traversal/sssp_mg_v32_e32.cu new file mode 100644 index 00000000000..b7d1b0f8bc5 --- /dev/null +++ b/cpp/src/traversal/sssp_mg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int32_t* predecessors, + int32_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int32_t* predecessors, + int32_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_mg_v32_e64.cu b/cpp/src/traversal/sssp_mg_v32_e64.cu new file mode 100644 index 00000000000..382b31cebf9 --- /dev/null +++ b/cpp/src/traversal/sssp_mg_v32_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int32_t* predecessors, + int32_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int32_t* predecessors, + int32_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_mg_v64_e64.cu b/cpp/src/traversal/sssp_mg_v64_e64.cu new file mode 100644 index 00000000000..66ea82e8ea2 --- /dev/null +++ b/cpp/src/traversal/sssp_mg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// MG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int64_t* predecessors, + int64_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int64_t* predecessors, + int64_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_sg.cu b/cpp/src/traversal/sssp_sg.cu deleted file mode 100644 index 3dd4bc5c6ca..00000000000 --- a/cpp/src/traversal/sssp_sg.cu +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2021-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. - */ -#include "traversal/sssp_impl.cuh" - -namespace cugraph { - -// SG instantiation - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int32_t* predecessors, - int32_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int32_t* predecessors, - int32_t source_vertex, - double cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int32_t* predecessors, - int32_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int32_t* predecessors, - int32_t source_vertex, - double cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - float* distances, - int64_t* predecessors, - int64_t source_vertex, - float cutoff, - bool do_expensive_check); - -template void sssp(raft::handle_t const& handle, - graph_view_t const& graph_view, - edge_property_view_t edge_weight_view, - double* distances, - int64_t* predecessors, - int64_t source_vertex, - double cutoff, - bool do_expensive_check); - -} // namespace cugraph diff --git a/cpp/src/traversal/sssp_sg_v32_e32.cu b/cpp/src/traversal/sssp_sg_v32_e32.cu new file mode 100644 index 00000000000..8ee11f3ad68 --- /dev/null +++ b/cpp/src/traversal/sssp_sg_v32_e32.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int32_t* predecessors, + int32_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int32_t* predecessors, + int32_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_sg_v32_e64.cu b/cpp/src/traversal/sssp_sg_v32_e64.cu new file mode 100644 index 00000000000..b02d43cfaf2 --- /dev/null +++ b/cpp/src/traversal/sssp_sg_v32_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int32_t* predecessors, + int32_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int32_t* predecessors, + int32_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/traversal/sssp_sg_v64_e64.cu b/cpp/src/traversal/sssp_sg_v64_e64.cu new file mode 100644 index 00000000000..507fb96f054 --- /dev/null +++ b/cpp/src/traversal/sssp_sg_v64_e64.cu @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ +#include "traversal/sssp_impl.cuh" + +namespace cugraph { + +// SG instantiation + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + float* distances, + int64_t* predecessors, + int64_t source_vertex, + float cutoff, + bool do_expensive_check); + +template void sssp(raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_weight_view, + double* distances, + int64_t* predecessors, + int64_t source_vertex, + double cutoff, + bool do_expensive_check); + +} // namespace cugraph diff --git a/cpp/src/utilities/path_retrieval.cu b/cpp/src/utilities/path_retrieval.cuh similarity index 66% rename from cpp/src/utilities/path_retrieval.cu rename to cpp/src/utilities/path_retrieval.cuh index eda60941c23..365664177df 100644 --- a/cpp/src/utilities/path_retrieval.cu +++ b/cpp/src/utilities/path_retrieval.cuh @@ -102,35 +102,4 @@ void get_traversed_cost(raft::handle_t const& handle, handle, vertices, preds, info_weights, out, stop_vertex, num_vertices); } -template void get_traversed_cost(raft::handle_t const& handle, - int32_t const* vertices, - int32_t const* preds, - float const* info_weights, - float* out, - int32_t stop_vertex, - int32_t num_vertices); - -template void get_traversed_cost(raft::handle_t const& handle, - int32_t const* vertices, - int32_t const* preds, - double const* info_weights, - double* out, - int32_t stop_vertex, - int32_t num_vertices); - -template void get_traversed_cost(raft::handle_t const& handle, - int64_t const* vertices, - int64_t const* preds, - float const* info_weights, - float* out, - int64_t stop_vertex, - int64_t num_vertices); - -template void get_traversed_cost(raft::handle_t const& handle, - int64_t const* vertices, - int64_t const* preds, - double const* info_weights, - double* out, - int64_t stop_vertex, - int64_t num_vertices); } // namespace cugraph diff --git a/cpp/src/utilities/path_retrieval_sg_v32_e32.cu b/cpp/src/utilities/path_retrieval_sg_v32_e32.cu new file mode 100644 index 00000000000..89877470d4a --- /dev/null +++ b/cpp/src/utilities/path_retrieval_sg_v32_e32.cu @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "path_retrieval.cuh" + +#include +#include + +#include + +#include +#include + +#include +#include + +namespace cugraph { + +template void get_traversed_cost(raft::handle_t const& handle, + int32_t const* vertices, + int32_t const* preds, + float const* info_weights, + float* out, + int32_t stop_vertex, + int32_t num_vertices); + +template void get_traversed_cost(raft::handle_t const& handle, + int32_t const* vertices, + int32_t const* preds, + double const* info_weights, + double* out, + int32_t stop_vertex, + int32_t num_vertices); + +} // namespace cugraph diff --git a/cpp/src/utilities/path_retrieval_sg_v64_e64.cu b/cpp/src/utilities/path_retrieval_sg_v64_e64.cu new file mode 100644 index 00000000000..584b7c67989 --- /dev/null +++ b/cpp/src/utilities/path_retrieval_sg_v64_e64.cu @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "path_retrieval.cuh" + +#include +#include + +#include + +#include +#include + +#include +#include + +namespace cugraph { + +template void get_traversed_cost(raft::handle_t const& handle, + int64_t const* vertices, + int64_t const* preds, + float const* info_weights, + float* out, + int64_t stop_vertex, + int64_t num_vertices); + +template void get_traversed_cost(raft::handle_t const& handle, + int64_t const* vertices, + int64_t const* preds, + double const* info_weights, + double* out, + int64_t stop_vertex, + int64_t num_vertices); +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertex_pairs.cu b/cpp/src/utilities/shuffle_vertex_pairs.cuh similarity index 57% rename from cpp/src/utilities/shuffle_vertex_pairs.cu rename to cpp/src/utilities/shuffle_vertex_pairs.cuh index b473796aa9d..8cfefa1a060 100644 --- a/cpp/src/utilities/shuffle_vertex_pairs.cu +++ b/cpp/src/utilities/shuffle_vertex_pairs.cuh @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#pragma once + #include "detail/graph_partition_utils.cuh" #include @@ -356,168 +359,6 @@ shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( minor_comm_size}); } -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types, - std::vector const& vertex_partition_range_lasts); - } // namespace detail template @@ -549,76 +390,4 @@ shuffle_external_edges(raft::handle_t const& handle, std::move(edge_types)); } -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - -template std::tuple, - rmm::device_uvector, - std::optional>, - std::optional>, - std::optional>> -shuffle_external_edges(raft::handle_t const& handle, - rmm::device_uvector&& majors, - rmm::device_uvector&& minors, - std::optional>&& weights, - std::optional>&& edge_ids, - std::optional>&& edge_types); - } // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu b/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu new file mode 100644 index 00000000000..7943ebcd5f4 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e32.cu @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertex_pairs.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace cugraph { + +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +} // namespace detail + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu b/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu new file mode 100644 index 00000000000..230fce435f9 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertex_pairs_mg_v32_e64.cu @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertex_pairs.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace cugraph { + +namespace detail { +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +} // namespace detail + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu b/cpp/src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu new file mode 100644 index 00000000000..8134c41696b --- /dev/null +++ b/cpp/src/utilities/shuffle_vertex_pairs_mg_v64_e64.cu @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertex_pairs.cuh" + +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace cugraph { + +namespace detail { + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_ext_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types, + std::vector const& vertex_partition_range_lasts); + +} // namespace detail + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +template std::tuple, + rmm::device_uvector, + std::optional>, + std::optional>, + std::optional>> +shuffle_external_edges(raft::handle_t const& handle, + rmm::device_uvector&& majors, + rmm::device_uvector&& minors, + std::optional>&& weights, + std::optional>&& edge_ids, + std::optional>&& edge_types); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertices.cu b/cpp/src/utilities/shuffle_vertices.cuh similarity index 53% rename from cpp/src/utilities/shuffle_vertices.cu rename to cpp/src/utilities/shuffle_vertices.cuh index b396201f509..adce03f7c29 100644 --- a/cpp/src/utilities/shuffle_vertices.cu +++ b/cpp/src/utilities/shuffle_vertices.cuh @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#pragma once + #include "detail/graph_partition_utils.cuh" #include @@ -164,90 +167,6 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( return return_value; } -template rmm::device_uvector shuffle_int_vertices_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - std::vector const& vertex_partition_range_lasts); - -template rmm::device_uvector shuffle_int_vertices_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, rmm::device_uvector> -shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - std::vector const& vertex_partition_range_lasts); - -template std::tuple, rmm::device_uvector> -shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& d_vertices, - rmm::device_uvector&& d_values, - std::vector const& vertex_partition_range_lasts); - -template rmm::device_uvector shuffle_ext_vertices_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, rmm::device_uvector&& d_vertices); - -template rmm::device_uvector shuffle_ext_vertices_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, rmm::device_uvector&& d_vertices); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( - raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - } // namespace detail template @@ -260,51 +179,6 @@ shuffle_external_vertex_value_pairs(raft::handle_t const& handle, handle, std::move(vertices), std::move(values)); } -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - -template std::tuple, rmm::device_uvector> -shuffle_external_vertex_value_pairs(raft::handle_t const& handle, - rmm::device_uvector&& vertices, - rmm::device_uvector&& values); - template rmm::device_uvector shuffle_external_vertices(raft::handle_t const& handle, rmm::device_uvector&& vertices) @@ -313,10 +187,4 @@ rmm::device_uvector shuffle_external_vertices(raft::handle_t const& ha std::move(vertices)); } -template rmm::device_uvector shuffle_external_vertices( - raft::handle_t const& handle, rmm::device_uvector&& d_vertices); - -template rmm::device_uvector shuffle_external_vertices( - raft::handle_t const& handle, rmm::device_uvector&& d_vertices); - } // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertices_mg_v32_fp.cu b/cpp/src/utilities/shuffle_vertices_mg_v32_fp.cu new file mode 100644 index 00000000000..1112d7af2f7 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertices_mg_v32_fp.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertices.cuh" + +#include +#include + +#include + +#include + +namespace cugraph { + +namespace detail { + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace detail + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertices_mg_v32_integral.cu b/cpp/src/utilities/shuffle_vertices_mg_v32_integral.cu new file mode 100644 index 00000000000..0c91eb546d6 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertices_mg_v32_integral.cu @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertices.cuh" + +#include +#include + +#include + +#include + +namespace cugraph { + +namespace detail { + +template rmm::device_uvector shuffle_int_vertices_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + std::vector const& vertex_partition_range_lasts); + +template std::tuple, rmm::device_uvector> +shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + std::vector const& vertex_partition_range_lasts); + +template rmm::device_uvector shuffle_ext_vertices_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, rmm::device_uvector&& d_vertices); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace detail + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template rmm::device_uvector shuffle_external_vertices( + raft::handle_t const& handle, rmm::device_uvector&& d_vertices); + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertices_mg_v64_fp.cu b/cpp/src/utilities/shuffle_vertices_mg_v64_fp.cu new file mode 100644 index 00000000000..9592a9c63d1 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertices_mg_v64_fp.cu @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertices.cuh" + +#include +#include + +#include + +#include + +namespace cugraph { + +namespace detail { + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace detail + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace cugraph diff --git a/cpp/src/utilities/shuffle_vertices_mg_v64_integral.cu b/cpp/src/utilities/shuffle_vertices_mg_v64_integral.cu new file mode 100644 index 00000000000..5abce7c0783 --- /dev/null +++ b/cpp/src/utilities/shuffle_vertices_mg_v64_integral.cu @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021-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. + */ + +#include "detail/graph_partition_utils.cuh" +#include "shuffle_vertices.cuh" + +#include +#include + +#include + +#include + +namespace cugraph { + +namespace detail { + +template std::tuple, rmm::device_uvector> +shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& d_vertices, + rmm::device_uvector&& d_values, + std::vector const& vertex_partition_range_lasts); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template rmm::device_uvector shuffle_int_vertices_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + std::vector const& vertex_partition_range_lasts); + +template rmm::device_uvector shuffle_ext_vertices_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, rmm::device_uvector&& d_vertices); + +template std::tuple, rmm::device_uvector> +shuffle_ext_vertex_value_pairs_to_local_gpu_by_vertex_partitioning( + raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +} // namespace detail + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template std::tuple, rmm::device_uvector> +shuffle_external_vertex_value_pairs(raft::handle_t const& handle, + rmm::device_uvector&& vertices, + rmm::device_uvector&& values); + +template rmm::device_uvector shuffle_external_vertices( + raft::handle_t const& handle, rmm::device_uvector&& d_vertices); + +} // namespace cugraph From 3ca5d7802878879f3ae888bfa0d75a52c191d5e4 Mon Sep 17 00:00:00 2001 From: Seunghwa Kang <45857425+seunghwak@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:20:52 -0700 Subject: [PATCH 10/11] Cut peak memory footprint in per_v_transform_reduce_dst_key_aggregated_outgoing_e (#4484) Cut peak memory usage. For an ultimate solution, we need to implement our own function to emulate ncclReduce with a custom reduction operator. Authors: - Seunghwa Kang (https://github.com/seunghwak) - Naim (https://github.com/naimnv) Approvers: - Naim (https://github.com/naimnv) - Chuck Hastings (https://github.com/ChuckHastings) - Joseph Nke (https://github.com/jnke2016) URL: https://github.com/rapidsai/cugraph/pull/4484 --- cpp/src/community/leiden_impl.cuh | 3 +- cpp/src/community/louvain_impl.cuh | 3 +- ...m_reduce_dst_key_aggregated_outgoing_e.cuh | 68 ++++++++----------- 3 files changed, 32 insertions(+), 42 deletions(-) diff --git a/cpp/src/community/leiden_impl.cuh b/cpp/src/community/leiden_impl.cuh index c1b8fe1d7d3..166eb334301 100644 --- a/cpp/src/community/leiden_impl.cuh +++ b/cpp/src/community/leiden_impl.cuh @@ -638,7 +638,8 @@ void flatten_leiden_dendrogram(raft::handle_t const& handle, Dendrogram const& dendrogram, vertex_t* clustering) { - rmm::device_uvector vertex_ids_v(graph_view.number_of_vertices(), handle.get_stream()); + rmm::device_uvector vertex_ids_v(graph_view.local_vertex_partition_range_size(), + handle.get_stream()); detail::sequence_fill(handle.get_stream(), vertex_ids_v.begin(), diff --git a/cpp/src/community/louvain_impl.cuh b/cpp/src/community/louvain_impl.cuh index 2c524e9dfb8..a4b4b4a7bcd 100644 --- a/cpp/src/community/louvain_impl.cuh +++ b/cpp/src/community/louvain_impl.cuh @@ -292,7 +292,8 @@ void flatten_dendrogram(raft::handle_t const& handle, Dendrogram const& dendrogram, vertex_t* clustering) { - rmm::device_uvector vertex_ids_v(graph_view.number_of_vertices(), handle.get_stream()); + rmm::device_uvector vertex_ids_v(graph_view.local_vertex_partition_range_size(), + handle.get_stream()); detail::sequence_fill(handle.get_stream(), vertex_ids_v.begin(), diff --git a/cpp/src/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh b/cpp/src/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh index 7be30b0a5f0..5a5e9332094 100644 --- a/cpp/src/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh +++ b/cpp/src/prims/per_v_transform_reduce_dst_key_aggregated_outgoing_e.cuh @@ -343,6 +343,7 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( rmm::device_uvector majors(0, handle.get_stream()); auto e_op_result_buffer = allocate_dataframe_buffer(0, handle.get_stream()); + std::vector rx_offsets{}; for (size_t i = 0; i < graph_view.number_of_local_edge_partitions(); ++i) { auto edge_partition = edge_partition_device_view_t( @@ -1041,6 +1042,10 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( // FIXME: additional optimization is possible if reduce_op is a pure function (and reduce_op // can be mapped to ncclRedOp_t). + // FIXME: Memory footprint can grow proportional to minor_comm_size in the worst case. If + // reduce_op can be mapped to ncclRedOp_t, we can use ncclReduce to sovle this probelm. If + // reduce_op cannot be mapped to ncclRedOp_t, we need to implement our own multi-GPU reduce + // function. auto rx_sizes = host_scalar_gather(minor_comm, tmp_majors.size(), i, handle.get_stream()); std::vector rx_displs{}; @@ -1073,58 +1078,41 @@ void per_v_transform_reduce_dst_key_aggregated_outgoing_e( if (static_cast(minor_comm_rank) == i) { majors = std::move(rx_majors); e_op_result_buffer = std::move(rx_tmp_e_op_result_buffer); + rx_offsets = std::vector(rx_sizes.size() + 1); + rx_offsets[0] = 0; + std::inclusive_scan(rx_sizes.begin(), rx_sizes.end(), rx_offsets.begin() + 1); } } else { majors = std::move(tmp_majors); e_op_result_buffer = std::move(tmp_e_op_result_buffer); + rx_offsets = {0, majors.size()}; } } - if constexpr (GraphViewType::is_multi_gpu) { - thrust::sort_by_key(handle.get_thrust_policy(), - majors.begin(), - majors.end(), - get_dataframe_buffer_begin(e_op_result_buffer)); - auto num_uniques = thrust::count_if(handle.get_thrust_policy(), - thrust::make_counting_iterator(size_t{0}), - thrust::make_counting_iterator(majors.size()), - detail::is_first_in_run_t{majors.data()}); - rmm::device_uvector unique_majors(num_uniques, handle.get_stream()); - auto reduced_e_op_result_buffer = - allocate_dataframe_buffer(unique_majors.size(), handle.get_stream()); - thrust::reduce_by_key(handle.get_thrust_policy(), - majors.begin(), - majors.end(), - get_dataframe_buffer_begin(e_op_result_buffer), - unique_majors.begin(), - get_dataframe_buffer_begin(reduced_e_op_result_buffer), - thrust::equal_to{}, - reduce_op); - majors = std::move(unique_majors); - e_op_result_buffer = std::move(reduced_e_op_result_buffer); - } - // 2. update final results thrust::fill(handle.get_thrust_policy(), vertex_value_output_first, vertex_value_output_first + graph_view.local_vertex_partition_range_size(), - T{}); - - thrust::scatter(handle.get_thrust_policy(), - get_dataframe_buffer_begin(e_op_result_buffer), - get_dataframe_buffer_end(e_op_result_buffer), - thrust::make_transform_iterator( - majors.begin(), - detail::vertex_local_offset_t{ - graph_view.local_vertex_partition_view()}), - vertex_value_output_first); - - thrust::transform(handle.get_thrust_policy(), - vertex_value_output_first, - vertex_value_output_first + graph_view.local_vertex_partition_range_size(), - vertex_value_output_first, - detail::reduce_with_init_t{reduce_op, init}); + init); + + auto pair_first = + thrust::make_zip_iterator(majors.begin(), get_dataframe_buffer_begin(e_op_result_buffer)); + for (size_t i = 0; i < rx_offsets.size() - 1; ++i) { + thrust::for_each( + handle.get_thrust_policy(), + pair_first + rx_offsets[i], + pair_first + rx_offsets[i + 1], + [vertex_value_output_first, + reduce_op, + major_first = graph_view.local_vertex_partition_range_first()] __device__(auto pair) { + auto major = thrust::get<0>(pair); + auto major_offset = major - major_first; + auto e_op_result = thrust::get<1>(pair); + *(vertex_value_output_first + major_offset) = + reduce_op(*(vertex_value_output_first + major_offset), e_op_result); + }); + } } } // namespace cugraph From f0590ef2e501f98855990482fa7dd6fa493476c8 Mon Sep 17 00:00:00 2001 From: Naim <110031745+naimnv@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:13:13 +0200 Subject: [PATCH 11/11] Lookup edge src dst using edge id and type (#4449) Lookup edge src dst using edge id and type Closes #4307 Authors: - Naim (https://github.com/naimnv) Approvers: - Seunghwa Kang (https://github.com/seunghwak) - Chuck Hastings (https://github.com/ChuckHastings) - Alex Barghi (https://github.com/alexbarghi-nv) URL: https://github.com/rapidsai/cugraph/pull/4449 --- cpp/CMakeLists.txt | 6 + cpp/include/cugraph/sampling_functions.hpp | 80 ++ .../cugraph/src_dst_lookup_container.hpp | 77 ++ .../cugraph/utilities/dataframe_buffer.hpp | 8 + .../cugraph/utilities/thrust_tuple_utils.hpp | 13 + cpp/src/detail/graph_partition_utils.cuh | 15 + cpp/src/lookup/lookup_src_dst_impl.cuh | 841 ++++++++++++++++++ cpp/src/lookup/lookup_src_dst_mg_v32_e32.cu | 43 + cpp/src/lookup/lookup_src_dst_mg_v32_e64.cu | 43 + cpp/src/lookup/lookup_src_dst_mg_v64_e64.cu | 43 + cpp/src/lookup/lookup_src_dst_sg_v32_e32.cu | 43 + cpp/src/lookup/lookup_src_dst_sg_v32_e64.cu | 43 + cpp/src/lookup/lookup_src_dst_sg_v64_e64.cu | 42 + cpp/tests/CMakeLists.txt | 33 +- .../community/mg_weighted_matching_test.cpp | 15 +- cpp/tests/lookup/lookup_src_dst_test.cpp | 306 +++++++ cpp/tests/lookup/mg_lookup_src_dst_test.cpp | 349 ++++++++ 17 files changed, 1986 insertions(+), 14 deletions(-) create mode 100644 cpp/include/cugraph/src_dst_lookup_container.hpp create mode 100644 cpp/src/lookup/lookup_src_dst_impl.cuh create mode 100644 cpp/src/lookup/lookup_src_dst_mg_v32_e32.cu create mode 100644 cpp/src/lookup/lookup_src_dst_mg_v32_e64.cu create mode 100644 cpp/src/lookup/lookup_src_dst_mg_v64_e64.cu create mode 100644 cpp/src/lookup/lookup_src_dst_sg_v32_e32.cu create mode 100644 cpp/src/lookup/lookup_src_dst_sg_v32_e64.cu create mode 100644 cpp/src/lookup/lookup_src_dst_sg_v64_e64.cu create mode 100644 cpp/tests/lookup/lookup_src_dst_test.cpp create mode 100644 cpp/tests/lookup/mg_lookup_src_dst_test.cpp diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8d57c089d8f..800f0b46259 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -286,6 +286,12 @@ set(CUGRAPH_SOURCES src/community/k_truss_sg_v64_e64.cu src/community/k_truss_sg_v32_e32.cu src/community/k_truss_sg_v32_e64.cu + src/lookup/lookup_src_dst_mg_v32_e32.cu + src/lookup/lookup_src_dst_mg_v32_e64.cu + src/lookup/lookup_src_dst_mg_v64_e64.cu + src/lookup/lookup_src_dst_sg_v32_e32.cu + src/lookup/lookup_src_dst_sg_v32_e64.cu + src/lookup/lookup_src_dst_sg_v64_e64.cu src/sampling/random_walks_old_sg_v32_e32.cu src/sampling/random_walks_old_sg_v32_e64.cu src/sampling/random_walks_old_sg_v64_e64.cu diff --git a/cpp/include/cugraph/sampling_functions.hpp b/cpp/include/cugraph/sampling_functions.hpp index 6056fe72057..971a0197d6f 100644 --- a/cpp/include/cugraph/sampling_functions.hpp +++ b/cpp/include/cugraph/sampling_functions.hpp @@ -15,6 +15,8 @@ */ #pragma once +#include + #include #include @@ -449,5 +451,83 @@ sort_sampled_edgelist(raft::handle_t const& handle, size_t num_hops, bool src_is_major = true, bool do_expensive_check = false); +/* + * @brief Build map to lookup source and destination using edge id and type + * + * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. + * @tparam edge_t Type of edge identifiers. Needs to be an integral type. + * @tparam edge_type_t Type of edge types. Needs to be an integral type. + * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) + * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and + * handles to various CUDA libraries) to run graph algorithms. + * @param graph_view Graph view object. + * @param edge_id_view View object holding edge ids of the edges of the graph pointed @p graph_view + * @param edge_type_view View object holding edge types of the edges of the graph pointed @p + * graph_view + * @return An object of type cugraph::lookup_container_t that encapsulates edge id and type to + * source and destination lookup map. + */ +template +lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +/* + * @brief Lookup edge sources and destinations using edge ids and a single edge type. + * Use this function to lookup endpoints of edges belonging to the same edge type. + * + * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. + * @tparam edge_t Type of edge identifiers. Needs to be an integral type. + * @tparam edge_type_t Type of edge types. Needs to be an integral type. + * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) + * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and + * handles to various CUDA libraries) to run graph algorithms. + * @param lookup_container Object of type cugraph::lookup_container_t that encapsulates edge id and + * type to source and destination lookup map. + * @param edge_ids_to_lookup Device span of edge ids to lookup + * @param edge_type_to_lookup Type of the edges corresponding to edge ids in @p edge_ids_to_lookup + * @return A tuple of device vector containing edge sources and destinations for edge ids + * in @p edge_ids_to_lookup and edge type @. If an edge id in @p edge_ids_to_lookup or + * edge type @edge_type_to_lookup is not found, the corresponding entry in the device vectors of + * the returned tuple will contain cugraph::invalid_vertex_id. + */ +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& lookup_container, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup); + +/* + * @brief Lookup edge sources and destinations using edge ids and edge types. + * Use this function to lookup endpoints of edges belonging to different edge types. + * + * @tparam vertex_t Type of vertex identifiers. Needs to be an integral type. + * @tparam edge_t Type of edge identifiers. Needs to be an integral type. + * @tparam edge_type_t Type of edge types. Needs to be an integral type. + * @tparam multi_gpu Flag indicating whether template instantiation should target single-GPU (false) + * @param handle RAFT handle object to encapsulate resources (e.g. CUDA stream, communicator, and + * handles to various CUDA libraries) to run graph algorithms. + * @param lookup_container Object of type cugraph::lookup_container_t that encapsulates edge id and + * type to source and destination lookup map. + * @param edge_ids_to_lookup Device span of edge ids to lookup + * @param edge_types_to_lookup Device span of edge types corresponding to the edge ids + * in @p edge_ids_to_lookup + * @return A tuple of device vector containing edge sources and destinations for the edge ids + * in @p edge_ids_to_lookup and the edge types in @p edge_types_to_lookup. If an edge id in + * @p edge_ids_to_lookup or edge type in @p edge_types_to_lookup is not found, the + * corresponding entry in the device vectors of the returned tuple will contain + * cugraph::invalid_vertex_id. + */ +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& lookup_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); } // namespace cugraph diff --git a/cpp/include/cugraph/src_dst_lookup_container.hpp b/cpp/include/cugraph/src_dst_lookup_container.hpp new file mode 100644 index 00000000000..4b1509f0367 --- /dev/null +++ b/cpp/include/cugraph/src_dst_lookup_container.hpp @@ -0,0 +1,77 @@ +/* + * 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. + */ +#pragma once + +#include +#include +#include + +#include +#include + +#include + +#include + +#include +#include + +namespace cugraph { + +template > +class lookup_container_t { + template + struct lookup_container_impl; + std::unique_ptr> pimpl; + + public: + using edge_id_type = edge_id_t; + using edge_type_type = edge_type_t; + using value_type = value_t; + + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + static_assert(is_thrust_tuple_of_integral::value); + + ~lookup_container_t(); + lookup_container_t(); + lookup_container_t(raft::handle_t const& handle, + std::vector types, + std::vector type_counts); + lookup_container_t(const lookup_container_t&); + + void insert(raft::handle_t const& handle, + edge_type_t typ, + raft::device_span edge_ids_to_insert, + dataframe_buffer_type_t&& values_to_insert); + + dataframe_buffer_type_t lookup_from_edge_ids_and_single_type( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup, + bool multi_gpu) const; + + dataframe_buffer_type_t lookup_from_edge_ids_and_types( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup, + bool multi_gpu) const; +}; + +} // namespace cugraph diff --git a/cpp/include/cugraph/utilities/dataframe_buffer.hpp b/cpp/include/cugraph/utilities/dataframe_buffer.hpp index d52160abd19..450e816bd96 100644 --- a/cpp/include/cugraph/utilities/dataframe_buffer.hpp +++ b/cpp/include/cugraph/utilities/dataframe_buffer.hpp @@ -207,6 +207,14 @@ auto get_dataframe_buffer_end(BufferType& buffer) std::make_index_sequence::value>(), buffer); } +template +struct dataframe_buffer_type { + using type = decltype(allocate_dataframe_buffer(size_t{0}, rmm::cuda_stream_view{})); +}; + +template +using dataframe_buffer_type_t = typename dataframe_buffer_type::type; + template , rmm::device_uvector>::value>* = nullptr> diff --git a/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp b/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp index 304a5b94bd6..2c36ed33359 100644 --- a/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp +++ b/cpp/include/cugraph/utilities/thrust_tuple_utils.hpp @@ -113,6 +113,19 @@ struct is_thrust_tuple_of_arithmetic> { static constexpr bool value = (... && is_valid); }; +template +struct is_thrust_tuple_of_integral : std::false_type {}; + +template +struct is_thrust_tuple_of_integral> { + private: + template + static constexpr bool is_valid = std::is_integral_v || std::is_same_v; + + public: + static constexpr bool value = (... && is_valid); +}; + template struct is_std_tuple : std::false_type {}; diff --git a/cpp/src/detail/graph_partition_utils.cuh b/cpp/src/detail/graph_partition_utils.cuh index 957436459cd..00931780266 100644 --- a/cpp/src/detail/graph_partition_utils.cuh +++ b/cpp/src/detail/graph_partition_utils.cuh @@ -50,6 +50,21 @@ struct compute_gpu_id_from_ext_vertex_t { } }; +template +struct compute_gpu_id_from_ext_edge_id_t { + int comm_size{0}; + int major_comm_size{0}; + int minor_comm_size{0}; + + __host__ __device__ int operator()(edge_t e) const + { + cuco::detail::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); + } +}; + template struct compute_gpu_id_from_int_vertex_t { raft::device_span vertex_partition_range_lasts{}; diff --git a/cpp/src/lookup/lookup_src_dst_impl.cuh b/cpp/src/lookup/lookup_src_dst_impl.cuh new file mode 100644 index 00000000000..4182cb5f65e --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_impl.cuh @@ -0,0 +1,841 @@ +/* + * 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. + */ +#include "detail/graph_partition_utils.cuh" +#include "prims/extract_transform_e.cuh" +#include "prims/kv_store.cuh" +#include "utilities/collect_comm.cuh" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace cugraph { + +template +template +struct lookup_container_t::lookup_container_impl { + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + + static_assert(std::is_same_v); + static_assert(std::is_same_v); + static_assert(std::is_same_v); + + ~lookup_container_impl() {} + lookup_container_impl() {} + lookup_container_impl(raft::handle_t const& handle, + std::vector types, + std::vector type_counts) + { + auto invalid_vertex_id = cugraph::invalid_vertex_id::value; + auto invalid_value = thrust::tuple(invalid_vertex_id, invalid_vertex_id); + + edge_type_to_kv_store = container_t{}; + edge_type_to_kv_store.reserve(types.size()); + + for (size_t idx = 0; idx < types.size(); idx++) { + auto typ = types[idx]; + assert(typ != empty_type_); + size_t store_capacity = type_counts[idx]; + + edge_type_to_kv_store.insert( + {typ, store_t(store_capacity, invalid_vertex_id, invalid_value, handle.get_stream())}); + } + + edge_type_to_kv_store.insert( + {empty_type_, store_t(0, invalid_vertex_id, invalid_value, handle.get_stream())}); + } + + void insert(raft::handle_t const& handle, + edge_type_t type, + raft::device_span edge_ids_to_insert, + dataframe_buffer_type_t&& values_to_insert) + { + auto itr = edge_type_to_kv_store.find(type); + + if (itr != edge_type_to_kv_store.end()) { + assert(itr->first == type); + + itr->second.insert(edge_ids_to_insert.begin(), + edge_ids_to_insert.end(), + cugraph::get_dataframe_buffer_begin(values_to_insert), + handle.get_stream()); + + } else { + assert(false); + } + } + + dataframe_buffer_type_t src_dst_from_edge_id_and_type( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup, + bool multi_gpu) const + { + using store_t = typename container_t::mapped_type; + const store_t* kv_store_object{nullptr}; + + auto value_buffer = cugraph::allocate_dataframe_buffer(0, handle.get_stream()); + auto itr = edge_type_to_kv_store.find(edge_type_to_lookup); + + if (itr != edge_type_to_kv_store.end()) { + assert(edge_type_to_lookup == itr->first); + kv_store_object = &(itr->second); + + } else { + kv_store_object = &(edge_type_to_kv_store.find(empty_type_)->second); + } + + if (multi_gpu) { + auto& comm = handle.get_comms(); + auto const comm_size = comm.get_size(); + auto& major_comm = handle.get_subcomm(cugraph::partition_manager::major_comm_name()); + auto const major_comm_size = major_comm.get_size(); + auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); + auto const minor_comm_size = minor_comm.get_size(); + + value_buffer = cugraph::collect_values_for_keys( + handle, + kv_store_object->view(), + edge_ids_to_lookup.begin(), + edge_ids_to_lookup.end(), + cugraph::detail::compute_gpu_id_from_ext_edge_id_t{ + comm_size, major_comm_size, minor_comm_size}); + } else { + cugraph::resize_dataframe_buffer( + value_buffer, edge_ids_to_lookup.size(), handle.get_stream()); + + kv_store_object->view().find(edge_ids_to_lookup.begin(), + edge_ids_to_lookup.end(), + cugraph::get_dataframe_buffer_begin(value_buffer), + handle.get_stream()); + } + + return std::make_tuple(std::move(std::get<0>(value_buffer)), + std::move(std::get<1>(value_buffer))); + } + + dataframe_buffer_type_t src_dst_from_edge_id_and_type( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup, + bool multi_gpu) const + { + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + + assert(edge_ids_to_lookup.size() == edge_types_to_lookup.size()); + + rmm::device_uvector tmp_edge_ids_to_lookup(edge_ids_to_lookup.size(), + handle.get_stream()); + + rmm::device_uvector tmp_edge_types_to_lookup(edge_types_to_lookup.size(), + handle.get_stream()); + + rmm::device_uvector original_idxs(edge_ids_to_lookup.size(), handle.get_stream()); + + thrust::sequence( + handle.get_thrust_policy(), original_idxs.begin(), original_idxs.end(), edge_id_t{0}); + + thrust::copy(handle.get_thrust_policy(), + edge_ids_to_lookup.begin(), + edge_ids_to_lookup.end(), + tmp_edge_ids_to_lookup.begin()); + + thrust::copy(handle.get_thrust_policy(), + edge_types_to_lookup.begin(), + edge_types_to_lookup.end(), + tmp_edge_types_to_lookup.begin()); + + thrust::sort_by_key(handle.get_thrust_policy(), + tmp_edge_types_to_lookup.begin(), + tmp_edge_types_to_lookup.end(), + thrust::make_zip_iterator(thrust::make_tuple(tmp_edge_ids_to_lookup.begin(), + original_idxs.begin()))); + + auto nr_uniqe_edge_types_to_lookup = thrust::count_if( + handle.get_thrust_policy(), + thrust::make_counting_iterator(size_t{0}), + thrust::make_counting_iterator(tmp_edge_types_to_lookup.size()), + detail::is_first_in_run_t{tmp_edge_types_to_lookup.data()}); + + rmm::device_uvector unique_types(nr_uniqe_edge_types_to_lookup, + handle.get_stream()); + rmm::device_uvector type_offsets(nr_uniqe_edge_types_to_lookup + size_t{1}, + handle.get_stream()); + + thrust::copy_if(handle.get_thrust_policy(), + tmp_edge_types_to_lookup.begin(), + tmp_edge_types_to_lookup.end(), + thrust::make_counting_iterator(size_t{0}), + unique_types.begin(), + detail::is_first_in_run_t{tmp_edge_types_to_lookup.data()}); + + type_offsets.set_element_to_zero_async(0, handle.get_stream()); + thrust::upper_bound(handle.get_thrust_policy(), + tmp_edge_types_to_lookup.begin(), + tmp_edge_types_to_lookup.end(), + unique_types.begin(), + unique_types.end(), + type_offsets.begin() + 1); + + std::vector h_unique_types(unique_types.size()); + std::vector h_type_offsets(type_offsets.size()); + + raft::update_host( + h_unique_types.data(), unique_types.data(), unique_types.size(), handle.get_stream()); + + raft::update_host( + h_type_offsets.data(), type_offsets.data(), type_offsets.size(), handle.get_stream()); + + handle.sync_stream(); + + std::unordered_map typ_to_local_idx_map{}; + for (size_t idx = 0; idx < h_unique_types.size(); idx++) { + typ_to_local_idx_map[h_unique_types[idx]] = idx; + } + + auto output_value_buffer = + cugraph::allocate_dataframe_buffer(edge_ids_to_lookup.size(), handle.get_stream()); + if (multi_gpu) { + auto& comm = handle.get_comms(); + auto rx_counts = host_scalar_allgather(comm, unique_types.size(), handle.get_stream()); + std::vector rx_displacements(rx_counts.size()); + std::exclusive_scan(rx_counts.begin(), rx_counts.end(), rx_displacements.begin(), size_t{0}); + rmm::device_uvector rx_unique_types(rx_displacements.back() + rx_counts.back(), + handle.get_stream()); + + device_allgatherv(comm, + unique_types.begin(), + rx_unique_types.begin(), + rx_counts, + rx_displacements, + handle.get_stream()); + unique_types = std::move(rx_unique_types); + + thrust::sort(handle.get_thrust_policy(), unique_types.begin(), unique_types.end()); + + unique_types.resize( + thrust::distance( + unique_types.begin(), + thrust::unique(handle.get_thrust_policy(), unique_types.begin(), unique_types.end())), + handle.get_stream()); + } + + h_unique_types.resize(unique_types.size()); + raft::update_host( + h_unique_types.data(), unique_types.data(), unique_types.size(), handle.get_stream()); + + handle.sync_stream(); + + for (size_t idx = 0; idx < h_unique_types.size(); idx++) { + auto typ = h_unique_types[idx]; + + auto tmp_edge_ids_begin = tmp_edge_ids_to_lookup.begin(); + size_t span_size = 0; + + if (typ_to_local_idx_map.find(typ) != typ_to_local_idx_map.end()) { + auto local_idx = typ_to_local_idx_map[typ]; + tmp_edge_ids_begin = tmp_edge_ids_to_lookup.begin() + h_type_offsets[local_idx]; + span_size = h_type_offsets[local_idx + 1] - h_type_offsets[local_idx]; + } + + auto value_buffer_typ = src_dst_from_edge_id_and_type( + handle, raft::device_span{tmp_edge_ids_begin, span_size}, typ, multi_gpu); + + thrust::copy(handle.get_thrust_policy(), + cugraph::get_dataframe_buffer_begin(value_buffer_typ), + cugraph::get_dataframe_buffer_end(value_buffer_typ), + cugraph::get_dataframe_buffer_begin(output_value_buffer) + + h_type_offsets[typ_to_local_idx_map[typ]]); + } + + thrust::sort_by_key(handle.get_thrust_policy(), + original_idxs.begin(), + original_idxs.end(), + cugraph::get_dataframe_buffer_begin(output_value_buffer)); + + return std::make_tuple(std::move(std::get<0>(output_value_buffer)), + std::move(std::get<1>(output_value_buffer))); + } + + private: + using container_t = + std::unordered_map>; + using store_t = typename container_t::mapped_type; + container_t edge_type_to_kv_store; + edge_type_t empty_type_ = std::numeric_limits::max() - 1; +}; + +template +lookup_container_t::~lookup_container_t() +{ + pimpl.reset(); +} + +template +lookup_container_t::lookup_container_t() + : pimpl{std::make_unique>()} +{ +} + +template +lookup_container_t::lookup_container_t( + raft::handle_t const& handle, std::vector types, std::vector type_counts) + : pimpl{std::make_unique>( + handle, types, type_counts)} +{ +} + +template +lookup_container_t::lookup_container_t( + const lookup_container_t&) +{ +} + +template +void lookup_container_t::insert( + raft::handle_t const& handle, + edge_type_t type, + raft::device_span edge_ids_to_insert, + dataframe_buffer_type_t&& values_to_insert) +{ + pimpl->insert(handle, type, edge_ids_to_insert, std::move(values_to_insert)); +} + +template +dataframe_buffer_type_t +lookup_container_t::lookup_from_edge_ids_and_single_type( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup, + bool multi_gpu) const +{ + return pimpl->src_dst_from_edge_id_and_type( + handle, edge_ids_to_lookup, edge_type_to_lookup, multi_gpu); +} + +template +dataframe_buffer_type_t +lookup_container_t::lookup_from_edge_ids_and_types( + raft::handle_t const& handle, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup, + bool multi_gpu) const +{ + return pimpl->src_dst_from_edge_id_and_type( + handle, edge_ids_to_lookup, edge_types_to_lookup, multi_gpu); +} + +namespace detail { + +template +EdgeTypeAndIdToSrcDstLookupContainerType build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + GraphViewType const& graph_view, + EdgeIdInputWrapper edge_id_view, + EdgeTypeInputWrapper edge_type_view) +{ + static_assert(!std::is_same_v, + "Can not create edge id lookup table without edge ids"); + + using vertex_t = typename GraphViewType::vertex_type; + using edge_t = typename GraphViewType::edge_type; + using edge_type_t = typename EdgeTypeInputWrapper::value_type; + using edge_id_t = typename EdgeIdInputWrapper::value_type; + using value_t = typename EdgeTypeAndIdToSrcDstLookupContainerType::value_type; + + constexpr bool multi_gpu = GraphViewType::is_multi_gpu; + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + static_assert(std::is_same_v); + static_assert(std::is_same_v>); + + static_assert( + std::is_same_v, + "edge_type_t must match with EdgeTypeAndIdToSrcDstLookupContainerType::edge_type_type"); + + static_assert( + std::is_same_v, + "edge_id_t must match with typename EdgeTypeAndIdToSrcDstLookupContainerType::edge_id_type"); + + rmm::device_uvector unique_types(0, handle.get_stream()); + rmm::device_uvector unique_type_counts(0, handle.get_stream()); + + if constexpr (multi_gpu) { + auto& comm = handle.get_comms(); + auto const comm_size = comm.get_size(); + auto& major_comm = handle.get_subcomm(cugraph::partition_manager::major_comm_name()); + auto const major_comm_size = major_comm.get_size(); + auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); + auto const minor_comm_size = minor_comm.get_size(); + + auto [gpu_ids, edge_types] = + cugraph::extract_transform_e( + handle, + graph_view, + cugraph::edge_src_dummy_property_t{}.view(), + cugraph::edge_dst_dummy_property_t{}.view(), + view_concat(edge_id_view, edge_type_view), + cuda::proclaim_return_type>>( + [key_func = + cugraph::detail::compute_gpu_id_from_ext_edge_id_t{ + comm_size, + major_comm_size, + minor_comm_size}] __device__(auto, + auto, + thrust::nullopt_t, + thrust::nullopt_t, + thrust::tuple id_and_type) { + return thrust::optional>{thrust::make_tuple( + key_func(thrust::get<0>(id_and_type)), thrust::get<1>(id_and_type))}; + })); + + auto type_and_gpu_id_pair_begin = + thrust::make_zip_iterator(thrust::make_tuple(edge_types.begin(), gpu_ids.begin())); + + thrust::sort(handle.get_thrust_policy(), + type_and_gpu_id_pair_begin, + type_and_gpu_id_pair_begin + edge_types.size()); + + auto nr_unique_paris = thrust::count_if( + handle.get_thrust_policy(), + thrust::make_counting_iterator(size_t{0}), + thrust::make_counting_iterator(edge_types.size()), + detail::is_first_in_run_t{type_and_gpu_id_pair_begin}); + + auto unique_pairs_buffer = cugraph::allocate_dataframe_buffer< + typename thrust::iterator_traits::value_type>( + nr_unique_paris, handle.get_stream()); + + rmm::device_uvector unique_pair_counts(nr_unique_paris, handle.get_stream()); + + { + rmm::device_uvector unique_pair_end_offsets(nr_unique_paris, handle.get_stream()); + + thrust::copy_if(handle.get_thrust_policy(), + type_and_gpu_id_pair_begin, + type_and_gpu_id_pair_begin + edge_types.size(), + thrust::make_counting_iterator(size_t{0}), + cugraph::get_dataframe_buffer_begin(unique_pairs_buffer), + detail::is_first_in_run_t{ + type_and_gpu_id_pair_begin}); + + thrust::upper_bound(handle.get_thrust_policy(), + type_and_gpu_id_pair_begin, + type_and_gpu_id_pair_begin + edge_types.size(), + cugraph::get_dataframe_buffer_begin(unique_pairs_buffer), + cugraph::get_dataframe_buffer_end(unique_pairs_buffer), + unique_pair_end_offsets.begin()); + + thrust::adjacent_difference(handle.get_thrust_policy(), + unique_pair_end_offsets.begin(), + unique_pair_end_offsets.end(), + unique_pair_counts.begin()); + } + + edge_types.resize(0, handle.get_stream()); + gpu_ids.resize(0, handle.get_stream()); + edge_types.shrink_to_fit(handle.get_stream()); + gpu_ids.shrink_to_fit(handle.get_stream()); + + std::forward_as_tuple( + std::tie(std::get<0>(unique_pairs_buffer), std::ignore, unique_pair_counts), std::ignore) = + cugraph::groupby_gpu_id_and_shuffle_values( + handle.get_comms(), + thrust::make_zip_iterator(thrust::make_tuple(std::get<0>(unique_pairs_buffer).begin(), + std::get<1>(unique_pairs_buffer).begin(), + unique_pair_counts.begin())), + thrust::make_zip_iterator(thrust::make_tuple(std::get<0>(unique_pairs_buffer).end(), + std::get<1>(unique_pairs_buffer).end(), + unique_pair_counts.end())), + [] __device__(auto val) { return thrust::get<1>(val); }, + handle.get_stream()); + + // + // Count local #elments for all the types mapped to this GPU + // + + thrust::sort_by_key(handle.get_thrust_policy(), + std::get<0>(unique_pairs_buffer).begin(), + std::get<0>(unique_pairs_buffer).end(), + unique_pair_counts.begin()); + + auto nr_unique_types = thrust::count_if( + handle.get_thrust_policy(), + thrust::make_counting_iterator(size_t{0}), + thrust::make_counting_iterator(std::get<0>(unique_pairs_buffer).size()), + detail::is_first_in_run_t{std::get<0>(unique_pairs_buffer).data()}); + + unique_types.resize(static_cast(nr_unique_types), handle.get_stream()); + unique_type_counts.resize(static_cast(nr_unique_types), handle.get_stream()); + + thrust::reduce_by_key(handle.get_thrust_policy(), + std::get<0>(unique_pairs_buffer).begin(), + std::get<0>(unique_pairs_buffer).end(), + unique_pair_counts.begin(), + unique_types.begin(), + unique_type_counts.begin()); + + } else { + auto edge_types = cugraph::extract_transform_e( + handle, + graph_view, + cugraph::edge_src_dummy_property_t{}.view(), + cugraph::edge_dst_dummy_property_t{}.view(), + edge_type_view, + cuda::proclaim_return_type>( + [] __device__(auto, auto, thrust::nullopt_t, thrust::nullopt_t, edge_type_t et) { + return thrust::optional{et}; + })); + + thrust::sort(handle.get_thrust_policy(), edge_types.begin(), edge_types.end()); + + auto nr_unique_types = + thrust::count_if(handle.get_thrust_policy(), + thrust::make_counting_iterator(size_t{0}), + thrust::make_counting_iterator(edge_types.size()), + detail::is_first_in_run_t{edge_types.data()}); + + unique_types.resize(static_cast(nr_unique_types), handle.get_stream()); + unique_type_counts.resize(static_cast(nr_unique_types), handle.get_stream()); + + { + rmm::device_uvector unique_type_end_offsets(nr_unique_types, handle.get_stream()); + thrust::copy_if(handle.get_thrust_policy(), + edge_types.begin(), + edge_types.end(), + thrust::make_counting_iterator(size_t{0}), + unique_types.begin(), + detail::is_first_in_run_t{edge_types.data()}); + + thrust::upper_bound(handle.get_thrust_policy(), + edge_types.begin(), + edge_types.end(), + unique_types.begin(), + unique_types.end(), + unique_type_end_offsets.begin()); + + thrust::adjacent_difference(handle.get_thrust_policy(), + unique_type_end_offsets.begin(), + unique_type_end_offsets.end(), + unique_type_counts.begin()); + } + } + + std::vector h_unique_types(unique_types.size()); + std::vector h_unique_type_counts(unique_types.size()); + + raft::update_host( + h_unique_types.data(), unique_types.data(), unique_types.size(), handle.get_stream()); + + raft::update_host(h_unique_type_counts.data(), + unique_type_counts.data(), + unique_type_counts.size(), + handle.get_stream()); + + handle.sync_stream(); + + auto search_container = + EdgeTypeAndIdToSrcDstLookupContainerType(handle, h_unique_types, h_unique_type_counts); + + // + // Populate the search container + // + + for (size_t local_ep_idx = 0; local_ep_idx < graph_view.number_of_local_edge_partitions(); + ++local_ep_idx) { + // + // decompress one edge_partition at a time + // + + auto edge_partition = edge_partition_device_view_t( + graph_view.local_edge_partition_view(local_ep_idx)); + + auto edge_partition_mask_view = + graph_view.has_edge_mask() + ? std::make_optional< + detail::edge_partition_edge_property_device_view_t>( + *(graph_view.edge_mask_view()), local_ep_idx) + : std::nullopt; + + auto number_of_local_edges = edge_partition.number_of_edges(); + if (graph_view.has_edge_mask()) { + number_of_local_edges = edge_partition.compute_number_of_edges_with_mask( + (*edge_partition_mask_view).value_first(), + thrust::make_counting_iterator(edge_partition.major_range_first()), + thrust::make_counting_iterator(edge_partition.major_range_last()), + handle.get_stream()); + } + + rmm::device_uvector edgelist_majors(number_of_local_edges, handle.get_stream()); + rmm::device_uvector edgelist_minors(edgelist_majors.size(), handle.get_stream()); + auto edgelist_ids = rmm::device_uvector(edgelist_majors.size(), handle.get_stream()); + auto edgelist_types = + rmm::device_uvector(edgelist_majors.size(), handle.get_stream()); + + detail::decompress_edge_partition_to_edgelist( + handle, + edge_partition, + std::nullopt, + std::make_optional>( + edge_id_view, local_ep_idx), + std::make_optional< + detail::edge_partition_edge_property_device_view_t>( + edge_type_view, local_ep_idx), + edge_partition_mask_view, + raft::device_span(edgelist_majors.data(), number_of_local_edges), + raft::device_span(edgelist_minors.data(), number_of_local_edges), + std::nullopt, + std::make_optional>(edgelist_ids.data(), number_of_local_edges), + std::make_optional>(edgelist_types.data(), + number_of_local_edges), + graph_view.local_edge_partition_segment_offsets(local_ep_idx)); + + // + // Shuffle to the right GPUs using edge ids as keys + // + + if constexpr (multi_gpu) { + auto const comm_size = handle.get_comms().get_size(); + auto& major_comm = handle.get_subcomm(cugraph::partition_manager::major_comm_name()); + auto const major_comm_size = major_comm.get_size(); + auto& minor_comm = handle.get_subcomm(cugraph::partition_manager::minor_comm_name()); + auto const minor_comm_size = minor_comm.get_size(); + + // Shuffle to the proper GPUs + std::forward_as_tuple( + std::tie(edgelist_majors, edgelist_minors, edgelist_ids, edgelist_types), std::ignore) = + cugraph::groupby_gpu_id_and_shuffle_values( + handle.get_comms(), + thrust::make_zip_iterator(thrust::make_tuple(edgelist_majors.begin(), + edgelist_minors.begin(), + edgelist_ids.begin(), + edgelist_types.begin())), + thrust::make_zip_iterator(thrust::make_tuple(edgelist_majors.end(), + edgelist_minors.end(), + edgelist_ids.end(), + edgelist_types.end())), + [key_func = + cugraph::detail::compute_gpu_id_from_ext_edge_id_t{ + comm_size, + major_comm_size, + minor_comm_size}] __device__(auto val) { return key_func(thrust::get<2>(val)); }, + handle.get_stream()); + } + + // + // Sort by edge types and insert to type specific kv_store_t object + // + + auto itr_to_triple = thrust::make_zip_iterator( + edgelist_majors.begin(), edgelist_minors.begin(), edgelist_ids.begin()); + + thrust::sort_by_key( + handle.get_thrust_policy(), edgelist_types.begin(), edgelist_types.end(), itr_to_triple); + + auto nr_uniqe_edge_types_partition = + thrust::count_if(handle.get_thrust_policy(), + thrust::make_counting_iterator(size_t{0}), + thrust::make_counting_iterator(edgelist_types.size()), + detail::is_first_in_run_t{edgelist_types.data()}); + + rmm::device_uvector unique_types(nr_uniqe_edge_types_partition, + handle.get_stream()); + rmm::device_uvector type_offsets(nr_uniqe_edge_types_partition + 1, + handle.get_stream()); + + thrust::copy_if(handle.get_thrust_policy(), + edgelist_types.begin(), + edgelist_types.end(), + thrust::make_counting_iterator(size_t{0}), + unique_types.begin(), + detail::is_first_in_run_t{edgelist_types.data()}); + + type_offsets.set_element_to_zero_async(0, handle.get_stream()); + + thrust::upper_bound(handle.get_thrust_policy(), + edgelist_types.begin(), + edgelist_types.end(), + unique_types.begin(), + unique_types.end(), + type_offsets.begin() + 1); + + std::vector h_unique_types(unique_types.size()); + std::vector h_type_offsets(type_offsets.size()); + + raft::update_host( + h_unique_types.data(), unique_types.data(), unique_types.size(), handle.get_stream()); + + raft::update_host( + h_type_offsets.data(), type_offsets.data(), type_offsets.size(), handle.get_stream()); + handle.sync_stream(); + + for (size_t idx = 0; idx < h_unique_types.size(); idx++) { + auto typ = h_unique_types[idx]; + auto nr_elements_to_insert = (h_type_offsets[idx + 1] - h_type_offsets[idx]); + + auto values_to_insert = + cugraph::allocate_dataframe_buffer(nr_elements_to_insert, handle.get_stream()); + + auto zip_itr = thrust::make_zip_iterator( + thrust::make_tuple(edgelist_majors.begin(), edgelist_minors.begin())); + + thrust::copy(handle.get_thrust_policy(), + zip_itr + h_type_offsets[idx], + zip_itr + h_type_offsets[idx] + nr_elements_to_insert, + cugraph::get_dataframe_buffer_begin(values_to_insert)); + + static_assert(std::is_same_v< + typename thrust::iterator_traits::value_type, + value_t>); + + search_container.insert(handle, + typ, + raft::device_span(edgelist_ids.begin() + h_type_offsets[idx], + nr_elements_to_insert), + std::move(values_to_insert)); + } + } + + return search_container; +} + +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + EdgeTypeAndIdToSrcDstLookupContainerType const& search_container, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup) +{ + using value_t = typename EdgeTypeAndIdToSrcDstLookupContainerType::value_type; + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + static_assert(std::is_same_v>); + + static_assert( + std::is_same_v, + "edge_id_t must match EdgeTypeAndIdToSrcDstLookupContainerType::edge_id_type"); + static_assert( + std::is_same_v, + "edge_type_t must match EdgeTypeAndIdToSrcDstLookupContainerType::edge_type_type "); + + auto value_buffer = search_container.lookup_from_edge_ids_and_single_type( + handle, edge_ids_to_lookup, edge_type_to_lookup, multi_gpu); + + return std::make_tuple(std::move(std::get<0>(value_buffer)), + std::move(std::get<1>(value_buffer))); +} + +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + EdgeTypeAndIdToSrcDstLookupContainerType const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup) +{ + using value_t = typename EdgeTypeAndIdToSrcDstLookupContainerType::value_type; + static_assert(std::is_integral_v); + static_assert(std::is_integral_v); + static_assert(std::is_same_v>); + + assert(edge_ids_to_lookup.size() == edge_types_to_lookup.size()); + + static_assert( + std::is_same_v, + "edge_id_t must match EdgeTypeAndIdToSrcDstLookupContainerType::edge_id_type"); + static_assert( + std::is_same_v, + "edge_type_t must match EdgeTypeAndIdToSrcDstLookupContainerType::edge_type_type "); + + auto value_buffer = search_container.lookup_from_edge_ids_and_types( + handle, edge_ids_to_lookup, edge_types_to_lookup, multi_gpu); + + return std::make_tuple(std::move(std::get<0>(value_buffer)), + std::move(std::get<1>(value_buffer))); +} +} // namespace detail + +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + edge_type_t edge_type_to_lookup) +{ + using m_t = lookup_container_t; + return detail::lookup_endpoints_from_edge_ids_and_single_type( + handle, search_container, edge_ids_to_lookup, edge_type_to_lookup); +} + +template +std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup) +{ + using m_t = lookup_container_t; + return detail:: + lookup_endpoints_from_edge_ids_and_types( + handle, search_container, edge_ids_to_lookup, edge_types_to_lookup); +} + +template +lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view) +{ + using graph_view_t = graph_view_t; + using return_t = lookup_container_t; + + return detail::build_edge_id_and_type_to_src_dst_lookup_map( + handle, graph_view, edge_id_view, edge_type_view); +} +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_mg_v32_e32.cu b/cpp/src/lookup/lookup_src_dst_mg_v32_e32.cu new file mode 100644 index 00000000000..5c644c5fe73 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_mg_v32_e32.cu @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t edge_type_to_lookup); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_mg_v32_e64.cu b/cpp/src/lookup/lookup_src_dst_mg_v32_e64.cu new file mode 100644 index 00000000000..4e120f49f10 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_mg_v32_e64.cu @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t edge_type_to_lookup); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_mg_v64_e64.cu b/cpp/src/lookup/lookup_src_dst_mg_v64_e64.cu new file mode 100644 index 00000000000..fc247eb2419 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_mg_v64_e64.cu @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t edge_type_to_lookup); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_sg_v32_e32.cu b/cpp/src/lookup/lookup_src_dst_sg_v32_e32.cu new file mode 100644 index 00000000000..7aa330b5383 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_sg_v32_e32.cu @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t const edge_type_to_lookup); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_sg_v32_e64.cu b/cpp/src/lookup/lookup_src_dst_sg_v32_e64.cu new file mode 100644 index 00000000000..46b62e05ed8 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_sg_v32_e64.cu @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t edge_type_to_lookup); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/src/lookup/lookup_src_dst_sg_v64_e64.cu b/cpp/src/lookup/lookup_src_dst_sg_v64_e64.cu new file mode 100644 index 00000000000..e449eb64de0 --- /dev/null +++ b/cpp/src/lookup/lookup_src_dst_sg_v64_e64.cu @@ -0,0 +1,42 @@ +/* + * 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. + */ + +#include "lookup/lookup_src_dst_impl.cuh" + +namespace cugraph { + +template class lookup_container_t; + +template lookup_container_t build_edge_id_and_type_to_src_dst_lookup_map( + raft::handle_t const& handle, + graph_view_t const& graph_view, + edge_property_view_t edge_id_view, + edge_property_view_t edge_type_view); + +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_single_type( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + int32_t edge_type_to_lookup); +template std::tuple, rmm::device_uvector> +lookup_endpoints_from_edge_ids_and_types( + raft::handle_t const& handle, + lookup_container_t const& search_container, + raft::device_span edge_ids_to_lookup, + raft::device_span edge_types_to_lookup); + +} // namespace cugraph diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 2152de28ff9..fd356ff8b89 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -326,11 +326,11 @@ ConfigureTest(LOUVAIN_TEST community/louvain_test.cpp) ConfigureTest(LEIDEN_TEST community/leiden_test.cpp) ################################################################################################### -# - WEIGHTED MATCHING tests ---------------------------------------------------------------------------------- +# - WEIGHTED MATCHING tests ----------------------------------------------------------------------- ConfigureTest(WEIGHTED_MATCHING_TEST community/weighted_matching_test.cpp) ################################################################################################### -# - Legacy ECG tests ------------------------------------------------------------------------------------- +# - Legacy ECG tests ------------------------------------------------------------------------------ ConfigureTest(LEGACY_ECG_TEST community/legacy_ecg_test.cpp) ################################################################################################### @@ -455,13 +455,13 @@ ConfigureTest(EDGE_BETWEENNESS_CENTRALITY_TEST centrality/edge_betweenness_centr # - WEAKLY CONNECTED COMPONENTS tests ------------------------------------------------------------- ConfigureTest(WEAKLY_CONNECTED_COMPONENTS_TEST components/weakly_connected_components_test.cpp) -############################################################################################### -# - MIS tests ------------------------------------------------------------------------------ +################################################################################################### +# - MIS tests ------------------------------------------------------------------------------------- ConfigureTest(MIS_TEST components/mis_test.cu) target_include_directories(MIS_TEST PRIVATE "${CUGRAPH_SOURCE_DIR}/src") -############################################################################################### -# - VERTEX COLORING tests ------------------------------------------------------------------- +################################################################################################### +# - VERTEX COLORING tests ---------------------------------------------------------------------- ConfigureTest(VERTEX_COLORING_TEST components/vertex_coloring_test.cu) target_include_directories(VERTEX_COLORING_TEST PRIVATE "${CUGRAPH_SOURCE_DIR}/src") @@ -470,7 +470,7 @@ target_include_directories(VERTEX_COLORING_TEST PRIVATE "${CUGRAPH_SOURCE_DIR}/s ConfigureTest(SIMILARITY_TEST link_prediction/similarity_test.cu) ################################################################################################### -# - WEIGHTED_SIMILARITY tests ------------------------------------------------------------------------------ +# - WEIGHTED_SIMILARITY tests --------------------------------------------------------------------- ConfigureTest(WEIGHTED_SIMILARITY_TEST link_prediction/weighted_similarity_test.cpp) ################################################################################################### @@ -498,8 +498,8 @@ ConfigureTest(CORE_NUMBER_TEST cores/core_number_test.cpp) # - Core Number tests ----------------------------------------------------------------------------- ConfigureTest(K_CORE_TEST cores/k_core_test.cpp) -############################################################################################### -# - K-truss tests -------------------------------------------------------------------------- +################################################################################################### +# - K-truss tests --------------------------------------------------------------------------------- ConfigureTest(K_TRUSS_TEST community/k_truss_test.cpp) ################################################################################################### @@ -507,9 +507,12 @@ ConfigureTest(K_TRUSS_TEST community/k_truss_test.cpp) ConfigureTest(TRIANGLE_COUNT_TEST community/triangle_count_test.cpp) ################################################################################################### -# - Edge Triangle Count tests -------------------------------------------------------------------------- +# - Edge Triangle Count tests --------------------------------------------------------------------- ConfigureTest(EDGE_TRIANGLE_COUNT_TEST community/edge_triangle_count_test.cpp) +################################################################################################### +# - EDGE SOURCE DESTINATION LOOKUP tests ---------------------------------------------------------- +ConfigureTest(LOOKUP_SRC_DST_TEST lookup/lookup_src_dst_test.cpp) ################################################################################################### # - K-hop Neighbors tests ------------------------------------------------------------------------- @@ -596,7 +599,7 @@ if(BUILD_CUGRAPH_MG_TESTS) ConfigureTestMG(MG_LEIDEN_TEST community/mg_leiden_test.cpp) ############################################################################################### - # - MG WEIGHTED MATCHING tests -------------------------------------------------------------------------- + # - MG WEIGHTED MATCHING tests ---------------------------------------------------------------- ConfigureTestMG(MG_WEIGHTED_MATCHING_TEST community/mg_weighted_matching_test.cpp) ############################################################################################### @@ -612,7 +615,7 @@ if(BUILD_CUGRAPH_MG_TESTS) ConfigureTestMG(MG_EGONET_TEST community/mg_egonet_test.cu) ############################################################################################### - # - MG EDGE TRIANGLE COUNT tests -------------------------------------------------------------------------- + # - MG EDGE TRIANGLE COUNT tests -------------------------------------------------------------- ConfigureTestMG(MG_EDGE_TRIANGLE_COUNT_TEST community/mg_edge_triangle_count_test.cpp) ############################################################################################### @@ -620,6 +623,10 @@ if(BUILD_CUGRAPH_MG_TESTS) ConfigureTestMG(MG_WEAKLY_CONNECTED_COMPONENTS_TEST components/mg_weakly_connected_components_test.cpp) + ############################################################################################### + # - MG EDGE SOURCE DESTINATION LOOKUP tests --------------------------------------------------- + ConfigureTestMG(MG_LOOKUP_SRC_DST_TEST lookup/mg_lookup_src_dst_test.cpp) + ############################################################################################### # - MG MIS tests ------------------------------------------------------------------------------ ConfigureTestMG(MG_MIS_TEST components/mg_mis_test.cu) @@ -730,7 +737,7 @@ if(BUILD_CUGRAPH_MG_TESTS) ConfigureTestMG(MG_RANDOM_WALKS_TEST sampling/mg_random_walks_test.cpp) ############################################################################################### - # - MG WEIGHTED_SIMILARITY tests ----------------------------------------------------------------------- + # - MG WEIGHTED_SIMILARITY tests -------------------------------------------------------------- ConfigureTestMG(MG_WEIGHTED_SIMILARITY_TEST link_prediction/mg_weighted_similarity_test.cpp) ############################################################################################### diff --git a/cpp/tests/community/mg_weighted_matching_test.cpp b/cpp/tests/community/mg_weighted_matching_test.cpp index 4f36ee36902..8abd7646065 100644 --- a/cpp/tests/community/mg_weighted_matching_test.cpp +++ b/cpp/tests/community/mg_weighted_matching_test.cpp @@ -69,7 +69,7 @@ class Tests_MGWeightedMatching constexpr bool multi_gpu = true; - bool test_weighted = true; + bool test_weighted = false; bool renumber = true; bool drop_self_loops = false; bool drop_multi_edges = false; @@ -107,10 +107,23 @@ class Tests_MGWeightedMatching rmm::device_uvector mg_partners(0, handle_->get_stream()); weight_t mg_matching_weights; + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement + handle_->get_comms().barrier(); + hr_timer.start("MG Approximate Weighted Matching"); + } + std::forward_as_tuple(mg_partners, mg_matching_weights) = cugraph::approximate_weighted_matching( *handle_, mg_graph_view, (*mg_edge_weights).view()); + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement + handle_->get_comms().barrier(); + hr_timer.stop(); + hr_timer.display_and_clear(std::cout); + } + if (weighted_matching_usecase.check_correctness) { auto h_mg_partners = cugraph::test::to_host(*handle_, mg_partners); diff --git a/cpp/tests/lookup/lookup_src_dst_test.cpp b/cpp/tests/lookup/lookup_src_dst_test.cpp new file mode 100644 index 00000000000..b2e4355dff4 --- /dev/null +++ b/cpp/tests/lookup/lookup_src_dst_test.cpp @@ -0,0 +1,306 @@ + +/* + * 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 governin_from_mtxg permissions and + * limitations under the License. + */ + +#include "utilities/base_fixture.hpp" +#include "utilities/conversion_utilities.hpp" +#include "utilities/property_generator_utilities.hpp" +#include "utilities/test_graphs.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +struct EdgeSrcDstLookup_UseCase { + // FIXME: Test with edge mask once the graph generator is updated to generate edge ids and types + bool check_correctness{true}; +}; + +template +class Tests_SGLookupEdgeSrcDst + : public ::testing::TestWithParam> { + public: + Tests_SGLookupEdgeSrcDst() {} + + static void SetUpTestCase() {} + static void TearDownTestCase() {} + + virtual void SetUp() {} + virtual void TearDown() {} + + template + void run_current_test(std::tuple const& param) + { + auto [lookup_usecase, input_usecase] = param; + + raft::handle_t handle{}; + HighResTimer hr_timer{}; + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); + hr_timer.start("Construct graph"); + } + + constexpr bool multi_gpu = false; + + bool test_weighted = true; + bool renumber = true; + bool drop_self_loops = false; + bool drop_multi_edges = false; + + auto [sg_graph, sg_edge_weights, sg_renumber_map] = + cugraph::test::construct_graph( + handle, input_usecase, test_weighted, renumber, drop_self_loops, drop_multi_edges); + + std::tie(sg_graph, sg_edge_weights, sg_renumber_map) = cugraph::symmetrize_graph( + handle, std::move(sg_graph), std::move(sg_edge_weights), std::move(sg_renumber_map), false); + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); + hr_timer.stop(); + hr_timer.display_and_clear(std::cout); + } + + auto sg_graph_view = sg_graph.view(); + auto sg_edge_weight_view = + sg_edge_weights ? std::make_optional((*sg_edge_weights).view()) : std::nullopt; + + std::optional> edge_mask{std::nullopt}; + + // + // FIXME: As the graph generator doesn't generate edge ids and types at the moment, generate + // edge ids and types for now and remove the code for generating edge ids and types from this + // file once the graph generator is updated to generate edge ids and types. + // + + int32_t number_of_edge_types = std::max( + 1 << 8, + static_cast(std::rand() % (1 + (sg_graph_view.number_of_vertices() / (1 << 16))))); + + std::optional> edge_types{ + std::nullopt}; + edge_types = cugraph::test::generate::edge_property( + handle, sg_graph_view, number_of_edge_types); + + std::optional> edge_ids{std::nullopt}; + + edge_ids = cugraph::test::generate::edge_property( + handle, sg_graph_view, 1); + + auto edge_counts = (*edge_ids).view().edge_counts(); + + std::vector type_freqs(number_of_edge_types, 0); + std::mutex mtx[number_of_edge_types]; + + for (size_t ep_idx = 0; ep_idx < edge_counts.size(); ep_idx++) { + auto ep_types = + cugraph::test::to_host(handle, + raft::device_span( + (*edge_types).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + std::for_each(std::execution::par, ep_types.begin(), ep_types.end(), [&](int32_t et) { + std::lock_guard guard(mtx[et]); + type_freqs[et]++; + }); + + auto ep_ids = + cugraph::test::to_host(handle, + raft::device_span( + (*edge_ids).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + } + + assert(std::reduce(type_freqs.cbegin(), type_freqs.cend()) == + std::reduce(edge_counts.cbegin(), edge_counts.cend())); + + auto d_type_freqs = cugraph::test::to_device(handle, type_freqs); + + std::vector type_offsets(number_of_edge_types); + + std::copy(type_freqs.begin(), type_freqs.end(), type_offsets.begin()); + + assert(std::reduce(type_offsets.cbegin(), type_offsets.cend()) == + sg_graph_view.compute_number_of_edges(handle)); + + auto number_of_local_edges = std::reduce(edge_counts.cbegin(), edge_counts.cend()); + + for (size_t ep_idx = 0; ep_idx < edge_counts.size(); ep_idx++) { + auto ep_types = + cugraph::test::to_host(handle, + raft::device_span( + (*edge_types).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + auto ep_ids = + cugraph::test::to_host(handle, + raft::device_span( + (*edge_ids).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + std::transform(ep_types.cbegin(), ep_types.cend(), ep_ids.begin(), [&](int32_t et) { + edge_t val = type_offsets[et]; + type_offsets[et]++; + return val; + }); + + raft::update_device((*edge_ids).mutable_view().value_firsts()[ep_idx], + ep_ids.data(), + ep_ids.size(), + handle.get_stream()); + } + + auto search_container = + cugraph::build_edge_id_and_type_to_src_dst_lookup_map( + handle, sg_graph_view, (*edge_ids).view(), (*edge_types).view()); + + if (lookup_usecase.check_correctness) { + rmm::device_uvector d_mg_srcs(0, handle.get_stream()); + rmm::device_uvector d_mg_dsts(0, handle.get_stream()); + + std::optional> d_mg_edge_ids{std::nullopt}; + std::optional> d_mg_edge_types{std::nullopt}; + + std::tie(d_mg_srcs, d_mg_dsts, std::ignore, d_mg_edge_ids, d_mg_edge_types) = + cugraph::decompress_to_edgelist( + handle, + sg_graph_view, + std::optional>{std::nullopt}, + std::make_optional((*edge_ids).view()), + std::make_optional((*edge_types).view()), + std::optional>{std::nullopt}); + + auto number_of_edges = sg_graph_view.compute_number_of_edges(handle); + + auto h_mg_edge_ids = cugraph::test::to_host(handle, d_mg_edge_ids); + auto h_mg_edge_types = cugraph::test::to_host(handle, d_mg_edge_types); + + auto h_srcs_expected = cugraph::test::to_host(handle, d_mg_srcs); + auto h_dsts_expected = cugraph::test::to_host(handle, d_mg_dsts); + + if (number_of_local_edges > 0) { + int nr_wrong_ids_or_types = (std::rand() % number_of_local_edges); + + for (int k = 0; k < nr_wrong_ids_or_types; k++) { + auto id_or_type = std::rand() % 2; + auto random_idx = std::rand() % number_of_local_edges; + if (id_or_type) + (*h_mg_edge_ids)[random_idx] = std::numeric_limits::max(); + else + (*h_mg_edge_types)[random_idx] = std::numeric_limits::max() - 2; + + h_srcs_expected[random_idx] = cugraph::invalid_vertex_id::value; + h_dsts_expected[random_idx] = cugraph::invalid_vertex_id::value; + } + } + + d_mg_edge_ids = cugraph::test::to_device(handle, h_mg_edge_ids); + d_mg_edge_types = cugraph::test::to_device(handle, h_mg_edge_types); + + auto [srcs, dsts] = + cugraph::lookup_endpoints_from_edge_ids_and_types( + handle, + search_container, + raft::device_span((*d_mg_edge_ids).begin(), (*d_mg_edge_ids).size()), + raft::device_span((*d_mg_edge_types).begin(), (*d_mg_edge_types).size())); + + auto h_srcs_results = cugraph::test::to_host(handle, srcs); + auto h_dsts_results = cugraph::test::to_host(handle, dsts); + + EXPECT_EQ(h_srcs_expected.size(), h_srcs_results.size()); + ASSERT_TRUE( + std::equal(h_srcs_expected.begin(), h_srcs_expected.end(), h_srcs_results.begin())); + + EXPECT_EQ(h_dsts_expected.size(), h_dsts_results.size()); + ASSERT_TRUE( + std::equal(h_dsts_expected.begin(), h_dsts_expected.end(), h_dsts_results.begin())); + } + } +}; + +using Tests_SGLookupEdgeSrcDst_File = Tests_SGLookupEdgeSrcDst; +using Tests_SGLookupEdgeSrcDst_Rmat = Tests_SGLookupEdgeSrcDst; + +TEST_P(Tests_SGLookupEdgeSrcDst_File, CheckInt32Int32FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_SGLookupEdgeSrcDst_File, CheckInt32Int64FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_SGLookupEdgeSrcDst_File, CheckInt64Int64FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_SGLookupEdgeSrcDst_Rmat, CheckInt32Int32FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_SGLookupEdgeSrcDst_Rmat, CheckInt32Int64FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_SGLookupEdgeSrcDst_Rmat, CheckInt64Int64FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +INSTANTIATE_TEST_SUITE_P( + file_test, + Tests_SGLookupEdgeSrcDst_File, + ::testing::Combine(::testing::Values(EdgeSrcDstLookup_UseCase{}), + ::testing::Values(cugraph::test::File_Usecase("test/datasets/karate.mtx")))); + +INSTANTIATE_TEST_SUITE_P(rmat_small_test, + Tests_SGLookupEdgeSrcDst_Rmat, + ::testing::Combine(::testing::Values(EdgeSrcDstLookup_UseCase{}), + ::testing::Values(cugraph::test::Rmat_Usecase( + 3, 3, 0.57, 0.19, 0.19, 0, true, false)))); + +INSTANTIATE_TEST_SUITE_P( + rmat_benchmark_test, /* note that scale & edge factor can be overridden in benchmarking (with + --gtest_filter to select only the rmat_benchmark_test with a specific + vertex & edge type combination) by command line arguments and do not + include more than one Rmat_Usecase that differ only in scale or edge + factor (to avoid running same benchmarks more than once) */ + Tests_SGLookupEdgeSrcDst_Rmat, + ::testing::Combine( + ::testing::Values(EdgeSrcDstLookup_UseCase{false}), + ::testing::Values(cugraph::test::Rmat_Usecase(20, 32, 0.57, 0.19, 0.19, 0, false, false)))); + +CUGRAPH_TEST_PROGRAM_MAIN() diff --git a/cpp/tests/lookup/mg_lookup_src_dst_test.cpp b/cpp/tests/lookup/mg_lookup_src_dst_test.cpp new file mode 100644 index 00000000000..26119801b76 --- /dev/null +++ b/cpp/tests/lookup/mg_lookup_src_dst_test.cpp @@ -0,0 +1,349 @@ +/* + * 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 governin_from_mtxg permissions and + * limitations under the License. + */ + +#include "utilities/base_fixture.hpp" +#include "utilities/conversion_utilities.hpp" +#include "utilities/device_comm_wrapper.hpp" +#include "utilities/mg_utilities.hpp" +#include "utilities/property_generator_utilities.hpp" +#include "utilities/test_graphs.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include + +struct EdgeSrcDstLookup_UseCase { + // FIXME: Test with edge mask once the graph generator is updated to generate edge ids and types + bool check_correctness{true}; +}; + +template +class Tests_MGLookupEdgeSrcDst + : public ::testing::TestWithParam> { + public: + Tests_MGLookupEdgeSrcDst() {} + + static void SetUpTestCase() { handle_ = cugraph::test::initialize_mg_handle(); } + static void TearDownTestCase() { handle_.reset(); } + + virtual void SetUp() {} + virtual void TearDown() {} + + template + void run_current_test(std::tuple const& param) + { + auto [lookup_usecase, input_usecase] = param; + + HighResTimer hr_timer{}; + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); + handle_->get_comms().barrier(); + hr_timer.start("MG Construct graph"); + } + + constexpr bool multi_gpu = true; + + bool test_weighted = false; + bool renumber = true; + bool drop_self_loops = false; + bool drop_multi_edges = false; + + auto [mg_graph, mg_edge_weights, mg_renumber_map] = + cugraph::test::construct_graph( + *handle_, input_usecase, test_weighted, renumber, drop_self_loops, drop_multi_edges); + + std::tie(mg_graph, mg_edge_weights, mg_renumber_map) = cugraph::symmetrize_graph( + *handle_, + std::move(mg_graph), + std::move(mg_edge_weights), + mg_renumber_map ? std::optional>(std::move(*mg_renumber_map)) + : std::nullopt, + false); + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); + handle_->get_comms().barrier(); + hr_timer.stop(); + hr_timer.display_and_clear(std::cout); + } + + auto mg_graph_view = mg_graph.view(); + auto mg_edge_weight_view = + mg_edge_weights ? std::make_optional((*mg_edge_weights).view()) : std::nullopt; + + std::optional> edge_mask{std::nullopt}; + + // + // FIXME: As the graph generator doesn't generate edge ids and types at the moment, generate + // edge ids and types for now and remove the code for generating edge ids and types from this + // file once the graph generator is updated to generate edge ids and types. + // + + int number_of_edge_types = std::max( + 1 << 8, + static_cast(std::rand() % (1 + (mg_graph_view.number_of_vertices() / (1 << 20))))); + + std::optional> edge_types{ + std::nullopt}; + edge_types = cugraph::test::generate::edge_property( + *handle_, mg_graph_view, number_of_edge_types); + + std::optional> edge_ids{std::nullopt}; + + edge_ids = cugraph::test::generate::edge_property( + *handle_, mg_graph_view, 1); + + auto edge_counts = (*edge_ids).view().edge_counts(); + + auto const comm_rank = (*handle_).get_comms().get_rank(); + auto const comm_size = (*handle_).get_comms().get_size(); + + std::vector type_freqs(number_of_edge_types, 0); + std::mutex mtx[number_of_edge_types]; + + for (size_t ep_idx = 0; ep_idx < edge_counts.size(); ep_idx++) { + auto ep_types = + cugraph::test::to_host(*handle_, + raft::device_span( + (*edge_types).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + std::for_each(std::execution::par, ep_types.begin(), ep_types.end(), [&](int32_t et) { + std::lock_guard guard(mtx[et]); + type_freqs[et]++; + }); + + auto ep_ids = + cugraph::test::to_host(*handle_, + raft::device_span( + (*edge_ids).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + } + + assert(std::reduce(type_freqs.cbegin(), type_freqs.cend()) == + std::reduce(edge_counts.cbegin(), edge_counts.cend())); + + auto d_type_freqs = cugraph::test::to_device(*handle_, type_freqs); + d_type_freqs = + cugraph::test::device_allgatherv(*handle_, d_type_freqs.data(), d_type_freqs.size()); + type_freqs = cugraph::test::to_host(*handle_, d_type_freqs); + + std::vector distributed_type_offsets(comm_size * number_of_edge_types); + + for (size_t i = 0; i < number_of_edge_types; i++) { + for (size_t j = 0; j < comm_size; j++) { + distributed_type_offsets[j + comm_size * i] = type_freqs[number_of_edge_types * j + i]; + } + } + + // prefix sum for each type + for (size_t i = 0; i < number_of_edge_types; i++) { + auto start = distributed_type_offsets.begin() + i * comm_size; + std::exclusive_scan(start, start + comm_size, start, 0); + } + + assert(std::reduce(distributed_type_offsets.cbegin(), distributed_type_offsets.cend()) == + mg_graph_view.compute_number_of_edges(*handle_)); + + auto number_of_local_edges = std::reduce(edge_counts.cbegin(), edge_counts.cend()); + + for (size_t ep_idx = 0; ep_idx < edge_counts.size(); ep_idx++) { + auto ep_types = + cugraph::test::to_host(*handle_, + raft::device_span( + (*edge_types).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + auto ep_ids = + cugraph::test::to_host(*handle_, + raft::device_span( + (*edge_ids).view().value_firsts()[ep_idx], edge_counts[ep_idx])); + + std::transform(ep_types.cbegin(), ep_types.cend(), ep_ids.begin(), [&](int32_t et) { + edge_t val = distributed_type_offsets[(comm_size * et + comm_rank)]; + distributed_type_offsets[(comm_size * et + comm_rank)]++; + return val; + }); + + raft::update_device((*edge_ids).mutable_view().value_firsts()[ep_idx], + ep_ids.data(), + ep_ids.size(), + handle_->get_stream()); + } + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement + handle_->get_comms().barrier(); + hr_timer.start("MG Build Lookup Map"); + } + + auto search_container = + cugraph::build_edge_id_and_type_to_src_dst_lookup_map( + *handle_, mg_graph_view, (*edge_ids).view(), (*edge_types).view()); + + if (cugraph::test::g_perf) { + RAFT_CUDA_TRY(cudaDeviceSynchronize()); // for consistent performance measurement + handle_->get_comms().barrier(); + hr_timer.stop(); + hr_timer.display_and_clear(std::cout); + } + + if (lookup_usecase.check_correctness) { + rmm::device_uvector d_mg_srcs(0, handle_->get_stream()); + rmm::device_uvector d_mg_dsts(0, handle_->get_stream()); + + std::optional> d_mg_edge_ids{std::nullopt}; + std::optional> d_mg_edge_types{std::nullopt}; + + std::tie(d_mg_srcs, d_mg_dsts, std::ignore, d_mg_edge_ids, d_mg_edge_types) = + cugraph::decompress_to_edgelist( + *handle_, + mg_graph_view, + std::optional>{std::nullopt}, + std::make_optional((*edge_ids).view()), + std::make_optional((*edge_types).view()), + std::optional>{std::nullopt}); + + auto number_of_edges = mg_graph_view.compute_number_of_edges(*handle_); + + auto h_mg_edge_ids = cugraph::test::to_host(*handle_, d_mg_edge_ids); + auto h_mg_edge_types = cugraph::test::to_host(*handle_, d_mg_edge_types); + + auto h_srcs_expected = cugraph::test::to_host(*handle_, d_mg_srcs); + auto h_dsts_expected = cugraph::test::to_host(*handle_, d_mg_dsts); + + if (number_of_local_edges > 0) { + int nr_wrong_ids_or_types = (std::rand() % number_of_local_edges); + + for (int k = 0; k < nr_wrong_ids_or_types; k++) { + auto id_or_type = std::rand() % 2; + auto random_idx = std::rand() % number_of_local_edges; + if (id_or_type) + (*h_mg_edge_ids)[random_idx] = std::numeric_limits::max(); + else + (*h_mg_edge_types)[random_idx] = std::numeric_limits::max() - 2; + + h_srcs_expected[random_idx] = cugraph::invalid_vertex_id::value; + h_dsts_expected[random_idx] = cugraph::invalid_vertex_id::value; + } + } + + d_mg_edge_ids = cugraph::test::to_device(*handle_, h_mg_edge_ids); + d_mg_edge_types = cugraph::test::to_device(*handle_, h_mg_edge_types); + + auto [srcs, dsts] = + cugraph::lookup_endpoints_from_edge_ids_and_types( + *handle_, + search_container, + raft::device_span((*d_mg_edge_ids).begin(), (*d_mg_edge_ids).size()), + raft::device_span((*d_mg_edge_types).begin(), (*d_mg_edge_types).size())); + + auto h_srcs_results = cugraph::test::to_host(*handle_, srcs); + auto h_dsts_results = cugraph::test::to_host(*handle_, dsts); + + EXPECT_EQ(h_srcs_expected.size(), h_srcs_results.size()); + ASSERT_TRUE( + std::equal(h_srcs_expected.begin(), h_srcs_expected.end(), h_srcs_results.begin())); + + EXPECT_EQ(h_dsts_expected.size(), h_dsts_results.size()); + ASSERT_TRUE( + std::equal(h_dsts_expected.begin(), h_dsts_expected.end(), h_dsts_results.begin())); + } + } + + private: + static std::unique_ptr handle_; +}; + +template +std::unique_ptr Tests_MGLookupEdgeSrcDst::handle_ = nullptr; + +using Tests_MGLookupEdgeSrcDst_File = Tests_MGLookupEdgeSrcDst; +using Tests_MGLookupEdgeSrcDst_Rmat = Tests_MGLookupEdgeSrcDst; + +TEST_P(Tests_MGLookupEdgeSrcDst_File, CheckInt32Int32FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_MGLookupEdgeSrcDst_File, CheckInt32Int64FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_MGLookupEdgeSrcDst_File, CheckInt64Int64FloatFloat) +{ + run_current_test( + override_File_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_MGLookupEdgeSrcDst_Rmat, CheckInt32Int32FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_MGLookupEdgeSrcDst_Rmat, CheckInt32Int64FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +TEST_P(Tests_MGLookupEdgeSrcDst_Rmat, CheckInt64Int64FloatFloat) +{ + run_current_test( + override_Rmat_Usecase_with_cmd_line_arguments(GetParam())); +} + +INSTANTIATE_TEST_SUITE_P( + file_test, + Tests_MGLookupEdgeSrcDst_File, + ::testing::Combine(::testing::Values(EdgeSrcDstLookup_UseCase{}), + ::testing::Values(cugraph::test::File_Usecase("test/datasets/karate.mtx")))); + +INSTANTIATE_TEST_SUITE_P(rmat_small_test, + Tests_MGLookupEdgeSrcDst_Rmat, + ::testing::Combine(::testing::Values(EdgeSrcDstLookup_UseCase{}), + ::testing::Values(cugraph::test::Rmat_Usecase( + 3, 2, 0.57, 0.19, 0.19, 0, true, false)))); + +INSTANTIATE_TEST_SUITE_P( + rmat_benchmark_test, /* note that scale & edge factor can be overridden in benchmarking (with + --gtest_filter to select only the rmat_benchmark_test with a specific + vertex & edge type combination) by command line arguments and do not + include more than one Rmat_Usecase that differ only in scale or edge + factor (to avoid running same benchmarks more than once) */ + Tests_MGLookupEdgeSrcDst_Rmat, + ::testing::Combine( + ::testing::Values(EdgeSrcDstLookup_UseCase{false}), + ::testing::Values(cugraph::test::Rmat_Usecase(5, 32, 0.57, 0.19, 0.19, 0, true, false)))); + +CUGRAPH_MG_TEST_PROGRAM_MAIN()