more clang-tidy fixes after re-running it with added settings

This commit is contained in:
Axel Kohlmeyer
2022-05-14 06:15:41 -04:00
parent 2f0baa86d6
commit d4ea5ca49e
66 changed files with 117 additions and 229 deletions

View File

@ -81,7 +81,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
gpu=new UCL_Device();
// ---------------------- OpenCL Compiler Args -------------------------
std::string extra_args="";
std::string extra_args;
if (ocl_args) extra_args+=":"+std::string(ocl_args);
#ifdef LAL_OCL_EXTRA_ARGS
extra_args+=":" LAL_PRE_STRINGIFY(LAL_OCL_EXTRA_ARGS);
@ -144,7 +144,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
// Setup OpenCL platform and parameters based on platform
// and device type specifications
std::string ocl_vstring="";
std::string ocl_vstring;
if (device_type_flags != nullptr) ocl_vstring=device_type_flags;
// Setup the OpenCL platform
@ -161,7 +161,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
if (_platform_id>=0)
pres=gpu->set_platform(_platform_id);
else {
std::string vendor="";
std::string vendor;
if (device_type_flags!=nullptr) {
if (ocl_vstring=="intelgpu")
vendor="intel";
@ -578,7 +578,7 @@ template <class numtyp, class acctyp>
void DeviceT::init_message(FILE *screen, const char *name,
const int first_gpu, const int last_gpu) {
#if defined(USE_OPENCL)
std::string fs="";
std::string fs;
#elif defined(USE_CUDART)
std::string fs="";
#else

View File

@ -64,10 +64,7 @@ bool Neighbor::init(NeighborShared *shared, const int inum,
// Not yet implemented
assert(0==1);
if (pre_cut || gpu_nbor==0)
_alloc_packed=true;
else
_alloc_packed=false;
_alloc_packed = pre_cut || gpu_nbor==0;
if (pre_cut)
_packed_permissions=UCL_READ_WRITE;

View File

@ -70,7 +70,7 @@ grdtyp *PPPMT::init(const int nlocal, const int nall, FILE *_screen,
flag=device->init(*ans,nlocal,nall);
if (flag!=0)
return nullptr;
if (sizeof(grdtyp)==sizeof(double) && device->double_precision()==false) {
if (sizeof(grdtyp)==sizeof(double) && !device->double_precision()) {
flag=-15;
return nullptr;
}
@ -374,7 +374,7 @@ void PPPMT::compile_kernels(UCL_Device &dev) {
if (_compiled)
return;
if (sizeof(grdtyp)==sizeof(double) && ucl_device->double_precision()==false)
if (sizeof(grdtyp)==sizeof(double) && !ucl_device->double_precision())
return;
std::string flags=device->compile_string();

View File

@ -56,10 +56,7 @@ int YukawaColloidT::init(const int ntypes,
if (success!=0)
return success;
if (this->ucl_device->shared_memory() && sizeof(numtyp)==sizeof(double))
_shared_view=true;
else
_shared_view=false;
_shared_view = this->ucl_device->shared_memory() && sizeof(numtyp)==sizeof(double);
// allocate rad