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
94d7225b
Unverified
Commit
94d7225b
authored
Sep 25, 2020
by
peastman
Committed by
GitHub
Sep 25, 2020
Browse files
Re-enabled single pair list (#2863)
parent
938afab0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
platforms/cuda/src/CudaNonbondedUtilities.cpp
platforms/cuda/src/CudaNonbondedUtilities.cpp
+1
-2
platforms/cuda/src/kernels/findInteractingBlocks.cu
platforms/cuda/src/kernels/findInteractingBlocks.cu
+9
-8
No files found.
platforms/cuda/src/CudaNonbondedUtilities.cpp
View file @
94d7225b
...
...
@@ -498,8 +498,7 @@ void CudaNonbondedUtilities::createKernelsForGroups(int groups) {
if
(
context
.
getBoxIsTriclinic
())
defines
[
"TRICLINIC"
]
=
"1"
;
defines
[
"MAX_EXCLUSIONS"
]
=
context
.
intToString
(
maxExclusions
);
// Temporarily disable the pair list until we figure out why it's failing on some GPUs.
defines
[
"MAX_BITS_FOR_PAIRS"
]
=
"0"
;
//(canUsePairList ? "2" : "0");
defines
[
"MAX_BITS_FOR_PAIRS"
]
=
(
canUsePairList
?
(
context
.
getComputeCapability
()
<
8.0
?
"2"
:
"4"
)
:
"0"
);
CUmodule
interactingBlocksProgram
=
context
.
createModule
(
CudaKernelSources
::
vectorOps
+
CudaKernelSources
::
findInteractingBlocks
,
defines
);
kernels
.
findBlockBoundsKernel
=
context
.
getKernel
(
interactingBlocksProgram
,
"findBlockBounds"
);
kernels
.
sortBoxDataKernel
=
context
.
getKernel
(
interactingBlocksProgram
,
"sortBoxData"
);
...
...
platforms/cuda/src/kernels/findInteractingBlocks.cu
View file @
94d7225b
...
...
@@ -85,15 +85,16 @@ __device__ int saveSinglePairs(int x, int* atoms, int* flags, int length, unsign
int
count
=
__popc
(
flags
[
i
]);
sum
+=
(
count
<=
MAX_BITS_FOR_PAIRS
?
count
:
0
);
}
sumBuffer
[
indexInWarp
]
=
sum
;
for
(
int
step
=
1
;
step
<
32
;
step
*=
2
)
{
i
nt
add
=
(
indexInWarp
>=
step
?
sumBuffer
[
indexInWarp
-
step
]
:
0
);
sumBuffer
[
indexInWarp
]
+=
add
;
for
(
int
i
=
1
;
i
<
32
;
i
*=
2
)
{
int
n
=
__shfl_up_sync
(
0xffffffff
,
sum
,
i
);
i
f
(
indexInWarp
>=
i
)
sum
+=
n
;
}
int
pairsToStore
=
sumBuffer
[
31
];
if
(
indexInWarp
==
0
)
pairStartIndex
=
atomicAdd
(
singlePairCount
,
pairsToStore
);
int
pairIndex
=
pairStartIndex
+
(
indexInWarp
>
0
?
sumBuffer
[
indexInWarp
-
1
]
:
0
);
if
(
indexInWarp
==
31
)
pairStartIndex
=
atomicAdd
(
singlePairCount
,(
unsigned
int
)
sum
);
__syncwarp
();
int
prevSum
=
__shfl_up_sync
(
0xffffffff
,
sum
,
1
);
int
pairIndex
=
pairStartIndex
+
(
indexInWarp
>
0
?
prevSum
:
0
);
for
(
int
i
=
indexInWarp
;
i
<
length
;
i
+=
32
)
{
int
count
=
__popc
(
flags
[
i
]);
if
(
count
<=
MAX_BITS_FOR_PAIRS
&&
pairIndex
+
count
<
maxSinglePairs
)
{
...
...
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