Skip to content

Commit

Permalink
Add missing Thrust includes (#539)
Browse files Browse the repository at this point in the history
## Description

This PR cleans up some `#include`s for Thrust. This is meant to help with the transition to Thrust 1.17 when that is updated in rapids-cmake (rapidsai/rapids-cmake#199).

## Context

Version 1.16 of Thrust reduced the number of internal header inclusions:
> [#1572](NVIDIA/thrust#1572) Removed several unnecessary header includes. Downstream projects may need to update their includes if they were relying on this behavior.

I am making similar changes across all RAPIDS libraries to clean up includes ("include what we use," in essence) to make sure we have compatibility with future versions of Thrust.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #539
  • Loading branch information
bdice authored Jun 17, 2022
1 parent 6f4c3e7 commit 61e386b
Show file tree
Hide file tree
Showing 24 changed files with 106 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/benchmarks/hausdorff_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <cudf/detail/iterator.cuh>
#include <cudf_test/column_wrapper.hpp>

#include <thrust/iterator/constant_iterator.h>

static void BM_hausdorff(benchmark::State& state)
{
int32_t num_spaces = state.range(0) - 1;
Expand Down
1 change: 1 addition & 0 deletions cpp/include/cuspatial/experimental/type_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/transform_output_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/tuple.h>

#include <type_traits>

Expand Down
9 changes: 9 additions & 0 deletions cpp/src/indexing/construction/detail/phase_1.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/copy.h>
#include <thrust/distance.h>
#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/transform_iterator.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/tuple.h>

#include <memory>
#include <tuple>
Expand Down
14 changes: 14 additions & 0 deletions cpp/src/indexing/construction/detail/phase_2.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,23 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/copy.h>
#include <thrust/count.h>
#include <thrust/distance.h>
#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/remove.h>
#include <thrust/replace.h>
#include <thrust/scan.h>
#include <thrust/scatter.h>
#include <thrust/sequence.h>
#include <thrust/sort.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>
#include <thrust/uninitialized_fill.h>

#include <memory>
#include <tuple>
Expand Down
10 changes: 10 additions & 0 deletions cpp/src/indexing/construction/point_quadtree.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/copy.h>
#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/replace.h>
#include <thrust/scan.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

/*
* quadtree indexing on points using the bottom-up algorithm described at ref.
* http://www.adms-conf.org/2019-camera-ready/zhang_adms19.pdf
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/interpolate/cubic_spline.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

#include <cusparse.h>

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

namespace { // anonymous

// This functor performs one linear search for each input point in query_coords
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/join/detail/intersection.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
#include <rmm/exec_policy.hpp>

#include <thrust/copy.h>
#include <thrust/distance.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/remove.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <utility>
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/join/detail/traversal.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/gather.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/scan.h>
#include <thrust/scatter.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

#include <tuple>
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/join/quadtree_point_in_polygon.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@

#include <thrust/binary_search.h>
#include <thrust/copy.h>
#include <thrust/distance.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/remove.h>
#include <thrust/scan.h>
#include <thrust/transform.h>
#include <thrust/tuple.h>

namespace cuspatial {
namespace detail {
Expand Down
7 changes: 7 additions & 0 deletions cpp/src/join/quadtree_point_to_nearest_polyline.cu
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@
#include <rmm/exec_policy.hpp>

#include <thrust/binary_search.h>
#include <thrust/distance.h>
#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>
#include <thrust/scatter.h>
#include <thrust/tuple.h>

#include <limits>
#include <memory>
Expand Down
6 changes: 6 additions & 0 deletions cpp/src/join/quadtree_poly_filtering.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@
#include <rmm/device_uvector.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/copy.h>
#include <thrust/count.h>
#include <thrust/functional.h>
#include <thrust/iterator/permutation_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/sort.h>

#include <tuple>

Expand Down
2 changes: 2 additions & 0 deletions cpp/src/spatial/hausdorff.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <rmm/exec_policy.hpp>

#include <thrust/binary_search.h>
#include <thrust/distance.h>
#include <thrust/fill.h>

#include <memory>
#include <type_traits>
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/spatial/linestring_distance.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#include <rmm/exec_policy.hpp>

#include <thrust/binary_search.h>
#include <thrust/distance.h>
#include <thrust/execution_policy.h>
#include <thrust/fill.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/transform_iterator.h>

Expand Down
5 changes: 5 additions & 0 deletions cpp/src/spatial/lonlat_to_cartesian.cu
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/exec_policy.hpp>

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

#include <type_traits>
#include <utility>

Expand Down
3 changes: 3 additions & 0 deletions cpp/src/spatial/polygon_bounding_box.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
#include <thrust/functional.h>
#include <thrust/gather.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>
#include <thrust/scatter.h>
#include <thrust/tuple.h>

#include <memory>
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/spatial/polyline_bounding_box.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
#include <thrust/functional.h>
#include <thrust/gather.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>
#include <thrust/scatter.h>
#include <thrust/tuple.h>

#include <memory>
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/trajectory/derive_trajectories.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/distance.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/reduce.h>
#include <thrust/scan.h>

#include <memory>
#include <vector>
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/trajectory/trajectory_bounding_boxes.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/fill.h>
#include <thrust/functional.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/tuple.h>

namespace cuspatial {

Expand Down
7 changes: 7 additions & 0 deletions cpp/src/trajectory/trajectory_distances_and_speeds.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
#include <rmm/cuda_stream_view.hpp>
#include <rmm/exec_policy.hpp>

#include <thrust/adjacent_difference.h>
#include <thrust/functional.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/discard_iterator.h>
#include <thrust/iterator/transform_iterator.h>
#include <thrust/iterator/zip_iterator.h>
#include <thrust/reduce.h>
#include <thrust/tuple.h>

namespace cuspatial {

Expand Down
3 changes: 3 additions & 0 deletions cpp/src/utility/scatter_output_iterator.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* limitations under the License.
*/

#include <thrust/detail/use_default.h>
#include <thrust/distance.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/iterator_adaptor.h>
#include <thrust/iterator/iterator_facade.h>

#pragma once

Expand Down
3 changes: 3 additions & 0 deletions cpp/tests/join/point_in_polygon_test_large.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
#include <cudf_test/table_utilities.hpp>
#include <cudf_test/type_lists.hpp>

#include <thrust/distance.h>
#include <thrust/host_vector.h>
#include <thrust/iterator/constant_iterator.h>
#include <thrust/reduce.h>
#include <thrust/sort.h>

#include <ogrsf_frmts.h>
Expand Down
1 change: 1 addition & 0 deletions cpp/tests/spatial/hausdorff_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <thrust/iterator/constant_iterator.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/iterator/transform_iterator.h>

#include <vector>

Expand Down
3 changes: 3 additions & 0 deletions cpp/tests/spatial/point_in_polygon_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <cudf_test/cudf_gtest.hpp>
#include <cudf_test/type_lists.hpp>

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

#include <type_traits>

using namespace cudf::test;
Expand Down
2 changes: 2 additions & 0 deletions cpp/tests/trajectory/test_trajectory_distances_and_speeds.cu
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <cudf_test/column_utilities.hpp>
#include <cudf_test/type_lists.hpp>

#include <thrust/host_vector.h>

#include <cmath>

template <typename T>
Expand Down

0 comments on commit 61e386b

Please sign in to comment.