OSDN Git Service

modified: utilsrc/src/Admin/Makefile
[eos/others.git] / utiltools / X86MAC64 / cuda / include / thrust / detail / fill.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 fill.inl
19  *  \brief Inline file for fill.h.
20  */
21
22 #include <thrust/fill.h>
23 #include <thrust/iterator/iterator_traits.h>
24 #include <thrust/system/detail/generic/select_system.h>
25 #include <thrust/system/detail/generic/fill.h>
26 #include <thrust/system/detail/adl/fill.h>
27
28 namespace thrust
29 {
30
31
32 template<typename DerivedPolicy, typename ForwardIterator, typename T>
33   void fill(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
34             ForwardIterator first,
35             ForwardIterator last,
36             const T &value)
37 {
38   using thrust::system::detail::generic::fill;
39   return fill(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, last, value);
40 } // end fill()
41
42
43 template<typename DerivedPolicy, typename OutputIterator, typename Size, typename T>
44   OutputIterator fill_n(const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
45                         OutputIterator first,
46                         Size n,
47                         const T &value)
48 {
49   using thrust::system::detail::generic::fill_n;
50   return fill_n(thrust::detail::derived_cast(thrust::detail::strip_const(exec)), first, n, value);
51 } // end fill_n()
52
53
54 template<typename ForwardIterator, typename T>
55   void fill(ForwardIterator first,
56             ForwardIterator last,
57             const T &value)
58 {
59   using thrust::system::detail::generic::select_system;
60
61   typedef typename thrust::iterator_system<ForwardIterator>::type System;
62
63   System system;
64
65   thrust::fill(select_system(system), first, last, value);
66 } // end fill()
67
68
69 template<typename OutputIterator, typename Size, typename T>
70   OutputIterator fill_n(OutputIterator first,
71                         Size n,
72                         const T &value)
73 {
74   using thrust::system::detail::generic::select_system;
75
76   typedef typename thrust::iterator_system<OutputIterator>::type System;
77
78   System system;
79
80   return thrust::fill_n(select_system(system), first, n, value);
81 } // end fill()
82
83
84 } // end namespace thrust
85