2 * Copyright 2008-2012 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.
18 /*! \file sequence.inl
19 * \brief Inline file for sequence.h.
22 #include <thrust/detail/config.h>
23 #include <thrust/sequence.h>
24 #include <thrust/iterator/iterator_traits.h>
25 #include <thrust/system/detail/generic/select_system.h>
26 #include <thrust/system/detail/generic/sequence.h>
27 #include <thrust/system/detail/adl/sequence.h>
33 template<typename DerivedPolicy, typename ForwardIterator>
34 void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
35 ForwardIterator first,
38 using thrust::system::detail::generic::sequence;
39 return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last);
43 template<typename DerivedPolicy, typename ForwardIterator, typename T>
44 void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
45 ForwardIterator first,
49 using thrust::system::detail::generic::sequence;
50 return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, init);
54 template<typename DerivedPolicy, typename ForwardIterator, typename T>
55 void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
56 ForwardIterator first,
61 using thrust::system::detail::generic::sequence;
62 return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, init, step);
66 template<typename ForwardIterator>
67 void sequence(ForwardIterator first,
70 using thrust::system::detail::generic::select_system;
72 typedef typename thrust::iterator_system<ForwardIterator>::type System;
76 return thrust::sequence(select_system(system), first, last);
80 template<typename ForwardIterator, typename T>
81 void sequence(ForwardIterator first,
85 using thrust::system::detail::generic::select_system;
87 typedef typename thrust::iterator_system<ForwardIterator>::type System;
91 return thrust::sequence(select_system(system), first, last, init);
95 template<typename ForwardIterator, typename T>
96 void sequence(ForwardIterator first,
101 using thrust::system::detail::generic::select_system;
103 typedef typename thrust::iterator_system<ForwardIterator>::type System;
107 return thrust::sequence(select_system(system), first, last, init, step);
111 } // end namespace thrust