MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / parallel_invoke_impl

Function parallel_invoke_impl

benchmarks/tbb/parallel_invoke.h:212–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 // task_group_context is known to be at the back of the parameter pack
211 template<typename F0, typename F1, typename... F>
212 void parallel_invoke_impl(true_type, F0&& f0, F1&& f1, F&&... f) {
213 __TBB_STATIC_ASSERT(sizeof...(F)>0, "Variadic parallel_invoke implementation broken?");
214 // # of child tasks: f0, f1, and a task for each two elements of the pack except the last
215 const size_t number_of_children = 2 + sizeof...(F)/2;
216 parallel_invoke_cleaner cleaner(number_of_children, get_context(std::forward<F>(f)...));
217 parallel_invoke_helper& root = cleaner.root;
218
219 root.add_children(std::forward<F>(f)...);
220 root.add_children(std::forward<F1>(f1));
221 root.run_and_finish(std::forward<F0>(f0));
222 }
223
224 // task_group_context is not in the pack, needs to be added
225 template<typename F0, typename F1, typename... F>

Callers 1

parallel_invokeFunction · 0.85

Calls 2

add_childrenMethod · 0.80
run_and_finishMethod · 0.80

Tested by

no test coverage detected