OSDN Git Service

modified: utilsrc/src/Admin/Makefile
[eos/others.git] / utiltools / X86MAC64 / cuda / include / thrust / detail / sequence.inl
1 /*
2  *  Copyright 2008-2012 NVIDIA Corporation
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 /*! \file sequence.inl
19  *  \brief Inline file for sequence.h.
20  */
21
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>
28
29 namespace thrust
30 {
31
32
33 template<typename DerivedPolicy, typename ForwardIterator>
34   void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
35                 ForwardIterator first,
36                 ForwardIterator last)
37 {
38   using thrust::system::detail::generic::sequence;
39   return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last);
40 } // end sequence()
41
42
43 template<typename DerivedPolicy, typename ForwardIterator, typename T>
44   void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
45                 ForwardIterator first,
46                 ForwardIterator last,
47                 T init)
48 {
49   using thrust::system::detail::generic::sequence;
50   return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, init);
51 } // end sequence()
52
53
54 template<typename DerivedPolicy, typename ForwardIterator, typename T>
55   void sequence(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
56                 ForwardIterator first,
57                 ForwardIterator last,
58                 T init,
59                 T step)
60 {
61   using thrust::system::detail::generic::sequence;
62   return sequence(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, init, step);
63 } // end sequence()
64
65
66 template<typename ForwardIterator>
67   void sequence(ForwardIterator first,
68                 ForwardIterator last)
69 {
70   using thrust::system::detail::generic::select_system;
71
72   typedef typename thrust::iterator_system<ForwardIterator>::type System;
73
74   System system;
75
76   return thrust::sequence(select_system(system), first, last);
77 } // end sequence()
78
79
80 template<typename ForwardIterator, typename T>
81   void sequence(ForwardIterator first,
82                 ForwardIterator last,
83                 T init)
84 {
85   using thrust::system::detail::generic::select_system;
86
87   typedef typename thrust::iterator_system<ForwardIterator>::type System;
88
89   System system;
90
91   return thrust::sequence(select_system(system), first, last, init);
92 } // end sequence()
93
94
95 template<typename ForwardIterator, typename T>
96   void sequence(ForwardIterator first,
97                 ForwardIterator last,
98                 T init,
99                 T step)
100 {
101   using thrust::system::detail::generic::select_system;
102
103   typedef typename thrust::iterator_system<ForwardIterator>::type System;
104
105   System system;
106
107   return thrust::sequence(select_system(system), first, last, init, step);
108 } // end sequence()
109
110
111 } // end namespace thrust
112