From 88ccd546d84982108738ba4e66c6d0e2ea01f5fd Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Thu, 9 Feb 2023 23:55:14 -0600 Subject: [PATCH] Fixed bugs with gauss/gpu in bonded systems, including factor_lj in forces and energies --- lib/gpu/lal_gauss.cpp | 4 ++-- lib/gpu/lal_gauss.cu | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/gpu/lal_gauss.cpp b/lib/gpu/lal_gauss.cpp index 6d8f0f02aa..5a7bd24b85 100644 --- a/lib/gpu/lal_gauss.cpp +++ b/lib/gpu/lal_gauss.cpp @@ -133,13 +133,13 @@ int GaussT::loop(const int eflag, const int vflag) { this->time_pair.start(); if (shared_types) { this->k_pair_sel->set_size(GX,BX); - this->k_pair_sel->run(&this->atom->x, &gauss1, + this->k_pair_sel->run(&this->atom->x, &gauss1, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); } else { this->k_pair.set_size(GX,BX); - this->k_pair.run(&this->atom->x, &gauss1, &_lj_types, + this->k_pair.run(&this->atom->x, &gauss1, &_lj_types, &sp_lj, &this->nbor->dev_nbor, &this->_nbor_data->begin(), &this->ans->force, &this->ans->engv, &eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom); diff --git a/lib/gpu/lal_gauss.cu b/lib/gpu/lal_gauss.cu index 2540b8492f..cb6b72db30 100644 --- a/lib/gpu/lal_gauss.cu +++ b/lib/gpu/lal_gauss.cu @@ -27,6 +27,7 @@ _texture_2d( pos_tex,int4); __kernel void k_gauss(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict gauss1, const int lj_types, + const __global numtyp *restrict sp_lj, const __global int *dev_nbor, const __global int *dev_packed, __global acctyp4 *restrict ans, @@ -56,9 +57,11 @@ __kernel void k_gauss(const __global numtyp4 *restrict x_, numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i]; int itype=ix.w; + numtyp factor_lj; for ( ; nbor