Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing Thrust includes #678

Merged
merged 10 commits into from
Jun 17, 2022
3 changes: 3 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ rapids_cuda_init_architectures(RAFT)

project(RAFT VERSION 22.08.00 LANGUAGES CXX CUDA)

include(${rapids-cmake-dir}/cpm/package_override.cmake)
rapids_cpm_package_override(${CMAKE_CURRENT_SOURCE_DIR}/versions.json)

# Needed because GoogleBenchmark changes the state of FindThreads.cmake, causing subsequent runs to
# have different values for the `Threads::Threads` target. Setting this flag ensures
# `Threads::Threads` is the same value in first run and subsequent runs.
Expand Down
7 changes: 7 additions & 0 deletions cpp/include/raft/cluster/detail/kmeans.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@

#include <cuda.h>
#include <thrust/binary_search.h>
#include <thrust/device_ptr.h>
#include <thrust/fill.h>
#include <thrust/find.h>
#include <thrust/functional.h>
#include <thrust/gather.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/memory.h>
#include <thrust/random.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>
#include <thrust/sequence.h>
#include <thrust/sort.h>
#include <thrust/transform.h>

#include <raft/cuda_utils.cuh>
#include <raft/cudart_utils.h>
Expand Down
1 change: 1 addition & 0 deletions cpp/include/raft/core/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <cinttypes> // size_t
#include <cstddef> // std::byte
#include <raft/detail/span.hpp>
#include <thrust/distance.h>
#include <thrust/functional.h>
#include <thrust/host_vector.h> // __host__ __device__
#include <thrust/iterator/reverse_iterator.h>
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/lap/detail/lap_functions.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <rmm/device_scalar.hpp>
#include <rmm/device_uvector.hpp>

#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>

Expand Down
1 change: 1 addition & 0 deletions cpp/include/raft/lap/detail/lap_kernels.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <raft/cudart_utils.h>
#include <raft/handle.hpp>

#include <thrust/execution_policy.h>
#include <thrust/for_each.h>

#include <cstddef>
Expand Down
3 changes: 3 additions & 0 deletions cpp/include/raft/lap/lap.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#include <raft/handle.hpp>
#include <rmm/device_uvector.hpp>

#include <thrust/execution_policy.h>
#include <thrust/fill.h>

#include "detail/d_structs.h"
#include "detail/lap_functions.cuh"

Expand Down
3 changes: 3 additions & 0 deletions cpp/include/raft/lap/lap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#include <raft/handle.hpp>
#include <rmm/device_uvector.hpp>

#include <thrust/execution_policy.h>
#include <thrust/fill.h>

#include "detail/d_structs.h"
#include "detail/lap_functions.cuh"

Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/linalg/detail/add.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <raft/linalg/binary_op.cuh>
#include <raft/linalg/unary_op.cuh>

#include <thrust/functional.h>

namespace raft {
namespace linalg {
namespace detail {
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/linalg/detail/eltwise.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <raft/linalg/binary_op.cuh>
#include <raft/linalg/unary_op.cuh>

#include <thrust/functional.h>

namespace raft {
namespace linalg {
namespace detail {
Expand Down
1 change: 1 addition & 0 deletions cpp/include/raft/matrix/detail/matrix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <rmm/exec_policy.hpp>

#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>

#include <algorithm>
#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,9 @@

#include <rmm/device_uvector.hpp>

#include <thrust/scan.h>
#include <thrust/transform.h>

namespace raft {
namespace sparse {
namespace distance {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,6 +20,9 @@

#include <cuco/static_map.cuh>

#include <thrust/copy.h>
#include <thrust/iterator/counting_iterator.h>

// this is needed by cuco as key, value must be bitwise comparable.
// compilers don't declare float/double as bitwise comparable
// but that is too strict
Expand Down
3 changes: 3 additions & 0 deletions cpp/include/raft/sparse/distance/detail/l2_distance.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

#include <nvfunctional>

#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>

#include <algorithm>

namespace raft {
Expand Down
7 changes: 7 additions & 0 deletions cpp/include/raft/sparse/hierarchy/detail/agglomerative.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@

#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
#include <thrust/extrema.h>
#include <thrust/fill.h>
#include <thrust/for_each.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/sort.h>
#include <thrust/tuple.h>

#include <cstddef>

Expand Down
4 changes: 4 additions & 0 deletions cpp/include/raft/sparse/hierarchy/detail/connectivities.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <raft/sparse/hierarchy/common.h>
#include <raft/sparse/selection/knn_graph.cuh>

#include <thrust/iterator/zip_iterator.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <limits>

namespace raft {
Expand Down
8 changes: 8 additions & 0 deletions cpp/include/raft/sparse/mst/detail/mst_solver_inl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,20 @@
#include <rmm/device_uvector.hpp>

#include <iostream>
#include <thrust/copy.h>
#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/host_vector.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/sequence.h>
#include <thrust/sort.h>
#include <thrust/transform.h>
#include <thrust/transform_reduce.h>
#include <thrust/tuple.h>
#include <thrust/unique.h>

namespace raft {
namespace mst {
Expand Down
1 change: 1 addition & 0 deletions cpp/include/raft/sparse/op/detail/filter.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <rmm/exec_policy.hpp>

#include <thrust/device_ptr.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>

#include <cuda_runtime.h>
Expand Down
3 changes: 3 additions & 0 deletions cpp/include/raft/sparse/op/detail/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
#include <rmm/exec_policy.hpp>

#include <thrust/device_ptr.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/scan.h>
#include <thrust/sort.h>
#include <thrust/tuple.h>

#include <cusparse_v2.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@

#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>
#include <thrust/copy.h>
#include <thrust/device_ptr.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/scan.h>
#include <thrust/sort.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <cub/cub.cuh>

Expand Down
5 changes: 5 additions & 0 deletions cpp/include/raft/spatial/knn/detail/ball_cover.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@
#include <faiss/gpu/utils/Select.cuh>
#include <faiss/utils/Heap.h>

#include <thrust/fill.h>
#include <thrust/for_each.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/sequence.h>
#include <thrust/sort.h>
#include <thrust/tuple.h>

namespace raft {
namespace spatial {
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/raft/spatial/knn/detail/ball_cover/common.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, NVIDIA CORPORATION.
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@
#include "../haversine_distance.cuh"
#include <cstdint>
#include <thrust/functional.h>
#include <thrust/tuple.h>

namespace raft {
namespace spatial {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <faiss/gpu/utils/Select.cuh>
#include <faiss/utils/Heap.h>

#include <thrust/fill.h>

namespace raft {
namespace spatial {
namespace knn {
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/spectral/detail/matrix_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
#include <raft/sparse/detail/cusparse_wrappers.h>
#include <rmm/device_uvector.hpp>

#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <thrust/reduce.h>
#include <thrust/system/cuda/execution_policy.h>

#include <algorithm>

Expand Down
6 changes: 6 additions & 0 deletions cpp/include/raft/spectral/detail/spectral_util.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@
#include <raft/linalg/detail/cublas_wrappers.hpp>
#include <raft/spectral/matrix_wrappers.hpp>

#include <thrust/device_ptr.h>
#include <thrust/fill.h>
#include <thrust/for_each.h>
#include <thrust/functional.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <algorithm>

Expand Down
4 changes: 4 additions & 0 deletions cpp/include/raft/stats/detail/adjusted_rand_index.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include <rmm/device_scalar.hpp>
#include <rmm/device_uvector.hpp>

#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
#include <thrust/extrema.h>

namespace raft {
namespace stats {
namespace detail {
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/stats/detail/batched/silhouette_score.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>
#include <thrust/device_vector.h>
#include <thrust/fill.h>
#include <thrust/reduce.h>

namespace raft {
namespace stats {
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/stats/detail/contingencyMatrix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <raft/cudart_utils.h>

#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
#include <thrust/extrema.h>
#include <thrust/reduce.h>

#include <cub/cub.cuh>
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/stats/detail/scores.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include <raft/stats/mean.cuh>
#include <rmm/device_scalar.hpp>
#include <rmm/device_uvector.hpp>
#include <thrust/count.h>
#include <thrust/device_ptr.h>
#include <thrust/execution_policy.h>
#include <thrust/reduce.h>

#define N_THREADS 512
Expand Down
1 change: 1 addition & 0 deletions cpp/test/linalg/reduce.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <rmm/device_uvector.hpp>

#include <thrust/device_ptr.h>
#include <thrust/memory.h>

namespace raft {
namespace linalg {
Expand Down
4 changes: 4 additions & 0 deletions cpp/test/matrix/matrix.cu
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <raft/random/rng.cuh>
#include <rmm/device_uvector.hpp>

#include <thrust/copy.h>
#include <thrust/device_ptr.h>
#include <thrust/iterator/counting_iterator.h>

namespace raft {
namespace matrix {

Expand Down
2 changes: 2 additions & 0 deletions cpp/test/mdarray.cu
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include <rmm/device_vector.hpp>
#include <rmm/exec_policy.hpp>
#include <thrust/device_vector.h>
#include <thrust/execution_policy.h>
#include <thrust/for_each.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/sequence.h>

namespace {
namespace stdex = std::experimental;
Expand Down
6 changes: 5 additions & 1 deletion cpp/test/mst.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION.
* Copyright (c) 2020-2022, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,10 @@

#include <bits/stdc++.h>

#include <thrust/execution_policy.h>
#include <thrust/memory.h>
#include <thrust/reduce.h>

#include <cstddef>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions cpp/test/random/make_regression.cu
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <gtest/gtest.h>
#include <thrust/count.h>
#include <thrust/device_ptr.h>
#include <thrust/device_vector.h>

#include "../test_utils.h"
Expand Down
Loading