// ************************************************************************** // lj_cubic.cu // ------------------- // Trung Dac Nguyen // // Device code for acceleration of the lj/cubic pair style // // __________________________________________________________________________ // This file is part of the LAMMPS Accelerator Library (LAMMPS_AL) // __________________________________________________________________________ // // begin : // email : ndactrung@gmail.com // *************************************************************************** #if defined(NV_KERNEL) || defined(USE_HIP) #include "lal_aux_fun1.h" #ifndef _DOUBLE_DOUBLE _texture( pos_tex,float4); #else _texture_2d( pos_tex,int4); #endif #else #define pos_tex x_ #endif // LJ quantities scaled by epsilon and rmin = sigma*2^1/6 (see src/pair_lj_cubic.h) #define _RT6TWO (numtyp)1.1224620483093730 /* 2^1/6 */ #define _PHIS (numtyp)-0.7869822485207097 /* energy at s */ #define _DPHIDS (numtyp)2.6899008972047196 /* gradient at s */ #define _A3 (numtyp)27.9335700460986445 /* cubic coefficient */ __kernel void k_lj_cubic(const __global numtyp4 *restrict x_, const __global numtyp4 *restrict lj1, const __global numtyp4 *restrict lj2, const __global numtyp2 *restrict lj3, const int lj_types, const __global numtyp *restrict sp_lj, const __global int * dev_nbor, const __global int * dev_packed, __global acctyp4 *restrict ans, __global acctyp *restrict engv, const int eflag, const int vflag, const int inum, const int nbor_pitch, const int t_per_atom) { int tid, ii, offset; atom_info(t_per_atom,ii,tid,offset); int n_stride; local_allocate_store_pair(); acctyp4 f; f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0; acctyp energy, virial[6]; if (EVFLAG) { energy=(acctyp)0; for (int i=0; i<6; i++) virial[i]=(acctyp)0; } if (ii