From 8096b0e251c88b3df18eb9ec840f773376a05fec Mon Sep 17 00:00:00 2001 From: acxz <17132214+acxz@users.noreply.github.com> Date: Mon, 16 Mar 2020 00:49:17 -0400 Subject: [PATCH] add deprecated task_scheduler_init unitl alternative is found --- examples/SolverComparer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/SolverComparer.cpp b/examples/SolverComparer.cpp index 528a441b3..d9dce7181 100644 --- a/examples/SolverComparer.cpp +++ b/examples/SolverComparer.cpp @@ -57,6 +57,10 @@ #include #include +#ifdef GTSAM_USE_TBB +#include // tbb::task_scheduler_init +#endif + using namespace std; using namespace gtsam; using namespace gtsam::symbol_shorthand; @@ -200,8 +204,10 @@ int main(int argc, char *argv[]) { } #ifdef GTSAM_USE_TBB + std::unique_ptr init; if(nThreads > 0) { cout << "Using " << nThreads << " threads" << endl; + init.reset(new tbb::task_scheduler_init(nThreads)); } else cout << "Using threads for all processors" << endl; #else