pack4 cutoffs

This commit is contained in:
Eddy Barraud
2024-06-05 11:40:24 +02:00
parent b187001f38
commit 9ea57acf54
5 changed files with 28 additions and 32 deletions

View File

@ -47,7 +47,7 @@ int DPDChargedT::init(const int ntypes,
double **host_cutsq, double **host_a0,
double **host_gamma, double **host_sigma,
double **host_cut,
double **host_cut_dpd, **host_cut_slater,
double **host_cut_dpd, double **host_cut_dpdsq, double **host_cut_slatersq,
double *host_special_lj,
const bool tstat_only,
const int nlocal, const int nall,
@ -94,21 +94,16 @@ int DPDChargedT::init(const int ntypes,
coeff.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
this->atom->type_pack4(ntypes,lj_types,coeff,host_write,host_a0,host_gamma,
host_sigma,host_cut);
host_sigma,host_cut_dpd);
UCL_H_Vec<numtyp> host_rsq(lj_types*lj_types,*(this->ucl_device),
// Allocate a host write buffer for data initialization
UCL_H_Vec<numtyp> host_rsq(lj_types*lj_types*32,*(this->ucl_device),
UCL_WRITE_ONLY);
for (int i=0; i<lj_types*lj_types; i++)
host_rsq[i]=0.0;
cutsq.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
this->atom->type_pack1(ntypes,lj_types,cutsq,host_rsq,host_cutsq);
cut_dpd.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
this->atom->type_pack1(ntypes,lj_types,cut_dpdsq,host_rsq,host_cut_dpd);
cutsq.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
this->atom->type_pack1(ntypes,lj_types,cutsq,host_rsq,host_cutsq);
scale.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
this->atom->type_pack1(ntypes,lj_types,scale,host_write,host_scale);
this->atom->type_pack4(ntypes,lj_types,cutsq,host_rsq,host_cutsq,
host_cut_dpdsq, host_cut_dpd, host_cut_slatersq);
double special_sqrt[4];
special_sqrt[0] = sqrt(host_special_lj[0]);
@ -207,12 +202,12 @@ int DPDChargedT::loop(const int eflag, const int vflag) {
template <class numtyp, class acctyp>
void DPDChargedT::update_coeff(int ntypes, double **host_a0, double **host_gamma,
double **host_sigma, double **host_cut, double **host_cut_dpd, **host_cut_slater)
double **host_sigma, double **host_cut_dpd)
{
UCL_H_Vec<numtyp> host_write(_lj_types*_lj_types*32,*(this->ucl_device),
UCL_WRITE_ONLY);
this->atom->type_pack4(ntypes,_lj_types,coeff,host_write,host_a0,host_gamma,
host_sigma,host_cut,host_cut_dpd, host_cut_slater);
host_sigma,host_cut_dpd);
}
// ---------------------------------------------------------------------------