From 537e3f25397fd8ec93cca4c4316f7d3bba3fee7a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 17 Feb 2022 17:03:05 -0500 Subject: [PATCH] silence compiler warnings --- lib/gpu/geryon/ocl_device.h | 6 +++--- lib/gpu/geryon/ocl_memory.h | 4 ++-- lib/gpu/lal_answer.cpp | 2 -- lib/gpu/lal_base_atomic.cpp | 2 +- lib/gpu/lal_base_ellipsoid.cpp | 3 +-- lib/gpu/lal_base_three.cpp | 2 +- lib/gpu/lal_neighbor.cpp | 10 +++++----- lib/gpu/lal_tersoff_mod.cpp | 1 - lib/gpu/lal_tersoff_zbl.cpp | 1 - src/INTERLAYER/pair_ilp_tmd.cpp | 4 ++-- src/QEQ/fix_qeq.cpp | 1 - 11 files changed, 15 insertions(+), 21 deletions(-) diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index 2cb06999d9..092b4ad11b 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -406,7 +406,7 @@ void UCL_Device::clear() { #ifdef GERYON_NUMA_FISSION #ifdef CL_VERSION_1_2 - for (int i=0; i<_cl_devices.size(); i++) + for (size_t i=0; i< _cl_devices.size(); i++) CL_DESTRUCT_CALL(clReleaseDevice(_cl_devices[i])); #endif #endif @@ -841,7 +841,7 @@ int UCL_Device::auto_set_platform(const enum UCL_DEVICE_TYPE type, int best_platform=0; std::string vendor_upper=vendor; - for (int i=0; i='a') vendor_upper[i]=toupper(vendor_upper[i]); @@ -859,7 +859,7 @@ int UCL_Device::auto_set_platform(const enum UCL_DEVICE_TYPE type, if (vendor_upper!="") { std::string pname = platform_name(); - for (int i=0; i='a') pname[i]=toupper(pname[i]); diff --git a/lib/gpu/geryon/ocl_memory.h b/lib/gpu/geryon/ocl_memory.h index 8937d4145a..adf7b6c952 100644 --- a/lib/gpu/geryon/ocl_memory.h +++ b/lib/gpu/geryon/ocl_memory.h @@ -256,7 +256,7 @@ template inline int _device_alloc(mat_type &mat, UCL_Device &dev, const size_t n, const enum UCL_MEMOPT kind) { cl_int error_flag; - cl_mem_flags flag; + cl_mem_flags flag = CL_MEM_READ_WRITE; if (kind==UCL_READ_WRITE) flag=CL_MEM_READ_WRITE; else if (kind==UCL_READ_ONLY) @@ -321,7 +321,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); - cl_mem_flags flag; + cl_mem_flags flag = CL_MEM_READ_WRITE; if (mat.kind()==UCL_READ_WRITE) flag=CL_MEM_READ_WRITE; else if (mat.kind()==UCL_READ_ONLY) diff --git a/lib/gpu/lal_answer.cpp b/lib/gpu/lal_answer.cpp index 28be78a604..e3d4e71b15 100644 --- a/lib/gpu/lal_answer.cpp +++ b/lib/gpu/lal_answer.cpp @@ -319,7 +319,6 @@ void AnswerT::get_answers(double **f, double **tor) { const int ifrom = tid * idelta; const int ito = std::min(ifrom + idelta, _inum); #else - const int tid = 0; const int ifrom = 0; const int ito = _inum; #endif @@ -352,7 +351,6 @@ void AnswerT::get_answers(double **f, double **tor) { const int ito = std::min(ifrom + idelta, _inum); int fl=ifrom*4; #else - const int tid = 0; const int ifrom = 0; const int ito = _inum; int fl=0; diff --git a/lib/gpu/lal_base_atomic.cpp b/lib/gpu/lal_base_atomic.cpp index a8900a9c60..b668399a48 100644 --- a/lib/gpu/lal_base_atomic.cpp +++ b/lib/gpu/lal_base_atomic.cpp @@ -21,7 +21,7 @@ namespace LAMMPS_AL { extern Device global_device; template -BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0), _onetype(0) { +BaseAtomicT::BaseAtomic() : _compiled(false), _onetype(0), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); diff --git a/lib/gpu/lal_base_ellipsoid.cpp b/lib/gpu/lal_base_ellipsoid.cpp index bb6b11799b..ca7dc645bc 100644 --- a/lib/gpu/lal_base_ellipsoid.cpp +++ b/lib/gpu/lal_base_ellipsoid.cpp @@ -29,8 +29,7 @@ const char *ellipsoid_nbor=0; extern Device global_device; template -BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0), - host_olist_size(0) { +BaseEllipsoidT::BaseEllipsoid() : host_olist_size(0), _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); diff --git a/lib/gpu/lal_base_three.cpp b/lib/gpu/lal_base_three.cpp index 15ef20230d..8ba6147582 100644 --- a/lib/gpu/lal_base_three.cpp +++ b/lib/gpu/lal_base_three.cpp @@ -20,7 +20,7 @@ namespace LAMMPS_AL { extern Device global_device; template -BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0), _onetype(-1) { +BaseThreeT::BaseThree() : _compiled(false), _onetype(-1), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 36bf4765e2..4060b13491 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -707,11 +707,11 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, const int bin_stencil_size = bin_stencil_stride * bin_stencil_stride; if (bin_stencil_size > _host_bin_stencil.numel()) _host_bin_stencil.alloc(bin_stencil_size,*dev); - for (int s = 0; s