Feb2021 GPU Package Update - GPU Package Files

This commit is contained in:
Michael Brown
2021-02-15 08:20:50 -08:00
parent 16004e8f45
commit e7e2d2323b
345 changed files with 13424 additions and 7708 deletions

View File

@ -133,10 +133,25 @@ double YukawaColloidT::host_memory_usage() const {
template <class numtyp, class acctyp>
void YukawaColloidT::compute(const int f_ago, const int inum_full,
const int nall, double **host_x, int *host_type, int *ilist,
int *numj, int **firstneigh, const bool eflag, const bool vflag,
const bool eatom, const bool vatom, int &host_start,
const double cpu_time, bool &success, double *rad) {
int *numj, int **firstneigh, const bool eflag_in,
const bool vflag_in, const bool eatom, const bool vatom,
int &host_start, const double cpu_time, bool &success,
double *rad) {
this->acc_timers();
int eflag, vflag;
if (eatom) eflag=2;
else if (eflag_in) eflag=1;
else eflag=0;
if (vatom) vflag=2;
else if (vflag_in) vflag=1;
else vflag=0;
#ifdef LAL_NO_BLOCK_REDUCE
if (eflag) eflag=2;
if (vflag) vflag=2;
#endif
this->set_kernel(eflag,vflag);
// ------------------- Resize rad array --------------------------
@ -177,8 +192,8 @@ void YukawaColloidT::compute(const int f_ago, const int inum_full,
this->atom->add_x_data(host_x,host_type);
this->add_rad_data();
this->loop(eflag,vflag);
this->ans->copy_answers(eflag,vflag,eatom,vatom,ilist);
const int red_blocks=this->loop(eflag,vflag);
this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,ilist,red_blocks);
this->device->add_ans_object(this->ans);
this->hd_balancer.stop_timer();
}
@ -187,14 +202,28 @@ void YukawaColloidT::compute(const int f_ago, const int inum_full,
// Reneighbor on GPU and then compute per-atom densities
// ---------------------------------------------------------------------------
template <class numtyp, class acctyp>
int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall,
double **host_x, int *host_type, double *sublo,
int** YukawaColloidT::compute(const int ago, const int inum_full,
const int nall, double **host_x, int *host_type, double *sublo,
double *subhi, tagint *tag, int **nspecial,
tagint **special, const bool eflag, const bool vflag,
tagint **special, const bool eflag_in, const bool vflag_in,
const bool eatom, const bool vatom, int &host_start,
int **ilist, int **jnum, const double cpu_time, bool &success,
double *rad) {
this->acc_timers();
int eflag, vflag;
if (eatom) eflag=2;
else if (eflag_in) eflag=1;
else eflag=0;
if (vatom) vflag=2;
else if (vflag_in) vflag=1;
else vflag=0;
#ifdef LAL_NO_BLOCK_REDUCE
if (eflag) eflag=2;
if (vflag) vflag=2;
#endif
this->set_kernel(eflag,vflag);
// ------------------- Resize rad array ----------------------------
@ -240,8 +269,8 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall
*ilist=this->nbor->host_ilist.begin();
*jnum=this->nbor->host_acc.begin();
this->loop(eflag,vflag);
this->ans->copy_answers(eflag,vflag,eatom,vatom);
const int red_blocks=this->loop(eflag,vflag);
this->ans->copy_answers(eflag_in,vflag_in,eatom,vatom,red_blocks);
this->device->add_ans_object(this->ans);
this->hd_balancer.stop_timer();
@ -252,20 +281,9 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall
// Calculate per-atom energies and forces
// ---------------------------------------------------------------------------
template <class numtyp, class acctyp>
void YukawaColloidT::loop(const bool _eflag, const bool _vflag) {
int YukawaColloidT::loop(const int eflag, const int vflag) {
// Compute the block size and grid size to keep all cores busy
const int BX=this->block_size();
int eflag, vflag;
if (_eflag)
eflag=1;
else
eflag=0;
if (_vflag)
vflag=1;
else
vflag=0;
int GX=static_cast<int>(ceil(static_cast<double>(this->ans->inum())/
(BX/this->_threads_per_atom)));
@ -273,8 +291,8 @@ void YukawaColloidT::loop(const bool _eflag, const bool _vflag) {
int nbor_pitch=this->nbor->nbor_pitch();
this->time_pair.start();
if (shared_types) {
this->k_pair_fast.set_size(GX,BX);
this->k_pair_fast.run(&this->atom->x, &c_rad, &coeff, &sp_lj,
this->k_pair_sel->set_size(GX,BX);
this->k_pair_sel->run(&this->atom->x, &c_rad, &coeff, &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, &_kappa);
@ -286,6 +304,7 @@ void YukawaColloidT::loop(const bool _eflag, const bool _vflag) {
&ainum, &nbor_pitch, &this->_threads_per_atom, &_kappa);
}
this->time_pair.stop();
return GX;
}
template class YukawaColloid<PRECISION,ACC_PRECISION>;