class n func rename

This commit is contained in:
Eddy BARRAUD
2024-06-17 10:03:06 +02:00
parent a4ac48addf
commit 4be1b41aef
8 changed files with 74 additions and 74 deletions

View File

@ -24,26 +24,26 @@ const char *dpd_coul_slater_long=0;
#include "lal_dpd_coul_slater_long.h"
#include <cassert>
namespace LAMMPS_AL {
#define DPDChargedT DPDCharged<numtyp, acctyp>
#define DPDCoulSlaterLongT DPDCoulSlaterLong<numtyp, acctyp>
extern Device<PRECISION,ACC_PRECISION> device;
template <class numtyp, class acctyp>
DPDChargedT::DPDCharged() : BaseDPD<numtyp,acctyp>(), _allocated(false) {
DPDCoulSlaterLongT::DPDCoulSlaterLong() : BaseDPD<numtyp,acctyp>(), _allocated(false) {
}
template <class numtyp, class acctyp>
DPDChargedT::~DPDCharged() {
DPDCoulSlaterLongT::~DPDCoulSlaterLong() {
clear();
}
template <class numtyp, class acctyp>
int DPDChargedT::bytes_per_atom(const int max_nbors) const {
int DPDCoulSlaterLongT::bytes_per_atom(const int max_nbors) const {
return this->bytes_per_atom_atomic(max_nbors);
}
template <class numtyp, class acctyp>
int DPDChargedT::init(const int ntypes,
int DPDCoulSlaterLongT::init(const int ntypes,
double **host_cutsq, double **host_a0,
double **host_gamma, double **host_sigma,
double **host_cut_dpd, double **host_cut_dpdsq,
@ -75,7 +75,7 @@ int DPDChargedT::init(const int ntypes,
int success;
bool need_charges = true;
success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,
gpu_split,_screen,dpd_coul_slater_long,"k_dpd_charged",onetype, extra_fields, need_charges);
gpu_split,_screen,dpd_coul_slater_long,"k_dpd_coul_slater_long",onetype, extra_fields, need_charges);
if (success!=0)
return success;
@ -140,7 +140,7 @@ int DPDChargedT::init(const int ntypes,
}
template <class numtyp, class acctyp>
void DPDChargedT::clear() {
void DPDCoulSlaterLongT::clear() {
if (!_allocated)
return;
_allocated=false;
@ -153,15 +153,15 @@ void DPDChargedT::clear() {
}
template <class numtyp, class acctyp>
double DPDChargedT::host_memory_usage() const {
return this->host_memory_usage_atomic()+sizeof(DPDCharged<numtyp,acctyp>);
double DPDCoulSlaterLongT::host_memory_usage() const {
return this->host_memory_usage_atomic()+sizeof(DPDCoulSlaterLong<numtyp,acctyp>);
}
// ---------------------------------------------------------------------------
// Calculate energies, forces, and torques
// ---------------------------------------------------------------------------
template <class numtyp, class acctyp>
int DPDChargedT::loop(const int eflag, const int vflag) {
int DPDCoulSlaterLongT::loop(const int eflag, const int vflag) {
int nall = this->atom->nall();
// signal that we need to transfer extra data from the host
@ -215,7 +215,7 @@ 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,
void DPDCoulSlaterLongT::update_coeff(int ntypes, double **host_a0, double **host_gamma,
double **host_sigma, double **host_cut_dpd)
{
UCL_H_Vec<numtyp> host_write(_lj_types*_lj_types*32,*(this->ucl_device),
@ -229,11 +229,11 @@ void DPDChargedT::update_coeff(int ntypes, double **host_a0, double **host_gamma
// ---------------------------------------------------------------------------
template <class numtyp, class acctyp>
void DPDChargedT::get_extra_data(double *host_q) {
void DPDCoulSlaterLongT::get_extra_data(double *host_q) {
q = host_q;
}
template class DPDCharged<PRECISION,ACC_PRECISION>;
template class DPDCoulSlaterLong<PRECISION,ACC_PRECISION>;
}

View File

@ -10,8 +10,8 @@
// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
// __________________________________________________________________________
//
// begin : Jan 15, 2014
// email : nguyentd@ornl.gov
// begin : May 28, 2024
// email : eddy.barraud@outlook.fr
// ***************************************************************************
#if defined(NV_KERNEL) || defined(USE_HIP)
@ -162,7 +162,7 @@ _texture_2d( vel_tex,int4);
}
#endif
__kernel void k_dpd_charged(const __global numtyp4 *restrict x_,
__kernel void k_dpd_coul_slater_long(const __global numtyp4 *restrict x_,
const __global numtyp4 *restrict extra,
const __global numtyp4 *restrict coeff,
const int lj_types,
@ -336,7 +336,7 @@ __kernel void k_dpd_charged(const __global numtyp4 *restrict x_,
ans,engv);
}
__kernel void k_dpd_charged_fast(const __global numtyp4 *restrict x_,
__kernel void k_dpd_coul_slater_long_fast(const __global numtyp4 *restrict x_,
const __global numtyp4 *restrict extra,
const __global numtyp4 *restrict coeff_in,
const __global numtyp *restrict sp_lj_in,

View File

@ -21,10 +21,10 @@
namespace LAMMPS_AL {
template <class numtyp, class acctyp>
class DPDCharged : public BaseDPD<numtyp, acctyp> {
class DPDCoulSlaterLong : public BaseDPD<numtyp, acctyp> {
public:
DPDCharged();
~DPDCharged();
DPDCoulSlaterLong();
~DPDCoulSlaterLong();
/// Clear any previous data and set up for a new LAMMPS run
/** \param max_nbors initial number of rows in the neighbor matrix

View File

@ -22,12 +22,12 @@
using namespace std;
using namespace LAMMPS_AL;
static DPDCharged<PRECISION,ACC_PRECISION> DPDCMF;
static DPDCoulSlaterLong<PRECISION,ACC_PRECISION> DPDCMF;
// ---------------------------------------------------------------------------
// Allocate memory on host and device and copy constants to device
// ---------------------------------------------------------------------------
int dpd_charged_gpu_init(const int ntypes, double **host_cutsq, double **host_a0, double **host_gamma,
int dpd_coul_slater_long_gpu_init(const int ntypes, double **host_cutsq, double **host_a0, double **host_gamma,
double **host_sigma, double **host_cut_dpd, double **host_cut_dpdsq, double **host_cut_slatersq,
double **host_scale, double *special_lj, const int inum,
const int nall, const int max_nbors, const int maxspecial, const double cell_size,
@ -93,11 +93,11 @@ int dpd_charged_gpu_init(const int ntypes, double **host_cutsq, double **host_a0
return init_ok;
}
void dpd_charged_gpu_clear() {
void dpd_coul_slater_long_gpu_clear() {
DPDCMF.clear();
}
int ** dpd_charged_gpu_compute_n(const int ago, const int inum_full, const int nall,
int ** dpd_coul_slater_long_gpu_compute_n(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,
@ -112,7 +112,7 @@ int ** dpd_charged_gpu_compute_n(const int ago, const int inum_full, const int n
host_v, dtinvsqrt, seed, timestep, boxlo, prd);
}
void dpd_charged_gpu_compute(const int ago, const int inum_full, const int nall,
void dpd_coul_slater_long_gpu_compute(const int 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,
@ -125,17 +125,17 @@ void dpd_charged_gpu_compute(const int ago, const int inum_full, const int nall,
tag, host_v, dtinvsqrt, seed, timestep, nlocal, boxlo, prd);
}
void dpd_charged_gpu_update_coeff(int ntypes, double **host_a0, double **host_gamma,
void dpd_coul_slater_long_gpu_update_coeff(int ntypes, double **host_a0, double **host_gamma,
double **host_sigma, double **host_cut_dpd)
{
DPDCMF.update_coeff(ntypes,host_a0,host_gamma,host_sigma, host_cut_dpd);
}
void dpd_charged_gpu_get_extra_data(double *host_q) {
void dpd_coul_slater_long_gpu_get_extra_data(double *host_q) {
DPDCMF.get_extra_data(host_q);
}
double dpd_charged_gpu_bytes() {
double dpd_coul_slater_long_gpu_bytes() {
return DPDCMF.host_memory_usage();
}