Feb2021 GPU Package Update - GPU Package Files
This commit is contained in:
@ -58,24 +58,27 @@ __kernel void k_table(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
sp_lj[0]=sp_lj_in[0];
|
||||
sp_lj[1]=sp_lj_in[1];
|
||||
sp_lj[2]=sp_lj_in[2];
|
||||
sp_lj[3]=sp_lj_in[3];
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
int tlm1 = tablength - 1;
|
||||
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -112,13 +115,13 @@ __kernel void k_table(const __global numtyp4 *restrict x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1)
|
||||
e = coeff3[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -129,9 +132,9 @@ __kernel void k_table(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
__kernel void k_table_fast(const __global numtyp4 *restrict x_,
|
||||
@ -153,18 +156,22 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_,
|
||||
|
||||
__local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
if (tid<4)
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
cutsq[tid]=cutsq_in[tid];
|
||||
}
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
__syncthreads();
|
||||
|
||||
@ -173,7 +180,6 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_,
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -211,13 +217,13 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1)
|
||||
e = coeff3[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -228,9 +234,9 @@ __kernel void k_table_fast(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
/// ---------------- LINEAR -------------------------------------------------
|
||||
@ -254,24 +260,27 @@ __kernel void k_table_linear(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
sp_lj[0]=sp_lj_in[0];
|
||||
sp_lj[1]=sp_lj_in[1];
|
||||
sp_lj[2]=sp_lj_in[2];
|
||||
sp_lj[3]=sp_lj_in[3];
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
int tlm1 = tablength - 1;
|
||||
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -312,13 +321,13 @@ __kernel void k_table_linear(const __global numtyp4 *restrict x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1)
|
||||
e = coeff3[idx].y + fraction*coeff4[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -329,9 +338,9 @@ __kernel void k_table_linear(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
__kernel void k_table_linear_fast(const __global numtyp4 *restrict x_,
|
||||
@ -353,18 +362,22 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_,
|
||||
|
||||
__local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
if (tid<4)
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
cutsq[tid]=cutsq_in[tid];
|
||||
}
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
__syncthreads();
|
||||
|
||||
@ -373,7 +386,6 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_,
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -415,13 +427,13 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1)
|
||||
e = coeff3[idx].y + fraction*coeff4[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -432,9 +444,9 @@ __kernel void k_table_linear_fast(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
/// ---------------- SPLINE -------------------------------------------------
|
||||
@ -458,24 +470,27 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
sp_lj[0]=sp_lj_in[0];
|
||||
sp_lj[1]=sp_lj_in[1];
|
||||
sp_lj[2]=sp_lj_in[2];
|
||||
sp_lj[3]=sp_lj_in[3];
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
int tlm1 = tablength - 1;
|
||||
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -520,7 +535,7 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1) {
|
||||
e = a * coeff3[idx].y + b * coeff3[idx+1].y +
|
||||
@ -529,7 +544,7 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -540,9 +555,9 @@ __kernel void k_table_spline(const __global numtyp4 *restrict x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
__kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
@ -564,19 +579,22 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
|
||||
__local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
if (tid<4)
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
cutsq[tid]=cutsq_in[tid];
|
||||
}
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
__syncthreads();
|
||||
|
||||
int tlm1 = tablength - 1;
|
||||
@ -584,7 +602,6 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -630,7 +647,7 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable < tlm1) {
|
||||
e = a * coeff3[idx].y + b * coeff3[idx+1].y +
|
||||
@ -639,7 +656,7 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
}
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -650,9 +667,9 @@ __kernel void k_table_spline_fast(const __global numtyp4 *x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
/// ---------------- BITMAP -------------------------------------------------
|
||||
@ -678,24 +695,27 @@ __kernel void k_table_bitmap(const __global numtyp4 *x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
sp_lj[0]=sp_lj_in[0];
|
||||
sp_lj[1]=sp_lj_in[1];
|
||||
sp_lj[2]=sp_lj_in[2];
|
||||
sp_lj[3]=sp_lj_in[3];
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
int tlm1 = tablength - 1;
|
||||
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -739,13 +759,13 @@ __kernel void k_table_bitmap(const __global numtyp4 *x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable <= tlm1)
|
||||
e = coeff3[idx].y + fraction*coeff4[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -756,9 +776,9 @@ __kernel void k_table_bitmap(const __global numtyp4 *x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
__kernel void k_table_bitmap_fast(const __global numtyp4 *x_,
|
||||
@ -782,18 +802,22 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_,
|
||||
|
||||
__local numtyp cutsq[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
int n_stride;
|
||||
local_allocate_store_pair();
|
||||
|
||||
if (tid<4)
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
cutsq[tid]=cutsq_in[tid];
|
||||
}
|
||||
|
||||
acctyp energy=(acctyp)0;
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
acctyp virial[6];
|
||||
for (int i=0; i<6; i++)
|
||||
virial[i]=(acctyp)0;
|
||||
acctyp energy, virial[6];
|
||||
if (EVFLAG) {
|
||||
energy=(acctyp)0;
|
||||
for (int i=0; i<6; i++) virial[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
__syncthreads();
|
||||
|
||||
@ -802,7 +826,6 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_,
|
||||
if (ii<inum) {
|
||||
int nbor, nbor_end;
|
||||
int i, numj;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
@ -847,13 +870,13 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_,
|
||||
f.y+=dely*force;
|
||||
f.z+=delz*force;
|
||||
|
||||
if (eflag>0) {
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0.0;
|
||||
if (itable <= tlm1)
|
||||
e = coeff3[idx].y + fraction*coeff4[idx].y;
|
||||
energy+=factor_lj*e;
|
||||
}
|
||||
if (vflag>0) {
|
||||
if (EVFLAG && vflag) {
|
||||
virial[0] += delx*delx*force;
|
||||
virial[1] += dely*dely*force;
|
||||
virial[2] += delz*delz*force;
|
||||
@ -864,7 +887,7 @@ __kernel void k_table_bitmap_fast(const __global numtyp4 *x_,
|
||||
}
|
||||
|
||||
} // for nbor
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
} // if ii
|
||||
store_answers(f,energy,virial,ii,inum,tid,t_per_atom,offset,eflag,vflag,
|
||||
ans,engv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user