// ************************************************************************** // lj_coul_msm.cu // ------------------- // Trung Dac Nguyen (ORNL) // // Device code for acceleration of the lj/cut/coul/msm pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) // __________________________________________________________________________ // // begin : // email : nguyentd@ornl.gov // *************************************************************************** #if defined(NV_KERNEL) || defined(USE_HIP) #include "lal_aux_fun1.h" #ifndef _DOUBLE_DOUBLE _texture( pos_tex,float4); _texture( q_tex,float); _texture( gcons_tex,float); _texture( dgcons_tex,float); #else _texture_2d( pos_tex,int4); _texture( q_tex,int2); _texture( gcons_tex,int2); _texture( dgcons_tex,int2); #endif #if (__CUDACC_VER_MAJOR__ >= 11) #define gcons_tex gcons #define dgcons_tex dgcons #endif #else #define pos_tex x_ #define q_tex q_ #define gcons_tex gcons #define dgcons_tex dgcons #endif /* ---------------------------------------------------------------------- compute gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164–177 ------------------------------------------------------------------------- */ ucl_inline numtyp gamma(const numtyp rho, const int order, const __global numtyp *gcons) { if (rho <= (numtyp)1.0) { const int split_order = order/2; const numtyp rho2 = rho*rho; numtyp g; fetch(g,7*split_order+0,gcons_tex); numtyp rho_n = rho2; for (int n=1; n<=split_order; n++) { numtyp tmp; fetch(tmp,7*split_order+n,gcons_tex); g += tmp*rho_n; rho_n *= rho2; } return g; } else return ((numtyp)1.0/rho); } /* ---------------------------------------------------------------------- compute the derivative of gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164-177 ------------------------------------------------------------------------- */ ucl_inline numtyp dgamma(const numtyp rho, const int order, const __global numtyp *dgcons) { if (rho <= (numtyp)1.0) { const int split_order = order/2; const numtyp rho2 = rho*rho; numtyp dg; fetch(dg,6*split_order+0,dgcons_tex); dg *= rho; numtyp rho_n = rho*rho2; for (int n=1; n