diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index 7bf2caaa74..b8bca4f0fd 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -201,9 +201,9 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, unsigned best_cus = gpu->cus(0); bool type_match = (gpu->device_type(0) == type); for (int i = 1; i < gpu->num_devices(); i++) { - if (type_match && gpu->device_type(i)!=type) + if (type_match && (gpu->device_type(i) != type)) continue; - if (type_match && gpu->device_type(i) == type) { + if (!type_match && (gpu->device_type(i) == type)) { type_match = true; best_cus = gpu->cus(i); best_device = i; diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index a8e47bb9fc..1039067ac7 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -188,7 +188,7 @@ void PairGranular::compute(int eflag, int vflag) double *history,*allhistory,**firsthistory; bool touchflag = false; - const bool historyupdate = update->setupflag != 0; + const bool historyupdate = update->setupflag == 0; ev_init(eflag,vflag);