Bolt  1.3
C++ template library with support for OpenCL
replace.h
Go to the documentation of this file.
1 /***************************************************************************
2 * © 2012,2014 Advanced Micro Devices, Inc. All rights reserved.
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 
22 #pragma once
23 #if !defined( BOLT_AMP_REPLACE_H )
24 #define BOLT_AMP_REPLACE_H
25 
26 #include <amp.h>
27 #include "bolt/amp/functional.h"
28 
29 #include "bolt/amp/bolt.h"
30 #include <string>
31 #include <assert.h>
32 
37 namespace bolt
38 {
39  namespace amp
40  {
113  template<typename InputIterator, typename T>
114  void replace(InputIterator first,
115  InputIterator last,
116  const T &old_value,
117  const T &new_value);
118 
119  template<typename InputIterator, typename T>
120  void replace(control &ctl,
121  InputIterator first,
122  InputIterator last,
123  const T &old_value,
124  const T &new_value);
125 
126  template<typename InputIterator, typename Predicate, typename T>
127  void replace_if(control &ctl,
128  InputIterator first,
129  InputIterator last,
130  Predicate pred,
131  const T &new_value);
132 
133  template<typename InputIterator, typename Predicate, typename T>
134  void replace_if(InputIterator first,
135  InputIterator last,
136  Predicate pred,
137  const T &new_value);
138 
139  template<typename InputIterator1, typename InputIterator2, typename Predicate, typename T>
140  void replace_if (InputIterator1 first, InputIterator1 last, InputIterator2 stencil, Predicate pred, const T &new_value);
141 
142 
143  template<typename InputIterator1, typename InputIterator2, typename Predicate, typename T>
144  void replace_if (control &ctl, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, Predicate pred, const T &new_value);
145 
146 
147 
203  template< typename InputIterator, typename OutputIterator, typename Predicate, typename T>
204  OutputIterator replace_copy_if(control &ctl,
205  InputIterator first,
206  InputIterator last,
207  OutputIterator result,
208  Predicate pred,
209  const T &new_value);
210 
211  template< typename InputIterator, typename OutputIterator, typename Predicate, typename T>
212  OutputIterator replace_copy_if(InputIterator first,
213  InputIterator last,
214  OutputIterator result,
215  Predicate pred,
216  const T &new_value);
217 
218  template<typename InputIterator1, typename InputIterator2, typename OutputIterator, typename Predicate, typename T>
219  OutputIterator replace_copy_if(control &ctl,
220  InputIterator1 first,
221  InputIterator1 last,
222  InputIterator2 stencil,
223  OutputIterator result,
224  Predicate pred,
225  const T &new_value);
226 
227  template<typename InputIterator1, typename InputIterator2, typename OutputIterator, typename Predicate, typename T>
228  OutputIterator replace_copy_if(InputIterator1 first,
229  InputIterator1 last,
230  InputIterator2 stencil,
231  OutputIterator result,
232  Predicate pred,
233  const T &new_value);
234 
235  template<typename InputIterator, typename OutputIterator, typename T>
236  OutputIterator replace_copy(control &ctl,
237  InputIterator first,
238  InputIterator last,
239  OutputIterator result,
240  const T &old_value,
241  const T &new_value);
242 
243  template<typename InputIterator, typename OutputIterator, typename T>
244  OutputIterator replace_copy(InputIterator first,
245  InputIterator last,
246  OutputIterator result,
247  const T &old_value,
248  const T &new_value);
249 
250 
253  }//amp namespace ends
254 }//bolt namespace ends
255 
256 #include <bolt/amp/detail/replace.inl>
257 
258 #endif // AMP_REPLACE_H
259 
260