static typename WDP::ReductionType parallel_reduce (const int begin, const int end, WDP wd) { BlockedRangeWDPReducer<WDP> tbb_wd (wd); tbb::parallel_reduce (tbb::blocked_range<int> (begin, end), tbb_wd, tbb::auto_partitioner ()); return tbb_wd.result; }
void parallel_reduce(int length, WDP &wd) { BlockedRangeWDPReducer<WDP> tbb_wd(wd); tbb::parallel_reduce(tbb::blocked_range<int>(0,length), tbb_wd, tbb::auto_partitioner()); wd.result = tbb_wd.wd.result; // have to put result from final tbb_wd into orginal wd }
static void parallel_for (const int begin, const int end, WDP wd) { BlockedRangeWDP<WDP> tbb_wd(wd); tbb::parallel_for (tbb::blocked_range<int> (begin, end), tbb_wd, tbb::auto_partitioner ()); }
void parallel_for(int length, WDP wd) { BlockedRangeWDP<WDP> tbb_wd(wd); tbb::parallel_for(tbb::blocked_range<int>(0,length), tbb_wd, tbb::auto_partitioner()); }