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

Function dispatch_accumulate

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

Source from the content-addressed store, hash-verified

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

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