1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_ALGORITHM_REMOVE_HPP
12 #define BOOST_COMPUTE_ALGORITHM_REMOVE_HPP
14 #include <boost/compute/lambda.hpp>
15 #include <boost/compute/system.hpp>
16 #include <boost/compute/algorithm/remove_if.hpp>
17 #include <boost/compute/type_traits/vector_size.hpp>
22 /// Removes each element equal to \p value in the range [\p first,
26 template<class Iterator, class T>
27 inline Iterator remove(Iterator first,
30 command_queue &queue = system::default_queue())
32 typedef typename std::iterator_traits<Iterator>::value_type value_type;
34 using ::boost::compute::_1;
35 using ::boost::compute::lambda::all;
37 if(vector_size<value_type>::value == 1){
38 return ::boost::compute::remove_if(first,
44 return ::boost::compute::remove_if(first,
51 } // end compute namespace
52 } // end boost namespace
54 #endif // BOOST_COMPUTE_ALGORITHM_REMOVE_HPP