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
1e2606ec
"wrappers/vscode:/vscode.git/clone" did not exist on "1eec1e155e41a7657296cd46e9eb81292a8147b8"
Commit
1e2606ec
authored
Nov 17, 2011
by
Peter Eastman
Browse files
Fixed bug in parallel nonbonded force
parent
1a21cf08
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
+2
-0
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
+5
-2
No files found.
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
View file @
1e2606ec
...
@@ -375,6 +375,8 @@ void OpenCLNonbondedUtilities::setTileRange(int startTileIndex, int numTiles) {
...
@@ -375,6 +375,8 @@ void OpenCLNonbondedUtilities::setTileRange(int startTileIndex, int numTiles) {
findInteractingBlocksKernel
.
setArg
<
cl_uint
>
(
10
,
startTileIndex
);
findInteractingBlocksKernel
.
setArg
<
cl_uint
>
(
10
,
startTileIndex
);
findInteractingBlocksKernel
.
setArg
<
cl_uint
>
(
11
,
startTileIndex
+
numTiles
);
findInteractingBlocksKernel
.
setArg
<
cl_uint
>
(
11
,
startTileIndex
+
numTiles
);
}
}
else
forceKernel
.
setArg
<
cl_uint
>
(
9
,
numTiles
);
}
}
cl
::
Kernel
OpenCLNonbondedUtilities
::
createInteractionKernel
(
const
string
&
source
,
const
vector
<
ParameterInfo
>&
params
,
const
vector
<
ParameterInfo
>&
arguments
,
bool
useExclusions
,
bool
isSymmetric
)
const
{
cl
::
Kernel
OpenCLNonbondedUtilities
::
createInteractionKernel
(
const
string
&
source
,
const
vector
<
ParameterInfo
>&
params
,
const
vector
<
ParameterInfo
>&
arguments
,
bool
useExclusions
,
bool
isSymmetric
)
const
{
...
...
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
View file @
1e2606ec
...
@@ -676,7 +676,7 @@ void testDispersionCorrection() {
...
@@ -676,7 +676,7 @@ void testDispersionCorrection() {
ASSERT_EQUAL_TOL
(
expected
,
energy1
-
energy2
,
1e-4
);
ASSERT_EQUAL_TOL
(
expected
,
energy1
-
energy2
,
1e-4
);
}
}
void
testParallelComputation
()
{
void
testParallelComputation
(
bool
useCutoff
)
{
OpenCLPlatform
platform
;
OpenCLPlatform
platform
;
System
system
;
System
system
;
const
int
numParticles
=
200
;
const
int
numParticles
=
200
;
...
@@ -685,6 +685,8 @@ void testParallelComputation() {
...
@@ -685,6 +685,8 @@ void testParallelComputation() {
NonbondedForce
*
force
=
new
NonbondedForce
();
NonbondedForce
*
force
=
new
NonbondedForce
();
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
force
->
addParticle
(
i
%
2
-
0.5
,
0.5
,
1.0
);
force
->
addParticle
(
i
%
2
-
0.5
,
0.5
,
1.0
);
if
(
useCutoff
)
force
->
setNonbondedMethod
(
NonbondedForce
::
CutoffNonPeriodic
);
system
.
addForce
(
force
);
system
.
addForce
(
force
);
OpenMM_SFMT
::
SFMT
sfmt
;
OpenMM_SFMT
::
SFMT
sfmt
;
init_gen_rand
(
0
,
sfmt
);
init_gen_rand
(
0
,
sfmt
);
...
@@ -725,7 +727,8 @@ int main() {
...
@@ -725,7 +727,8 @@ int main() {
testBlockInteractions
(
false
);
testBlockInteractions
(
false
);
testBlockInteractions
(
true
);
testBlockInteractions
(
true
);
testDispersionCorrection
();
testDispersionCorrection
();
testParallelComputation
();
testParallelComputation
(
false
);
testParallelComputation
(
true
);
}
}
catch
(
const
exception
&
e
)
{
catch
(
const
exception
&
e
)
{
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
...
...
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