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_EQUAL_HPP
12 #define BOOST_COMPUTE_ALGORITHM_EQUAL_HPP
14 #include <boost/compute/system.hpp>
15 #include <boost/compute/command_queue.hpp>
16 #include <boost/compute/algorithm/mismatch.hpp>
21 /// Returns \c true if the range [\p first1, \p last1) and the range
22 /// beginning at \p first2 are equal.
23 template<class InputIterator1, class InputIterator2>
24 inline bool equal(InputIterator1 first1,
26 InputIterator2 first2,
27 command_queue &queue = system::default_queue())
29 return ::boost::compute::mismatch(first1,
32 queue).first == last1;
36 template<class InputIterator1, class InputIterator2>
37 inline bool equal(InputIterator1 first1,
39 InputIterator2 first2,
41 command_queue &queue = system::default_queue())
43 if(std::distance(first1, last1) != std::distance(first2, last2)){
47 return ::boost::compute::equal(first1, last1, first2, queue);
50 } // end compute namespace
51 } // end boost namespace
53 #endif // BOOST_COMPUTE_ALGORITHM_EQUAL_HPP