Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
f3aa6be9
"...ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "446aaeb47db6dc2d2fe156bc4484847d6281e209"
Commit
f3aa6be9
authored
Nov 10, 2009
by
Mark Friedrichs
Browse files
Added missing kReduceObcGbsaSoftcoreBornForces
parent
aa4f6c62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
3 deletions
+70
-3
plugins/freeEnergy/platforms/cuda/src/CudaFreeEnergyKernels.cpp
...s/freeEnergy/platforms/cuda/src/CudaFreeEnergyKernels.cpp
+1
-3
plugins/freeEnergy/platforms/cuda/src/kernels/GpuFreeEnergyCudaKernels.h
...rgy/platforms/cuda/src/kernels/GpuFreeEnergyCudaKernels.h
+1
-0
plugins/freeEnergy/platforms/cuda/src/kernels/kCalculateObcGbsaSoftcoreBornSum.cu
...orms/cuda/src/kernels/kCalculateObcGbsaSoftcoreBornSum.cu
+68
-0
No files found.
plugins/freeEnergy/platforms/cuda/src/CudaFreeEnergyKernels.cpp
View file @
f3aa6be9
...
@@ -562,9 +562,7 @@ void CudaFreeEnergyCalcGBSAOBCSoftcoreForceKernel::executeForces(ContextImpl& co
...
@@ -562,9 +562,7 @@ void CudaFreeEnergyCalcGBSAOBCSoftcoreForceKernel::executeForces(ContextImpl& co
// compute Born forces
// compute Born forces
gpu
->
bIncludeGBSA
=
true
;
kReduceObcGbsaSoftcoreBornForces
(
gpu
);
kReduceObcGbsaBornForces
(
gpu
);
gpu
->
bIncludeGBSA
=
false
;
if
(
debug
&&
log
){
if
(
debug
&&
log
){
(
void
)
fprintf
(
stderr
,
"
\n
%s calling kCalculateObcGbsaForces2
\n
"
,
methodName
.
c_str
()
);
(
void
)
fprintf
(
stderr
,
"
\n
%s calling kCalculateObcGbsaForces2
\n
"
,
methodName
.
c_str
()
);
...
...
plugins/freeEnergy/platforms/cuda/src/kernels/GpuFreeEnergyCudaKernels.h
View file @
f3aa6be9
...
@@ -151,6 +151,7 @@ void SetCalculateObcGbsaSoftcoreForces2Sim( gpuContext gpu );
...
@@ -151,6 +151,7 @@ void SetCalculateObcGbsaSoftcoreForces2Sim( gpuContext gpu );
// kernel calls to device
// kernel calls to device
extern
void
kReduceObcGbsaSoftcoreBornForces
(
gpuContext
gpu
);
extern
void
kCalculateObcGbsaSoftcoreBornSum
(
gpuContext
gpu
);
extern
void
kCalculateObcGbsaSoftcoreBornSum
(
gpuContext
gpu
);
// this method is not needed; the OpenMM version can be used
// this method is not needed; the OpenMM version can be used
...
...
plugins/freeEnergy/platforms/cuda/src/kernels/kCalculateObcGbsaSoftcoreBornSum.cu
View file @
f3aa6be9
...
@@ -75,6 +75,74 @@ void GetCalculateObcGbsaSoftcoreBornSumSim(gpuContext gpu)
...
@@ -75,6 +75,74 @@ void GetCalculateObcGbsaSoftcoreBornSumSim(gpuContext gpu)
RTERROR
(
status
,
"GetCalculateObcGbsaSoftcoreBornSumSim: cudaMemcpyFromSymbol: SetSim copy from cSim failed"
);
RTERROR
(
status
,
"GetCalculateObcGbsaSoftcoreBornSumSim: cudaMemcpyFromSymbol: SetSim copy from cSim failed"
);
}
}
__global__
void
kReduceObcGbsaSoftcoreBornForces_kernel
()
{
unsigned
int
pos
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
);
float
energy
=
0.0
f
;
while
(
pos
<
cSim
.
atoms
)
{
float
bornRadius
=
cSim
.
pBornRadii
[
pos
];
float
obcChain
=
cSim
.
pObcChain
[
pos
];
float2
obcData
=
cSim
.
pObcData
[
pos
];
float
nonPolarScaleData
=
gbsaSimDev
.
pNonPolarScalingFactors
[
pos
];
float
totalForce
=
0.0
f
;
float
*
pFt
=
cSim
.
pBornForce
+
pos
;
int
i
=
cSim
.
nonbondOutputBuffers
;
while
(
i
>=
4
)
{
float
f1
=
*
pFt
;
pFt
+=
cSim
.
stride
;
float
f2
=
*
pFt
;
pFt
+=
cSim
.
stride
;
float
f3
=
*
pFt
;
pFt
+=
cSim
.
stride
;
float
f4
=
*
pFt
;
pFt
+=
cSim
.
stride
;
totalForce
+=
f1
+
f2
+
f3
+
f4
;
i
-=
4
;
}
if
(
i
>=
2
)
{
float
f1
=
*
pFt
;
pFt
+=
cSim
.
stride
;
float
f2
=
*
pFt
;
pFt
+=
cSim
.
stride
;
totalForce
+=
f1
+
f2
;
i
-=
2
;
}
if
(
i
>
0
)
{
totalForce
+=
*
pFt
;
}
float
r
=
(
obcData
.
x
+
cSim
.
dielectricOffset
+
cSim
.
probeRadius
);
float
ratio6
=
pow
((
obcData
.
x
+
cSim
.
dielectricOffset
)
/
bornRadius
,
6.0
f
);
float
saTerm
=
nonPolarScaleData
*
cSim
.
surfaceAreaFactor
*
r
*
r
*
ratio6
;
totalForce
+=
saTerm
/
bornRadius
;
// 1.102 == Temp mysterious fudge factor, FIX FIX FIX
/* E */
energy
+=
saTerm
;
totalForce
*=
bornRadius
*
bornRadius
*
obcChain
;
pFt
=
cSim
.
pBornForce
+
pos
;
*
pFt
=
totalForce
;
pos
+=
gridDim
.
x
*
blockDim
.
x
;
}
/* E */
// correct for surface area factor of -6
cSim
.
pEnergy
[
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
]
+=
energy
/
-
6.0
f
;
}
void
kReduceObcGbsaSoftcoreBornForces
(
gpuContext
gpu
)
{
kReduceObcGbsaSoftcoreBornForces_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
bf_reduce_threads_per_block
>>>
();
LAUNCHERROR
(
"kReduceObcGbsaBornForces"
);
}
// Include versions of the kernels for N^2 calculations.
// Include versions of the kernels for N^2 calculations.
#define METHOD_NAME(a, b) a##N2##b
#define METHOD_NAME(a, b) a##N2##b
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment