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 ...@@ -55,9 +55,11 @@ static void calcForces(OpenMMContextImpl& context, CudaPlatform::PlatformData& d
kCalculateCDLJForces(gpu); kCalculateCDLJForces(gpu);
} }
kCalculateLocalForces(gpu); kCalculateLocalForces(gpu);
/*
if (gpu->bIncludeGBSA) if (gpu->bIncludeGBSA)
kReduceBornSumAndForces(gpu); kReduceBornSumAndForces(gpu);
else else
*/
kReduceForces(gpu); kReduceForces(gpu);
} }
......
...@@ -33,20 +33,32 @@ ...@@ -33,20 +33,32 @@
__global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit) __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
{ {
extern __shared__ Atom sA[]; extern __shared__ Atom sA[];
/*
unsigned int numWorkUnits = cSim.pInteractionCount[0]; unsigned int numWorkUnits = cSim.pInteractionCount[0];
int end = numWorkUnits / gridDim.x; int end = numWorkUnits / gridDim.x;
int pos = end - (threadIdx.x >> GRIDBITS) - 1; 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 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 #endif
#ifdef USE_CUTOFF #ifdef USE_CUTOFF
float* tempBuffer = (float*) &sA[cSim.nonbond_threads_per_block]; float* tempBuffer = (float*) &sA[cSim.nonbond_threads_per_block];
#endif #endif
while (pos >= 0) //while (pos >= 0)
while (pos < end)
{ {
// Extract cell coordinates from appropriate work unit // 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; unsigned int y = ((x >> 2) & 0x7fff) << GRIDBITS;
x = (x >> 17) << GRIDBITS; x = (x >> 17) << GRIDBITS;
float dx; float dx;
...@@ -142,7 +154,8 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor ...@@ -142,7 +154,8 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor
sA[threadIdx.x].sum = apos.w = 0.0f; sA[threadIdx.x].sum = apos.w = 0.0f;
#ifdef USE_CUTOFF #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) if (flags == 0)
{ {
// No interactions in this block. // No interactions in this block.
...@@ -319,6 +332,7 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor ...@@ -319,6 +332,7 @@ __global__ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* wor
#endif #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