Deprecated tbb::task_scheduler_init replaced with std::thread and tbb::global_control
This commit is contained in:
@@ -10,12 +10,11 @@
|
||||
#include <boost/program_options.hpp>
|
||||
#include <boost/program_options/errors.hpp>
|
||||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <new>
|
||||
#include <ostream>
|
||||
#include <thread>
|
||||
|
||||
#include "util/meminfo.hpp"
|
||||
|
||||
@@ -45,7 +44,7 @@ return_code parseArguments(int argc,
|
||||
config_options.add_options()(
|
||||
"threads,t",
|
||||
boost::program_options::value<unsigned int>(&contractor_config.requested_num_threads)
|
||||
->default_value(tbb::task_scheduler_init::default_num_threads()),
|
||||
->default_value(std::thread::hardware_concurrency()),
|
||||
"Number of threads to use")(
|
||||
"core,k",
|
||||
boost::program_options::value<double>(&contractor_config.core_factor)->default_value(1.0),
|
||||
@@ -171,7 +170,7 @@ int main(int argc, char *argv[]) try
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const unsigned recommended_num_threads = tbb::task_scheduler_init::default_num_threads();
|
||||
const unsigned recommended_num_threads = std::thread::hardware_concurrency();
|
||||
|
||||
if (recommended_num_threads != contractor_config.requested_num_threads)
|
||||
{
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
#include "util/meminfo.hpp"
|
||||
#include "util/version.hpp"
|
||||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
@@ -39,7 +38,7 @@ return_code parseArguments(int argc,
|
||||
//
|
||||
("threads,t",
|
||||
boost::program_options::value<unsigned int>(&customization_config.requested_num_threads)
|
||||
->default_value(tbb::task_scheduler_init::default_num_threads()),
|
||||
->default_value(std::thread::hardware_concurrency()),
|
||||
"Number of threads to use")(
|
||||
"segment-speed-file",
|
||||
boost::program_options::value<std::vector<std::string>>(
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
#include "util/log.hpp"
|
||||
#include "util/version.hpp"
|
||||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <new>
|
||||
#include <thread>
|
||||
|
||||
#include "util/meminfo.hpp"
|
||||
|
||||
@@ -49,7 +48,7 @@ return_code parseArguments(int argc,
|
||||
"Data version. Leave blank to avoid. osmosis - to get timestamp from file")(
|
||||
"threads,t",
|
||||
boost::program_options::value<unsigned int>(&extractor_config.requested_num_threads)
|
||||
->default_value(tbb::task_scheduler_init::default_num_threads()),
|
||||
->default_value(std::thread::hardware_concurrency()),
|
||||
"Number of threads to use")(
|
||||
"small-component-size",
|
||||
boost::program_options::value<unsigned int>(&extractor_config.small_component_size)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "util/timing_util.hpp"
|
||||
#include "util/version.hpp"
|
||||
|
||||
#include <tbb/task_scheduler_init.h>
|
||||
|
||||
#include <boost/algorithm/string/join.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
@@ -17,6 +15,7 @@
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <regex>
|
||||
#include <thread>
|
||||
|
||||
using namespace osrm;
|
||||
|
||||
@@ -86,7 +85,7 @@ return_code parseArguments(int argc,
|
||||
//
|
||||
("threads,t",
|
||||
boost::program_options::value<unsigned int>(&config.requested_num_threads)
|
||||
->default_value(tbb::task_scheduler_init::default_num_threads()),
|
||||
->default_value(std::thread::hardware_concurrency()),
|
||||
"Number of threads to use")
|
||||
//
|
||||
("balance",
|
||||
|
||||
Reference in New Issue
Block a user