Insert missing CUDA guards.

Change-Id: If97c51557376385e3958863072cfcf76dd810d15
This commit is contained in:
Joydeep Biswas
2022-08-15 23:55:33 -05:00
parent 829089053e
commit 3b891f7672
+2
View File
@@ -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