File indexing completed on 2025-01-18 09:29:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP
0012 #define BOOST_COMPUTE_ALGORITHM_DETAIL_SCAN_HPP
0013
0014 #include <boost/compute/device.hpp>
0015 #include <boost/compute/algorithm/detail/scan_on_cpu.hpp>
0016 #include <boost/compute/algorithm/detail/scan_on_gpu.hpp>
0017
0018 namespace boost {
0019 namespace compute {
0020 namespace detail {
0021
0022 template<class InputIterator, class OutputIterator, class T, class BinaryOperator>
0023 inline OutputIterator scan(InputIterator first,
0024 InputIterator last,
0025 OutputIterator result,
0026 bool exclusive,
0027 T init,
0028 BinaryOperator op,
0029 command_queue &queue)
0030 {
0031 const device &device = queue.get_device();
0032
0033 if(device.type() & device::cpu){
0034 return scan_on_cpu(first, last, result, exclusive, init, op, queue);
0035 }
0036 else {
0037 return scan_on_gpu(first, last, result, exclusive, init, op, queue);
0038 }
0039 }
0040
0041 }
0042 }
0043 }
0044
0045 #endif