Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
5fe26829
Unverified
Commit
5fe26829
authored
Nov 27, 2020
by
Richard Xue
Committed by
GitHub
Nov 27, 2020
Browse files
fix cuaev angular kernel when center atom pairs are more than 32 (#555)
parent
d2d63056
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
tests/test_cuaev.py
tests/test_cuaev.py
+12
-0
torchani/cuaev/aev.cu
torchani/cuaev/aev.cu
+1
-1
No files found.
tests/test_cuaev.py
View file @
5fe26829
...
...
@@ -94,6 +94,18 @@ class TestCUAEV(TestCase):
_
,
cu_aev
=
self
.
cuaev_computer
((
species
,
coordinates
))
self
.
assertEqual
(
cu_aev
,
aev
)
def
testVeryDenseMolecule
(
self
):
for
i
in
range
(
100
):
datafile
=
os
.
path
.
join
(
path
,
'test_data/tripeptide-md/{}.dat'
.
format
(
i
))
with
open
(
datafile
,
'rb'
)
as
f
:
coordinates
,
species
,
_
,
_
,
_
,
_
,
_
,
_
=
pickle
.
load
(
f
)
# change angstrom coordinates to 10 times smaller
coordinates
=
0.1
*
torch
.
from_numpy
(
coordinates
).
float
().
unsqueeze
(
0
).
to
(
self
.
device
)
species
=
torch
.
from_numpy
(
species
).
unsqueeze
(
0
).
to
(
self
.
device
)
_
,
aev
=
self
.
aev_computer
((
species
,
coordinates
))
_
,
cu_aev
=
self
.
cuaev_computer
((
species
,
coordinates
))
self
.
assertEqual
(
cu_aev
,
aev
,
atol
=
5e-5
,
rtol
=
5e-5
)
if
__name__
==
'__main__'
:
unittest
.
main
()
torchani/cuaev/aev.cu
View file @
5fe26829
...
...
@@ -209,7 +209,7 @@ __global__ void cuAngularAEVs(
theta
=
acos
(
0.95
*
(
sdx
[
jj
]
*
sdx
[
kk
]
+
sdy
[
jj
]
*
sdy
[
kk
]
+
sdz
[
jj
]
*
sdz
[
kk
])
/
(
Rij
*
Rik
));
}
for
(
int
srcLane
=
0
;
kk_start
+
srcLane
<
min
(
32
,
jnum
)
;
++
srcLane
)
{
for
(
int
srcLane
=
0
;
srcLane
<
32
&&
(
kk_start
+
srcLane
)
<
jnum
;
++
srcLane
)
{
int
kk
=
kk_start
+
srcLane
;
DataT
theta_ijk
=
__shfl_sync
(
0xFFFFFFFF
,
theta
,
srcLane
);
...
...
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