git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15248 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
|
||||
__________________________________________________________________________
|
||||
|
||||
begin :
|
||||
begin :
|
||||
email : nguyentd@ornl.gov
|
||||
***************************************************************************/
|
||||
|
||||
@ -33,10 +33,10 @@ BornT::Born() : BaseAtomic<numtyp,acctyp>(), _allocated(false) {
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
BornT::~Born() {
|
||||
BornT::~Born() {
|
||||
clear();
|
||||
}
|
||||
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
int BornT::bytes_per_atom(const int max_nbors) const {
|
||||
return this->bytes_per_atom_atomic(max_nbors);
|
||||
@ -44,12 +44,12 @@ int BornT::bytes_per_atom(const int max_nbors) const {
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
int BornT::init(const int ntypes, double **host_cutsq,
|
||||
double **host_rhoinv, double **host_born1, double **host_born2,
|
||||
double **host_rhoinv, double **host_born1, double **host_born2,
|
||||
double **host_born3, double **host_a, double **host_c,
|
||||
double **host_d, double **host_sigma,
|
||||
double **host_offset, double *host_special_lj,
|
||||
const int nlocal, const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size,
|
||||
const int nlocal, const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size,
|
||||
const double gpu_split, FILE *_screen) {
|
||||
int success;
|
||||
success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split,
|
||||
@ -80,7 +80,7 @@ int BornT::init(const int ntypes, double **host_cutsq,
|
||||
|
||||
coeff2.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
|
||||
this->atom->type_pack4(ntypes,lj_types,coeff2,host_write,host_a,host_c,
|
||||
host_d,host_offset);
|
||||
host_d,host_offset);
|
||||
|
||||
cutsq_sigma.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
|
||||
this->atom->type_pack2(ntypes,lj_types,cutsq_sigma,host_write,host_cutsq,
|
||||
@ -102,18 +102,18 @@ void BornT::reinit(const int ntypes, double **host_rhoinv,
|
||||
double **host_born1, double **host_born2,
|
||||
double **host_born3, double **host_a, double **host_c,
|
||||
double **host_d, double **host_offset) {
|
||||
|
||||
|
||||
// Allocate a host write buffer for data initialization
|
||||
UCL_H_Vec<numtyp> host_write(_lj_types*_lj_types*32,*(this->ucl_device),
|
||||
UCL_WRITE_ONLY);
|
||||
|
||||
|
||||
for (int i=0; i<_lj_types*_lj_types; i++)
|
||||
host_write[i]=0.0;
|
||||
|
||||
|
||||
this->atom->type_pack4(ntypes,_lj_types,coeff1,host_write,host_rhoinv,
|
||||
host_born1,host_born2,host_born3);
|
||||
this->atom->type_pack4(ntypes,_lj_types,coeff2,host_write,host_a,host_c,
|
||||
host_d,host_offset);
|
||||
host_d,host_offset);
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
@ -151,7 +151,7 @@ void BornT::loop(const bool _eflag, const bool _vflag) {
|
||||
vflag=1;
|
||||
else
|
||||
vflag=0;
|
||||
|
||||
|
||||
int GX=static_cast<int>(ceil(static_cast<double>(this->ans->inum())/
|
||||
(BX/this->_threads_per_atom)));
|
||||
|
||||
@ -169,7 +169,7 @@ void BornT::loop(const bool _eflag, const bool _vflag) {
|
||||
} else {
|
||||
this->k_pair.set_size(GX,BX);
|
||||
this->k_pair.run(&this->atom->x, &coeff1, &coeff2,
|
||||
&cutsq_sigma, &_lj_types, &sp_lj,
|
||||
&cutsq_sigma, &_lj_types, &sp_lj,
|
||||
&this->nbor->dev_nbor,
|
||||
&this->_nbor_data->begin(), &this->ans->force,
|
||||
&this->ans->engv, &eflag, &vflag, &ainum,
|
||||
|
||||
Reference in New Issue
Block a user