MCPcopy Create free account
hub / github.com/boostorg/compute / dispatch_accumulate

Function dispatch_accumulate

include/boost/compute/algorithm/accumulate.hpp:100–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99template<class InputIterator, class T, class BinaryFunction>
100inline T dispatch_accumulate(InputIterator first,
101 InputIterator last,
102 T init,
103 BinaryFunction function,
104 command_queue &queue)
105{
106 size_t size = iterator_range_size(first, last);
107 if(size == 0){
108 return init;
109 }
110
111 if(can_accumulate_with_reduce(init, function)){
112 T result;
113 reduce(first, last, &result, function, queue);
114 return result;
115 }
116 else {
117 return generic_accumulate(first, last, init, function, queue);
118 }
119}
120
121} // end detail namespace
122

Callers 1

accumulateFunction · 0.85

Calls 4

iterator_range_sizeFunction · 0.85
reduceFunction · 0.85
generic_accumulateFunction · 0.85

Tested by

no test coverage detected