"vscode:/vscode.git/clone" did not exist on "3aa4bb8c5d1d6da0e4207283fa5ea7f7a70d4005"
Commit 3007cf52 authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

In calcForces() kReduceBornSumAndForces kernel is not needed since Born...

In calcForces() kReduceBornSumAndForces kernel is not needed since Born radii/Obc chain term now calculated prior to calculation of forces
Modified kCalculateObcGbsaBornSum kernel loop to match that in kCalculateCDLJObcGbsaForces1; Born sums are zero w/o mods
parent 05259f77
......@@ -55,9 +55,11 @@ static void calcForces(OpenMMContextImpl& context, CudaPlatform::PlatformData& d
kCalculateCDLJForces(gpu);
}
kCalculateLocalForces(gpu);
/*
if (gpu->bIncludeGBSA)
kReduceBornSumAndForces(gpu);
else
*/
kReduceForces(gpu);
}
......
......@@ -33,20 +33,32 @@
__global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
{
extern __shared__ Atom sA[];
/*
unsigned int numWorkUnits = cSim.pInteractionCount[0];
int end = numWorkUnits / gridDim.x;
int pos = end - (threadIdx.x >> GRIDBITS) - 1;
#ifdef USE_OUTPUT_BUFFER_PER_WARP
*/
unsigned int totalWarps = cSim.nonbond_blocks*cSim.nonbond_threads_per_block/GRID;
unsigned int warp = (blockIdx.x*blockDim.x+threadIdx.x)/GRID;
unsigned int numWorkUnits = cSim.pInteractionCount[0];
unsigned int pos = warp*numWorkUnits/totalWarps;
unsigned int end = (warp+1)*numWorkUnits/totalWarps;
#ifdef USE_OUTPUT_BUFFER_PER_WARP
// unsigned int warp = (blockIdx.x*blockDim.x+threadIdx.x)/GRID;
#endif
#ifdef USE_CUTOFF
float* tempBuffer = (float*) &sA[cSim.nonbond_threads_per_block];
#endif
while (pos >= 0)
//while (pos >= 0)
while (pos < end)
{
// Extract cell coordinates from appropriate work unit
unsigned int x = workUnit[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
//unsigned int x = workUnit[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
unsigned int x = workUnit[pos];
unsigned int y = ((x >> 2) & 0x7fff) << GRIDBITS;
x = (x >> 17) << GRIDBITS;
float dx;
......@@ -142,7 +154,8 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor
sA[threadIdx.x].sum = apos.w = 0.0f;
#ifdef USE_CUTOFF
unsigned int flags = cSim.pInteractionFlag[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
//unsigned int flags = cSim.pInteractionFlag[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
unsigned int flags = cSim.pInteractionFlag[pos];
if (flags == 0)
{
// No interactions in this block.
......@@ -319,6 +332,7 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor
#endif
}
pos -= cSim.nonbond_workBlock;
//pos -= cSim.nonbond_workBlock;
pos++;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment