diff --git a/internal/ceres/solver.cc b/internal/ceres/solver.cc index 0e0790e87..e947e069c 100644 --- a/internal/ceres/solver.cc +++ b/internal/ceres/solver.cc @@ -724,12 +724,14 @@ void Solver::Solve(const Solver::Options& options, Program* program = problem_impl->mutable_program(); PreSolveSummarize(options, problem_impl, summary); +#ifndef CERES_NO_CUDA if (IsCudaRequired(options)) { if (!problem_impl->context()->InitCUDA(&summary->message)) { LOG(ERROR) << "Terminating: " << summary->message; return; } } +#endif // CERES_NO_CUDA // If gradient_checking is enabled, wrap all cost functions in a // gradient checker and install a callback that terminates if any gradient