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
21d2b6b9
Commit
21d2b6b9
authored
Nov 29, 2012
by
Peter Eastman
Browse files
Fixed bugs in CUDA implementation of AmoebaWcaDispersionForce
parent
dbccc9dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
+2
-1
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
+8
-6
No files found.
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
View file @
21d2b6b9
...
...
@@ -2269,5 +2269,6 @@ void CudaCalcAmoebaWcaDispersionForceKernel::copyParametersToContext(ContextImpl
radiusEpsilonVec
[
i
]
=
make_float2
((
float
)
radius
,
(
float
)
epsilon
);
}
radiusEpsilon
->
upload
(
radiusEpsilonVec
);
totalMaximumDispersionEnergy
=
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
);
cu
.
invalidateMolecules
();
}
plugins/amoeba/platforms/cuda/src/kernels/amoebaWcaForce.cu
View file @
21d2b6b9
...
...
@@ -226,22 +226,24 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
// Compute forces.
unsigned
int
tj
=
tgx
;
for
(
unsigned
int
j
=
0
;
j
<
TILE_SIZE
;
j
++
)
{
int
atom2
=
y
*
TILE_SIZE
+
j
;
int
atom2
=
y
*
TILE_SIZE
+
t
j
;
if
(
atom1
!=
atom2
&&
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
)
{
real3
tempForce
;
real
tempEnergy
;
computeOneInteraction
(
data
,
localData
[
tbx
+
j
],
rmixo
,
rmixh
,
emixo
,
emixh
,
tempForce
,
tempEnergy
);
computeOneInteraction
(
data
,
localData
[
tbx
+
t
j
],
rmixo
,
rmixh
,
emixo
,
emixh
,
tempForce
,
tempEnergy
);
data
.
force
+=
tempForce
;
localData
[
tbx
+
j
].
force
-=
tempForce
;
localData
[
tbx
+
t
j
].
force
-=
tempForce
;
energy
+=
(
x
==
y
?
0.5
f
*
tempEnergy
:
tempEnergy
);
real
emjxo
,
emjxh
,
rmjxo
,
rmjxh
;
initParticleParameters
(
localData
[
tbx
+
j
].
radius
,
localData
[
tbx
+
j
].
epsilon
,
rmjxo
,
rmjxh
,
emjxo
,
emjxh
);
computeOneInteraction
(
localData
[
tbx
+
j
],
data
,
rmjxo
,
rmjxh
,
emjxo
,
emjxh
,
tempForce
,
tempEnergy
);
initParticleParameters
(
localData
[
tbx
+
t
j
].
radius
,
localData
[
tbx
+
t
j
].
epsilon
,
rmjxo
,
rmjxh
,
emjxo
,
emjxh
);
computeOneInteraction
(
localData
[
tbx
+
t
j
],
data
,
rmjxo
,
rmjxh
,
emjxo
,
emjxh
,
tempForce
,
tempEnergy
);
data
.
force
-=
tempForce
;
localData
[
tbx
+
j
].
force
+=
tempForce
;
localData
[
tbx
+
t
j
].
force
+=
tempForce
;
energy
+=
(
x
==
y
?
0.5
f
*
tempEnergy
:
tempEnergy
);
}
tj
=
(
tj
+
1
)
&
(
TILE_SIZE
-
1
);
}
unsigned
int
offset
=
x
*
TILE_SIZE
+
tgx
;
atomicAdd
(
&
forceBuffers
[
offset
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
x
*
0xFFFFFFFF
)));
...
...
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