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
01235988
Commit
01235988
authored
Sep 06, 2012
by
Peter Eastman
Browse files
Fixed bugs in AmoebaWcaDispersionForce
parent
505c2afe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
+1
-2
plugins/amoeba/platforms/cuda2/src/kernels/amoebaWcaForce.cu
plugins/amoeba/platforms/cuda2/src/kernels/amoebaWcaForce.cu
+7
-7
No files found.
plugins/amoeba/platforms/cuda2/src/AmoebaCudaKernels.cpp
View file @
01235988
...
@@ -1921,8 +1921,7 @@ void CudaCalcAmoebaWcaDispersionForceKernel::initialize(const System& system, co
...
@@ -1921,8 +1921,7 @@ void CudaCalcAmoebaWcaDispersionForceKernel::initialize(const System& system, co
defines
[
"RMINO"
]
=
cu
.
doubleToString
(
force
.
getRmino
());
defines
[
"RMINO"
]
=
cu
.
doubleToString
(
force
.
getRmino
());
defines
[
"RMINH"
]
=
cu
.
doubleToString
(
force
.
getRminh
());
defines
[
"RMINH"
]
=
cu
.
doubleToString
(
force
.
getRminh
());
defines
[
"AWATER"
]
=
cu
.
doubleToString
(
force
.
getAwater
());
defines
[
"AWATER"
]
=
cu
.
doubleToString
(
force
.
getAwater
());
defines
[
"SHCTD"
]
=
cu
.
doubleToString
(
force
.
getEpso
());
defines
[
"SHCTD"
]
=
cu
.
doubleToString
(
force
.
getShctd
());
defines
[
"EPSO"
]
=
cu
.
doubleToString
(
force
.
getShctd
());
CUmodule
module
=
cu
.
createModule
(
CudaKernelSources
::
vectorOps
+
CudaAmoebaKernelSources
::
amoebaWcaForce
,
defines
);
CUmodule
module
=
cu
.
createModule
(
CudaKernelSources
::
vectorOps
+
CudaAmoebaKernelSources
::
amoebaWcaForce
,
defines
);
forceKernel
=
cu
.
getKernel
(
module
,
"computeWCAForce"
);
forceKernel
=
cu
.
getKernel
(
module
,
"computeWCAForce"
);
totalMaximumDispersionEnergy
=
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
);
totalMaximumDispersionEnergy
=
AmoebaWcaDispersionForceImpl
::
getTotalMaximumDispersionEnergy
(
force
);
...
...
plugins/amoeba/platforms/cuda2/src/kernels/amoebaWcaForce.cu
View file @
01235988
...
@@ -231,8 +231,6 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
...
@@ -231,8 +231,6 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
if
(
atom1
!=
atom2
&&
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
)
{
if
(
atom1
!=
atom2
&&
atom1
<
NUM_ATOMS
&&
atom2
<
NUM_ATOMS
)
{
real3
tempForce
;
real3
tempForce
;
real
tempEnergy
;
real
tempEnergy
;
if
(
atom2
!=
0
)
continue
;
computeOneInteraction
(
data
,
localData
[
tbx
+
j
],
rmixo
,
rmixh
,
emixo
,
emixh
,
tempForce
,
tempEnergy
);
computeOneInteraction
(
data
,
localData
[
tbx
+
j
],
rmixo
,
rmixh
,
emixo
,
emixh
,
tempForce
,
tempEnergy
);
data
.
force
+=
tempForce
;
data
.
force
+=
tempForce
;
localData
[
tbx
+
j
].
force
-=
tempForce
;
localData
[
tbx
+
j
].
force
-=
tempForce
;
...
@@ -249,12 +247,14 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
...
@@ -249,12 +247,14 @@ extern "C" __global__ void computeWCAForce(unsigned long long* __restrict__ forc
atomicAdd
(
&
forceBuffers
[
offset
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
x
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
x
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
y
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
y
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
2
*
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
z
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
2
*
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
data
.
force
.
z
*
0xFFFFFFFF
)));
offset
=
y
*
TILE_SIZE
+
tgx
;
if
(
x
!=
y
)
{
atomicAdd
(
&
forceBuffers
[
offset
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
x
*
0xFFFFFFFF
)));
offset
=
y
*
TILE_SIZE
+
tgx
;
atomicAdd
(
&
forceBuffers
[
offset
+
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
y
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
x
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
2
*
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
z
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
y
*
0xFFFFFFFF
)));
atomicAdd
(
&
forceBuffers
[
offset
+
2
*
PADDED_NUM_ATOMS
],
static_cast
<
unsigned
long
long
>
((
long
long
)
(
localData
[
threadIdx
.
x
].
force
.
z
*
0xFFFFFFFF
)));
}
}
}
pos
++
;
pos
++
;
}
while
(
pos
<
end
);
}
while
(
pos
<
end
);
energyBuffer
[
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
]
+
=
energy
;
energyBuffer
[
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
]
-
=
AWATER
*
energy
;
}
}
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