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
61bb8786
Commit
61bb8786
authored
Oct 26, 2012
by
Peter Eastman
Browse files
Bug fixes
parent
925b00ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
platforms/cuda/src/CudaNonbondedUtilities.cpp
platforms/cuda/src/CudaNonbondedUtilities.cpp
+2
-3
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
+6
-7
No files found.
platforms/cuda/src/CudaNonbondedUtilities.cpp
View file @
61bb8786
...
...
@@ -90,7 +90,8 @@ void CudaNonbondedUtilities::addInteraction(bool usesCutoff, bool usesPeriodic,
useCutoff
=
usesCutoff
;
usePeriodic
=
usesPeriodic
;
cutoff
=
cutoffDistance
;
kernelSource
+=
kernel
+
"
\n
"
;
if
(
kernel
.
size
()
>
0
)
kernelSource
+=
kernel
+
"
\n
"
;
nonbondedForceGroup
=
forceGroup
;
}
...
...
@@ -124,8 +125,6 @@ void CudaNonbondedUtilities::requestExclusions(const vector<vector<int> >& exclu
}
void
CudaNonbondedUtilities
::
initialize
(
const
System
&
system
)
{
if
(
cutoff
==
-
1.0
)
return
;
// There are no nonbonded interactions in the System.
string
errorMessage
=
"Error initializing nonbonded utilities"
;
if
(
atomExclusions
.
size
()
==
0
)
{
// No exclusions were specifically requested, so just mark every atom as not interacting with itself.
...
...
platforms/opencl/src/OpenCLNonbondedUtilities.cpp
View file @
61bb8786
...
...
@@ -115,7 +115,8 @@ void OpenCLNonbondedUtilities::addInteraction(bool usesCutoff, bool usesPeriodic
useCutoff
=
usesCutoff
;
usePeriodic
=
usesPeriodic
;
cutoff
=
cutoffDistance
;
kernelSource
+=
kernel
+
"
\n
"
;
if
(
kernel
.
size
()
>
0
)
kernelSource
+=
kernel
+
"
\n
"
;
nonbondedForceGroup
=
forceGroup
;
}
...
...
@@ -149,9 +150,6 @@ void OpenCLNonbondedUtilities::requestExclusions(const vector<vector<int> >& exc
}
void
OpenCLNonbondedUtilities
::
initialize
(
const
System
&
system
)
{
if
(
cutoff
==
-
1.0
)
return
;
// There are no nonbonded interactions in the System.
if
(
atomExclusions
.
size
()
==
0
)
{
// No exclusions were specifically requested, so just mark every atom as not interacting with itself.
...
...
@@ -267,7 +265,8 @@ void OpenCLNonbondedUtilities::initialize(const System& system) {
// Create kernels.
forceKernel
=
createInteractionKernel
(
kernelSource
,
parameters
,
arguments
,
true
,
true
);
if
(
kernelSource
.
size
()
>
0
)
forceKernel
=
createInteractionKernel
(
kernelSource
,
parameters
,
arguments
,
true
,
true
);
if
(
useCutoff
)
{
map
<
string
,
string
>
defines
;
defines
[
"NUM_BLOCKS"
]
=
context
.
intToString
(
context
.
getNumAtomBlocks
());
...
...
@@ -364,7 +363,7 @@ void OpenCLNonbondedUtilities::prepareInteractions() {
}
void
OpenCLNonbondedUtilities
::
computeInteractions
()
{
if
(
cutoff
!=
-
1.
0
)
{
if
(
kernelSource
.
size
()
>
0
)
{
if
(
useCutoff
)
{
setPeriodicBoxSizeArg
(
context
,
forceKernel
,
10
);
setInvPeriodicBoxSizeArg
(
context
,
forceKernel
,
11
);
...
...
@@ -410,7 +409,7 @@ void OpenCLNonbondedUtilities::updateNeighborListSize() {
void
OpenCLNonbondedUtilities
::
setTileRange
(
int
startTileIndex
,
int
numTiles
)
{
this
->
startTileIndex
=
startTileIndex
;
this
->
numTiles
=
numTiles
;
if
(
cutoff
==
-
1.
0
)
if
(
kernelSource
.
size
()
==
0
)
return
;
// There are no nonbonded interactions in the System.
forceKernel
.
setArg
<
cl_uint
>
(
6
,
startTileIndex
);
forceKernel
.
setArg
<
cl_uint
>
(
7
,
startTileIndex
+
numTiles
);
...
...
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