silence compiler warnings

This commit is contained in:
Axel Kohlmeyer
2022-11-01 03:38:08 -04:00
parent 658220c69d
commit 80a141d9c8
13 changed files with 16 additions and 22 deletions

View File

@ -76,7 +76,7 @@ class UCL_Const {
/// Copy from array on host to const memory
template <class numtyp>
inline void update_device(UCL_H_Vec<numtyp> &src, const int numel) {
const int bytes=numel*sizeof(numtyp);
const size_t bytes=numel*sizeof(numtyp);
if (_global_bytes < bytes) {
if (_global_bytes) CL_SAFE_CALL(clReleaseMemObject(_global));
cl_int e;

View File

@ -375,7 +375,7 @@ class UCL_D_Vec : public UCL_BaseMat {
/// Resize (only if bigger) the allocation to contain cols elements
/** \note Cannot be used on views **/
inline int resize_ib(const int cols)
{ if (cols>_cols) return resize(cols); else return UCL_SUCCESS; }
{ if (cols > (int)_cols) return resize(cols); else return UCL_SUCCESS; }
/// Set each element to zero asynchronously in the default command_queue
inline void zero() { zero(_cq); }

View File

@ -340,8 +340,7 @@ void BaseAtomicT::compile_kernels(UCL_Device &dev, const void *pair_str,
#if defined(LAL_OCL_EV_JIT)
mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -359,8 +359,7 @@ void BaseChargeT::compile_kernels(UCL_Device &dev, const void *pair_str,
#if defined(LAL_OCL_EV_JIT)
mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -361,8 +361,7 @@ void BaseDipoleT::compile_kernels(UCL_Device &dev, const void *pair_str,
#if defined(LAL_OCL_EV_JIT)
mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -361,8 +361,7 @@ void BaseDPDT::compile_kernels(UCL_Device &dev, const void *pair_str,
#if defined(LAL_OCL_EV_JIT)
mx_subgroup_sz = std::min(mx_subgroup_sz, k_pair_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -569,8 +569,7 @@ void BaseEllipsoidT::compile_kernels(UCL_Device &dev,
if (e_s)
mx_subgroup_sz = std::min(mx_subgroup_sz, k_ellipsoid_sphere_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -471,8 +471,7 @@ void BaseThreeT::compile_kernels(UCL_Device &dev, const void *pair_str,
mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_center_noev.max_subgroup_size(_block_size));
mx_subgroup_sz = std::min(mx_subgroup_sz, k_three_end_noev.max_subgroup_size(_block_size));
#endif
if (_threads_per_atom > mx_subgroup_sz)
_threads_per_atom = mx_subgroup_sz;
if (_threads_per_atom > (int)mx_subgroup_sz) _threads_per_atom = mx_subgroup_sz;
device->set_simd_size(mx_subgroup_sz);
}
#endif

View File

@ -86,7 +86,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
#ifdef LAL_OCL_EXTRA_ARGS
extra_args+=":" LAL_PRE_STRINGIFY(LAL_OCL_EXTRA_ARGS);
#endif
for (int i=0; i<extra_args.length(); i++)
for (int i=0; i < (int)extra_args.length(); i++)
if (extra_args[i]==':') extra_args[i]=' ';
// --------------------------- MPI setup -------------------------------
@ -301,7 +301,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu,
#ifdef USE_OPENCL
if (device_type_flags==nullptr) {
std::string pname = gpu->platform_name();
for (int i=0; i<pname.length(); i++)
for (int i=0; i < (int)pname.length(); i++)
if (pname[i]<='z' && pname[i]>='a')
pname[i]=toupper(pname[i]);
if (pname.find("NVIDIA")!=std::string::npos)

View File

@ -632,7 +632,7 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum,
subgroup_count += cell_subgroup_counts[i];
cell_subgroup_counts[i] += cell_subgroup_counts[i-1];
}
if (subgroup_count > subgroup2cell.numel()) {
if (subgroup_count > (int)subgroup2cell.numel()) {
subgroup2cell.clear();
success = success && (subgroup2cell.alloc(1.1*subgroup_count,*dev,
UCL_READ_WRITE,UCL_READ_ONLY) == UCL_SUCCESS);
@ -702,7 +702,7 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum,
_old_ncellz = ncellz;
const int bin_stencil_stride = cells_in_cutoff * 2 + 1;
const int bin_stencil_size = bin_stencil_stride * bin_stencil_stride;
if (bin_stencil_size > _host_bin_stencil.numel())
if (bin_stencil_size > (int)_host_bin_stencil.numel())
_host_bin_stencil.alloc(bin_stencil_size,*dev);
for (int s = 0; s<bin_stencil_size; s++) {
const int nbory = s % bin_stencil_stride - cells_in_cutoff;

View File

@ -260,7 +260,7 @@ int TersoffT::loop(const int eflag, const int vflag, const int evatom,
// re-allocate zetaij if necessary
int nall = this->_nall;
if (nall*this->nbor->max_nbors() > _zetaij.cols()) {
if (nall*this->nbor->max_nbors() > (int)_zetaij.cols()) {
int _nmax=static_cast<int>(static_cast<double>(nall)*1.10);
_zetaij.clear();
_zetaij_eng.clear();

View File

@ -252,7 +252,7 @@ int TersoffMT::loop(const int eflag, const int vflag, const int evatom,
// re-allocate zetaij if necessary
int nall = this->_nall;
if (nall*this->nbor->max_nbors() > _zetaij.cols()) {
if (nall*this->nbor->max_nbors() > (int)_zetaij.cols()) {
int _nmax=static_cast<int>(static_cast<double>(nall)*1.10);
_zetaij.clear();
success = success && (_zetaij.alloc(this->nbor->max_nbors()*_nmax,

View File

@ -276,7 +276,7 @@ int TersoffZT::loop(const int eflag, const int vflag, const int evatom,
// re-allocate zetaij if necessary
int nall = this->_nall;
if (nall*this->nbor->max_nbors() > _zetaij.cols()) {
if (nall*this->nbor->max_nbors() > (int)_zetaij.cols()) {
int _nmax=static_cast<int>(static_cast<double>(nall)*1.10);
_zetaij.clear();
success = success && (_zetaij.alloc(this->nbor->max_nbors()*_nmax,