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
ae5bc677
Unverified
Commit
ae5bc677
authored
Jul 21, 2023
by
Peter Eastman
Committed by
GitHub
Jul 21, 2023
Browse files
Fixed numeric overflow in computing interaction groups (#4148)
parent
dd07fa70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
platforms/common/src/kernels/customNonbondedGroups.cc
platforms/common/src/kernels/customNonbondedGroups.cc
+5
-4
No files found.
platforms/common/src/kernels/customNonbondedGroups.cc
View file @
ae5bc677
...
...
@@ -50,8 +50,9 @@ KERNEL void computeInteractionGroups(
LOCAL
AtomData
localData
[
LOCAL_MEMORY_SIZE
];
LOCAL
int
reductionBuffer
[
LOCAL_MEMORY_SIZE
];
const
unsigned
int
startTile
=
(
useNeighborList
?
warp
*
numGroupTiles
[
0
]
/
totalWarps
:
FIRST_TILE
+
warp
*
(
LAST_TILE
-
FIRST_TILE
)
/
totalWarps
);
const
unsigned
int
endTile
=
(
useNeighborList
?
(
warp
+
1
)
*
numGroupTiles
[
0
]
/
totalWarps
:
FIRST_TILE
+
(
warp
+
1
)
*
(
LAST_TILE
-
FIRST_TILE
)
/
totalWarps
);
mm_ulong
wl
=
warp
;
const
unsigned
int
startTile
=
(
unsigned
int
)
(
useNeighborList
?
wl
*
numGroupTiles
[
0
]
/
totalWarps
:
FIRST_TILE
+
wl
*
(
LAST_TILE
-
FIRST_TILE
)
/
totalWarps
);
const
unsigned
int
endTile
=
(
unsigned
int
)
(
useNeighborList
?
(
wl
+
1
)
*
numGroupTiles
[
0
]
/
totalWarps
:
FIRST_TILE
+
(
wl
+
1
)
*
(
LAST_TILE
-
FIRST_TILE
)
/
totalWarps
);
for
(
int
tile
=
startTile
;
tile
<
endTile
;
tile
++
)
{
const
int4
atomData
=
groupData
[
TILE_SIZE
*
tile
+
tgx
];
const
int
atom1
=
atomData
.
x
;
...
...
@@ -155,8 +156,8 @@ KERNEL void buildNeighborList(GLOBAL int* RESTRICT rebuildNeighborList, GLOBAL i
LOCAL
volatile
int
tileIndex
[
WARPS_IN_BLOCK
];
LOCAL
int
reductionBuffer
[
LOCAL_MEMORY_SIZE
];
const
unsigned
int
startTile
=
warp
*
NUM_TILES
/
totalWarps
;
const
unsigned
int
endTile
=
(
warp
+
1
)
*
NUM_TILES
/
totalWarps
;
const
unsigned
int
startTile
=
(
unsigned
int
)
(
warp
*
(
mm_ulong
)
NUM_TILES
/
totalWarps
)
;
const
unsigned
int
endTile
=
(
unsigned
int
)
((
warp
+
1
)
*
(
mm_ulong
)
NUM_TILES
/
totalWarps
)
;
for
(
int
tile
=
startTile
;
tile
<
endTile
;
tile
++
)
{
const
int4
atomData
=
groupData
[
TILE_SIZE
*
tile
+
tgx
];
const
int
atom1
=
atomData
.
x
;
...
...
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