Ah yes, sorry for the confusion - I meant two if's nested together, so
effectively it is

if (param_.solver_mode() && param_.has_device_id())

thanks for the changes :)

Yangqing


On Mon, Feb 3, 2014 at 1:12 PM, Sergio Guadarrama
<notifications@github.com>wrote:

> In src/caffe/solver.cpp:
>
> > @@ -40,6 +40,9 @@
> >  template <typename Dtype>
> >  void Solver<Dtype>::Solve(const char* resume_file) {
> >    Caffe::set_mode(Caffe::Brew(param_.solver_mode()));
> > +  if (param_.solver_mode()) {
> > +    Caffe::SetDevice(param_.device_id());
>
> The idea behind the condition was to set device_id only if solver_mode was
> set to 1 or GPU mode. In CPU mode we don't want to try SetDevice since it
> can fail if there is not GPU device.
> But we could check both conditions
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/BVLC/caffe/pull/69/files#r9399603>
> .
>