2 * Copyright 2008-2013 NVIDIA Corporation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <thrust/detail/config.h>
18 #include <thrust/tabulate.h>
19 #include <thrust/iterator/iterator_traits.h>
20 #include <thrust/system/detail/generic/select_system.h>
21 #include <thrust/system/detail/generic/tabulate.h>
22 #include <thrust/system/detail/adl/tabulate.h>
28 template<typename DerivedPolicy, typename ForwardIterator, typename UnaryOperation>
29 void tabulate(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
30 ForwardIterator first,
32 UnaryOperation unary_op)
34 using thrust::system::detail::generic::tabulate;
35 return tabulate(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, unary_op);
39 template<typename ForwardIterator, typename UnaryOperation>
40 void tabulate(ForwardIterator first,
42 UnaryOperation unary_op)
44 using thrust::system::detail::generic::select_system;
46 typedef typename thrust::iterator_system<ForwardIterator>::type System;
50 return thrust::tabulate(select_system(system), first, last, unary_op);
54 } // end namespace thrust