5 TThreadExecutor::TThreadExecutor():fInitTBB(new tbb::task_scheduler_init()){
8 TThreadExecutor::TThreadExecutor(
size_t nThreads):fInitTBB(new tbb::task_scheduler_init(nThreads)){
11 TThreadExecutor::~TThreadExecutor() {
12 fInitTBB->terminate();
15 void TThreadExecutor::ParallelFor(
unsigned int start,
unsigned int end,
const std::function<
void(
unsigned int i)> &
f){
16 tbb::parallel_for(start, end,
f);
19 double TThreadExecutor::ParallelReduce(
const std::vector<double> &objs,
const std::function<
double(
double a,
double b)> &redfunc){
20 return tbb::parallel_reduce(tbb::blocked_range<decltype(objs.begin())>(objs.begin(), objs.end()),
double{},
21 [redfunc](tbb::blocked_range<decltype(objs.begin())>
const & range,
double init) {
22 return std::accumulate(range.begin(), range.end(),
init, redfunc);
26 float TThreadExecutor::ParallelReduce(
const std::vector<float> &objs,
const std::function<
float(
float a,
float b)> &redfunc){
27 return tbb::parallel_reduce(tbb::blocked_range<decltype(objs.begin())>(objs.begin(), objs.end()),
float{},
28 [redfunc](tbb::blocked_range<decltype(objs.begin())>
const & range,
float init) {
29 return std::accumulate(range.begin(), range.end(),
init, redfunc);
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b