| 30 | /// \see remove() |
| 31 | template<class Iterator, class Predicate> |
| 32 | inline Iterator remove_if(Iterator first, |
| 33 | Iterator last, |
| 34 | Predicate predicate, |
| 35 | command_queue &queue = system::default_queue()) |
| 36 | { |
| 37 | BOOST_STATIC_ASSERT(is_device_iterator<Iterator>::value); |
| 38 | typedef typename std::iterator_traits<Iterator>::value_type value_type; |
| 39 | |
| 40 | // temporary storage for the input data |
| 41 | ::boost::compute::vector<value_type> tmp(first, last, queue); |
| 42 | |
| 43 | return ::boost::compute::copy_if(tmp.begin(), |
| 44 | tmp.end(), |
| 45 | first, |
| 46 | not1(predicate), |
| 47 | queue); |
| 48 | } |
| 49 | |
| 50 | } // end compute namespace |
| 51 | } // end boost namespace |