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
92d5b696
Commit
92d5b696
authored
Jul 30, 2014
by
peastman
Browse files
Fix crash with empty interaction groups
parent
75f0401f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+2
-0
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+2
-0
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
92d5b696
...
@@ -2072,6 +2072,8 @@ void CudaCalcCustomNonbondedForceKernel::initInteractionGroups(const CustomNonbo
...
@@ -2072,6 +2072,8 @@ void CudaCalcCustomNonbondedForceKernel::initInteractionGroups(const CustomNonbo
// Find how many tiles we will create for this group.
// Find how many tiles we will create for this group.
int
tileWidth
=
min
(
min
(
32
,
(
int
)
atoms1
.
size
()),
(
int
)
atoms2
.
size
());
int
tileWidth
=
min
(
min
(
32
,
(
int
)
atoms1
.
size
()),
(
int
)
atoms2
.
size
());
if
(
tileWidth
==
0
)
continue
;
int
numBlocks1
=
(
atoms1
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks1
=
(
atoms1
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks2
=
(
atoms2
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks2
=
(
atoms2
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
92d5b696
...
@@ -2082,6 +2082,8 @@ void OpenCLCalcCustomNonbondedForceKernel::initInteractionGroups(const CustomNon
...
@@ -2082,6 +2082,8 @@ void OpenCLCalcCustomNonbondedForceKernel::initInteractionGroups(const CustomNon
// Find how many tiles we will create for this group.
// Find how many tiles we will create for this group.
int
tileWidth
=
min
(
min
(
32
,
(
int
)
atoms1
.
size
()),
(
int
)
atoms2
.
size
());
int
tileWidth
=
min
(
min
(
32
,
(
int
)
atoms1
.
size
()),
(
int
)
atoms2
.
size
());
if
(
tileWidth
==
0
)
continue
;
int
numBlocks1
=
(
atoms1
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks1
=
(
atoms1
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks2
=
(
atoms2
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
int
numBlocks2
=
(
atoms2
.
size
()
+
tileWidth
-
1
)
/
tileWidth
;
...
...
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