small tweaks from static code analysis

This commit is contained in:
Axel Kohlmeyer
2021-09-15 19:50:52 -04:00
parent fef8f51d80
commit 7196a295a6
3 changed files with 11 additions and 9 deletions

View File

@ -54,7 +54,7 @@ int PPPMT::bytes_per_atom() const {
}
template <class numtyp, class acctyp, class grdtyp, class grdtyp4>
grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen,
grdtyp *PPPMT::init(const int nlocal, const int nall, FILE *_screen,
const int order, const int nxlo_out,
const int nylo_out, const int nzlo_out,
const int nxhi_out, const int nyhi_out,
@ -69,14 +69,14 @@ grdtyp * PPPMT::init(const int nlocal, const int nall, FILE *_screen,
flag=device->init(*ans,nlocal,nall);
if (flag!=0)
return 0;
return nullptr;
if (sizeof(grdtyp)==sizeof(double) && device->double_precision()==false) {
flag=-15;
return 0;
return nullptr;
}
if (device->ptx_arch()>0.0 && device->ptx_arch()<1.1) {
flag=-4;
return 0;
return nullptr;
}
ucl_device=device->gpu;