Updating CHARMM test kernel.

This commit is contained in:
W. Michael Brown
2011-04-12 20:04:38 -04:00
parent 0efcb241bb
commit e7fc403e3c
6 changed files with 113 additions and 40 deletions

View File

@ -127,8 +127,6 @@ double CRML_GPU_Memory2T::host_memory_usage() const {
// ---------------------------------------------------------------------------
template <class numtyp, class acctyp>
void CRML_GPU_Memory2T::loop(const bool _eflag, const bool _vflag) {
const int threads_per_atom=16;
// Compute the block size and grid size to keep all cores busy
const int BX=this->block_size();
int eflag, vflag;
@ -143,7 +141,7 @@ void CRML_GPU_Memory2T::loop(const bool _eflag, const bool _vflag) {
vflag=0;
int GX=static_cast<int>(ceil(static_cast<double>(this->ans->inum())/
(BX/threads_per_atom)));
(BX/this->_threads_per_atom)));
int ainum=this->ans->inum();
int anall=this->atom->nall();
@ -153,22 +151,24 @@ void CRML_GPU_Memory2T::loop(const bool _eflag, const bool _vflag) {
this->k_pair_fast.set_size(GX,BX);
this->k_pair_fast.run(&this->atom->dev_x.begin(), &ljd.begin(),
&sp_lj.begin(), &this->nbor->dev_nbor.begin(),
&this->nbor->dev_packed.begin(),
&this->_nbor_data->begin(),
&this->ans->dev_ans.begin(),
&this->ans->dev_engv.begin(), &eflag, &vflag,
&ainum, &anall, &nbor_pitch,
&this->atom->dev_q.begin(), &_cut_coulsq,
&_qqrd2e, &_g_ewald, &_denom_lj, &_cut_bothsq,
&_cut_ljsq, &_cut_lj_innersq,&threads_per_atom);
&_cut_ljsq, &_cut_lj_innersq,
&this->_threads_per_atom);
} else {
this->k_pair.set_size(GX,BX);
this->k_pair.run(&this->atom->dev_x.begin(), &lj1.begin(),
&_lj_types, &sp_lj.begin(), &this->nbor->dev_nbor.begin(),
&this->ans->dev_ans.begin(),
&this->_nbor_data->begin(), &this->ans->dev_ans.begin(),
&this->ans->dev_engv.begin(), &eflag, &vflag, &ainum,
&anall, &nbor_pitch, &this->atom->dev_q.begin(),
&_cut_coulsq, &_qqrd2e, &_g_ewald, &_denom_lj,
&_cut_bothsq, &_cut_ljsq, &_cut_lj_innersq);
&_cut_bothsq, &_cut_ljsq, &_cut_lj_innersq,
&this->_threads_per_atom);
}
this->time_pair.stop();
}