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_DETAIL_SCAN_HPP
12 #define BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP
14 #include <boost/compute/device.hpp>
15 #include <boost/compute/algorithm/detail/scan_on_cpu.hpp>
16 #include <boost/compute/algorithm/detail/scan_on_gpu.hpp>
22 template<class InputIterator, class OutputIterator, class T, class BinaryOperator>
23 inline OutputIterator scan(InputIterator first,
25 OutputIterator result,
31 const device &device = queue.get_device();
33 if(device.type() & device::cpu){
34 return scan_on_cpu(first, last, result, exclusive, init, op, queue);
37 return scan_on_gpu(first, last, result, exclusive, init, op, queue);
41 } // end detail namespace
42 } // end compute namespace
43 } // end boost namespace
45 #endif // BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP