change to more efficient call of threaded functions
parent
df9cf86cb0
commit
e0cbc76456
|
@ -221,7 +221,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
#ifdef GTSAM_USE_TBB
|
||||
arena.execute([&]{
|
||||
tg.run([&]{
|
||||
tg.run_and_wait([&]{
|
||||
#endif
|
||||
// Run mode
|
||||
if(incremental)
|
||||
|
|
|
@ -89,10 +89,9 @@ map<int, double> testWithoutMemoryAllocation(int num_threads)
|
|||
|
||||
// Run parallel code (as a task group) inside of task arena
|
||||
arena.execute([&]{
|
||||
tg.run([&]{
|
||||
tg.run_and_wait([&]{
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithoutAllocation(results));
|
||||
});
|
||||
tg.wait();
|
||||
});
|
||||
|
||||
tbb::tick_count t1 = tbb::tick_count::now();
|
||||
|
@ -154,10 +153,9 @@ map<int, double> testWithMemoryAllocation(int num_threads)
|
|||
|
||||
// Run parallel code (as a task group) inside of task arena
|
||||
arena.execute([&]{
|
||||
tg.run([&]{
|
||||
tg.run_and_wait([&]{
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithAllocation(results));
|
||||
});
|
||||
tg.wait();
|
||||
});
|
||||
|
||||
tbb::tick_count t1 = tbb::tick_count::now();
|
||||
|
|
Loading…
Reference in New Issue