add deprecated task_scheduler_init unitl alternative is found

release/4.3a0
acxz 2020-03-16 00:49:17 -04:00
parent bfc32e9f69
commit 8096b0e251
1 changed files with 6 additions and 0 deletions

View File

@ -57,6 +57,10 @@
#include <fstream>
#include <iostream>
#ifdef GTSAM_USE_TBB
#include <tbb/task_scheduler_init.h> // 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<tbb::task_scheduler_init> 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