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