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
|
#ifdef GTSAM_USE_TBB
|
||||||
arena.execute([&]{
|
arena.execute([&]{
|
||||||
tg.run([&]{
|
tg.run_and_wait([&]{
|
||||||
#endif
|
#endif
|
||||||
// Run mode
|
// Run mode
|
||||||
if(incremental)
|
if(incremental)
|
||||||
|
|
|
@ -89,10 +89,9 @@ map<int, double> testWithoutMemoryAllocation(int num_threads)
|
||||||
|
|
||||||
// Run parallel code (as a task group) inside of task arena
|
// Run parallel code (as a task group) inside of task arena
|
||||||
arena.execute([&]{
|
arena.execute([&]{
|
||||||
tg.run([&]{
|
tg.run_and_wait([&]{
|
||||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithoutAllocation(results));
|
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithoutAllocation(results));
|
||||||
});
|
});
|
||||||
tg.wait();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tbb::tick_count t1 = tbb::tick_count::now();
|
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
|
// Run parallel code (as a task group) inside of task arena
|
||||||
arena.execute([&]{
|
arena.execute([&]{
|
||||||
tg.run([&]{
|
tg.run_and_wait([&]{
|
||||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithAllocation(results));
|
tbb::parallel_for(tbb::blocked_range<size_t>(0, numberOfProblems), WorkerWithAllocation(results));
|
||||||
});
|
});
|
||||||
tg.wait();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tbb::tick_count t1 = tbb::tick_count::now();
|
tbb::tick_count t1 = tbb::tick_count::now();
|
||||||
|
|
Loading…
Reference in New Issue