Skip to content

Commit

Permalink
Introduce thrust/system/detail/internal/reduce_intervals_adl_helper.h.
Browse files Browse the repository at this point in the history
Dispatch reduce_intervals through ADL.

Fixes issue 473
  • Loading branch information
jaredhoberock committed Feb 17, 2012
1 parent 39616e2 commit 05f0598
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
1 change: 1 addition & 0 deletions thrust/system/cpp/detail/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <thrust/system/cpp/detail/merge.h>
#include <thrust/system/cpp/detail/partition.h>
#include <thrust/system/cpp/detail/reduce.h>
#include <thrust/system/cpp/detail/reduce_intervals.h>
#include <thrust/system/cpp/detail/reduce_by_key.h>
#include <thrust/system/cpp/detail/remove.h>
#include <thrust/system/cpp/detail/scan.h>
Expand Down
1 change: 1 addition & 0 deletions thrust/system/cuda/detail/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <thrust/system/cuda/detail/default_decomposition.h>
#include <thrust/system/cuda/detail/fill.h>
#include <thrust/system/cuda/detail/merge.h>
#include <thrust/system/cuda/detail/reduce_intervals.h>
#include <thrust/system/cuda/detail/reduce_by_key.h>
#include <thrust/system/cuda/detail/set_operations.h>

6 changes: 2 additions & 4 deletions thrust/system/detail/internal/reduce_intervals.inl
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
#include <thrust/detail/config.h>
#include <thrust/system/detail/internal/reduce_intervals.h>
#include <thrust/iterator/iterator_traits.h>

#include <thrust/system/detail/generic/select_system.h>
#include <thrust/system/cpp/detail/reduce_intervals.h>
#include <thrust/system/omp/detail/reduce_intervals.h>
#include <thrust/system/cuda/detail/reduce_intervals.h>

#include <thrust/system/detail/internal/reduce_intervals_adl_helper.h>

namespace thrust
{
Expand Down
44 changes: 44 additions & 0 deletions thrust/system/detail/internal/reduce_intervals_adl_helper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2008-2012 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT 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 <thrust/detail/config.h>

// the purpose of this header is to #include the
// reduce_intervals.h header of the host and device systems.

#if THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_CPP
#include <thrust/system/cpp/detail/reduce_intervals.h>
#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_OMP
#include <thrust/system/omp/detail/reduce_intervals.h>
#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_TBB
// tbb does not have a reduce_intervals.h
#else
#error "Unknown host system."
#endif // THRUST_HOST_SYSTEM


#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
#include <thrust/system/cuda/detail/reduce_intervals.h>
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP
#include <thrust/system/omp/detail/reduce_intervals.h>
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB
// tbb does not have a reduce_intervals.h
#else
#error "Unknown device system."
#endif // THRUST_DEVICE_SYSTEM

1 change: 1 addition & 0 deletions thrust/system/omp/detail/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <thrust/system/omp/detail/for_each.h>
#include <thrust/system/omp/detail/partition.h>
#include <thrust/system/omp/detail/reduce.h>
#include <thrust/system/omp/detail/reduce_intervals.h>
#include <thrust/system/omp/detail/reduce_by_key.h>
#include <thrust/system/omp/detail/remove.h>
#include <thrust/system/omp/detail/sort.h>
Expand Down

0 comments on commit 05f0598

Please sign in to comment.