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
3cabfb9c
Commit
3cabfb9c
authored
Jan 21, 2013
by
Peter Eastman
Browse files
Changes to AMOEBA to better match Tinker
parent
8fc1d49f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
+23
-3
No files found.
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
View file @
3cabfb9c
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include "CudaKernelSources.h"
#include "CudaKernelSources.h"
#include "CudaNonbondedUtilities.h"
#include "CudaNonbondedUtilities.h"
#include <algorithm>
#include <cmath>
#include <cmath>
#ifdef _MSC_VER
#ifdef _MSC_VER
#include <windows.h>
#include <windows.h>
...
@@ -976,8 +977,15 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
...
@@ -976,8 +977,15 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
force
.
getCovalentMap
(
i
,
AmoebaMultipoleForce
::
PolarizationCovalent11
,
atoms
);
force
.
getCovalentMap
(
i
,
AmoebaMultipoleForce
::
PolarizationCovalent11
,
atoms
);
allAtoms
.
insert
(
atoms
.
begin
(),
atoms
.
end
());
allAtoms
.
insert
(
atoms
.
begin
(),
atoms
.
end
());
exclusions
[
i
].
insert
(
exclusions
[
i
].
end
(),
allAtoms
.
begin
(),
allAtoms
.
end
());
exclusions
[
i
].
insert
(
exclusions
[
i
].
end
(),
allAtoms
.
begin
(),
allAtoms
.
end
());
// Workaround for bug in TINKER: if an atom is listed in both the PolarizationCovalent11
// and PolarizationCovalent12 maps, the latter takes precedence.
vector
<
int
>
atoms12
;
force
.
getCovalentMap
(
i
,
AmoebaMultipoleForce
::
PolarizationCovalent12
,
atoms12
);
for
(
int
j
=
0
;
j
<
(
int
)
atoms
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
atoms
.
size
();
j
++
)
polarizationFlagValues
.
push_back
(
make_int2
(
i
,
atoms
[
j
]));
if
(
find
(
atoms12
.
begin
(),
atoms12
.
end
(),
atoms
[
j
])
==
atoms12
.
end
())
polarizationFlagValues
.
push_back
(
make_int2
(
i
,
atoms
[
j
]));
}
}
// Record other options.
// Record other options.
...
@@ -1281,7 +1289,14 @@ void CudaCalcAmoebaMultipoleForceKernel::initializeScaleFactors() {
...
@@ -1281,7 +1289,14 @@ void CudaCalcAmoebaMultipoleForceKernel::initializeScaleFactors() {
int
offset2
=
atom2
-
y
*
CudaContext
::
TileSize
;
int
offset2
=
atom2
-
y
*
CudaContext
::
TileSize
;
int
f1
=
(
value
==
0
||
value
==
1
?
1
:
0
);
int
f1
=
(
value
==
0
||
value
==
1
?
1
:
0
);
int
f2
=
(
value
==
0
||
value
==
2
?
1
:
0
);
int
f2
=
(
value
==
0
||
value
==
2
?
1
:
0
);
if
(
x
>
y
)
{
if
(
x
==
y
)
{
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
covalentFlagsVec
[
index
+
offset1
].
x
|=
f1
<<
offset2
;
covalentFlagsVec
[
index
+
offset1
].
y
|=
f2
<<
offset2
;
covalentFlagsVec
[
index
+
offset2
].
x
|=
f1
<<
offset1
;
covalentFlagsVec
[
index
+
offset2
].
y
|=
f2
<<
offset1
;
}
else
if
(
x
>
y
)
{
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
covalentFlagsVec
[
index
+
offset1
].
x
|=
f1
<<
offset2
;
covalentFlagsVec
[
index
+
offset1
].
x
|=
f1
<<
offset2
;
covalentFlagsVec
[
index
+
offset1
].
y
|=
f2
<<
offset2
;
covalentFlagsVec
[
index
+
offset1
].
y
|=
f2
<<
offset2
;
...
@@ -1305,7 +1320,12 @@ void CudaCalcAmoebaMultipoleForceKernel::initializeScaleFactors() {
...
@@ -1305,7 +1320,12 @@ void CudaCalcAmoebaMultipoleForceKernel::initializeScaleFactors() {
int
offset1
=
atom1
-
x
*
CudaContext
::
TileSize
;
int
offset1
=
atom1
-
x
*
CudaContext
::
TileSize
;
int
y
=
atom2
/
CudaContext
::
TileSize
;
int
y
=
atom2
/
CudaContext
::
TileSize
;
int
offset2
=
atom2
-
y
*
CudaContext
::
TileSize
;
int
offset2
=
atom2
-
y
*
CudaContext
::
TileSize
;
if
(
x
>
y
)
{
if
(
x
==
y
)
{
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
polarizationGroupFlagsVec
[
index
+
offset1
]
|=
1
<<
offset2
;
polarizationGroupFlagsVec
[
index
+
offset2
]
|=
1
<<
offset1
;
}
else
if
(
x
>
y
)
{
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
int
index
=
CudaNonbondedUtilities
::
findExclusionIndex
(
x
,
y
,
exclusionIndices
,
exclusionRowIndices
);
polarizationGroupFlagsVec
[
index
+
offset1
]
|=
1
<<
offset2
;
polarizationGroupFlagsVec
[
index
+
offset1
]
|=
1
<<
offset2
;
}
}
...
...
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