MCPcopy Create free account
hub / github.com/ceres-solver/ceres-solver / ChangeNumThreadsIfNeeded

Function ChangeNumThreadsIfNeeded

internal/ceres/preprocessor.cc:61–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59Preprocessor::~Preprocessor() = default;
60
61void ChangeNumThreadsIfNeeded(Solver::Options* options) {
62 if (options->num_threads == 1) {
63 return;
64 }
65 const int num_threads_available = ThreadPool::MaxNumThreadsAvailable();
66 if (options->num_threads > num_threads_available) {
67 LOG(WARNING) << "Specified options.num_threads: " << options->num_threads
68 << " exceeds maximum available from the threading model Ceres "
69 << "was compiled with: " << num_threads_available
70 << ". Bounding to maximum number available.";
71 options->num_threads = num_threads_available;
72 }
73}
74
75void SetupCommonMinimizerOptions(PreprocessedProblem* pp) {
76 const Solver::Options& options = pp->options;

Callers 2

PreprocessMethod · 0.85
PreprocessMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected