| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #pragma once |
|
|
| #include <thrust/detail/config.h> |
|
|
| #if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) |
| # pragma GCC system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) |
| # pragma clang system_header |
| #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) |
| # pragma system_header |
| #endif |
| #include <thrust/system/omp/detail/copy.h> |
| #include <thrust/system/detail/generic/copy.h> |
| #include <thrust/system/detail/sequential/copy.h> |
| #include <thrust/detail/type_traits/minimum_type.h> |
|
|
|
|
| THRUST_NAMESPACE_BEGIN |
| namespace system |
| { |
| namespace omp |
| { |
| namespace detail |
| { |
| namespace dispatch |
| { |
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename OutputIterator> |
| OutputIterator copy(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| InputIterator last, |
| OutputIterator result, |
| thrust::incrementable_traversal_tag) |
| { |
| return thrust::system::detail::sequential::copy(exec, first, last, result); |
| } |
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename OutputIterator> |
| OutputIterator copy(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| InputIterator last, |
| OutputIterator result, |
| thrust::random_access_traversal_tag) |
| { |
| return thrust::system::detail::generic::copy(exec, first, last, result); |
| } |
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename Size, |
| typename OutputIterator> |
| OutputIterator copy_n(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| Size n, |
| OutputIterator result, |
| thrust::incrementable_traversal_tag) |
| { |
| return thrust::system::detail::sequential::copy_n(exec, first, n, result); |
| } |
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename Size, |
| typename OutputIterator> |
| OutputIterator copy_n(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| Size n, |
| OutputIterator result, |
| thrust::random_access_traversal_tag) |
| { |
| return thrust::system::detail::generic::copy_n(exec, first, n, result); |
| } |
|
|
|
|
| } |
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename OutputIterator> |
| OutputIterator copy(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| InputIterator last, |
| OutputIterator result) |
| { |
| typedef typename thrust::iterator_traversal<InputIterator>::type traversal1; |
| typedef typename thrust::iterator_traversal<OutputIterator>::type traversal2; |
|
|
| typedef typename thrust::detail::minimum_type<traversal1,traversal2>::type traversal; |
|
|
| |
| return thrust::system::omp::detail::dispatch::copy(exec, first, last, result, traversal()); |
| } |
|
|
|
|
|
|
| template<typename DerivedPolicy, |
| typename InputIterator, |
| typename Size, |
| typename OutputIterator> |
| OutputIterator copy_n(execution_policy<DerivedPolicy> &exec, |
| InputIterator first, |
| Size n, |
| OutputIterator result) |
| { |
| typedef typename thrust::iterator_traversal<InputIterator>::type traversal1; |
| typedef typename thrust::iterator_traversal<OutputIterator>::type traversal2; |
|
|
| typedef typename thrust::detail::minimum_type<traversal1,traversal2>::type traversal; |
|
|
| |
| return thrust::system::omp::detail::dispatch::copy_n(exec, first, n, result, traversal()); |
| } |
|
|
|
|
| } |
| } |
| } |
| THRUST_NAMESPACE_END |
|
|
|
|