avoid redundant use of boolean literals

This commit is contained in:
Axel Kohlmeyer
2022-04-10 20:29:54 -04:00
parent 74f2b67b1a
commit d6f7570d57
22 changed files with 64 additions and 82 deletions

View File

@ -107,17 +107,17 @@ bool AtomT::alloc(const int nall) {
gpu_bytes+=x_cast.device.row_bytes()+type_cast.device.row_bytes();
#endif
if (_charge && _host_view==false) {
if (_charge && !_host_view) {
success=success && (q.alloc(_max_atoms,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=q.device.row_bytes();
}
if (_rot && _host_view==false) {
if (_rot && !_host_view) {
success=success && (quat.alloc(_max_atoms*4,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=quat.device.row_bytes();
}
if (_vel && _host_view==false) {
if (_vel && !_host_view) {
success=success && (v.alloc(_max_atoms*4,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=v.device.row_bytes();
@ -161,37 +161,37 @@ bool AtomT::add_fields(const bool charge, const bool rot,
// Ignore host/device transfers?
int gpu_bytes=0;
if (charge && _charge==false) {
if (charge && !_charge) {
_charge=true;
_other=true;
if (_host_view==false) {
if (!_host_view) {
success=success && (q.alloc(_max_atoms,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=q.device.row_bytes();
}
}
if (rot && _rot==false) {
if (rot && !_rot) {
_rot=true;
_other=true;
if (_host_view==false) {
if (!_host_view) {
success=success && (quat.alloc(_max_atoms*4,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=quat.device.row_bytes();
}
}
if (vel && _vel==false) {
if (vel && !_vel) {
_vel=true;
_other=true;
if (_host_view==false) {
if (!_host_view) {
success=success && (v.alloc(_max_atoms*4,*dev,UCL_WRITE_ONLY,
UCL_READ_ONLY)==UCL_SUCCESS);
gpu_bytes+=v.device.row_bytes();
}
}
if (bonds && _bonds==false) {
if (bonds && !_bonds) {
_bonds=true;
if (_bonds && _gpu_nbor>0) {
success=success && (dev_tag.alloc(_max_atoms,*dev,