Skip to content

Commit b23c6d0

Browse files
authored
Merge pull request #34386 from VinInn/fenceforampere
enforce memory order to avoid crash on Ampere
2 parents b44af67 + f5c01ea commit b23c6d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

RecoPixelVertexing/PixelTriplets/plugins/GPUCACell.h

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class GPUCACell {
6969
auto i = cellNeighbors.extend(); // maybe wasted....
7070
if (i > 0) {
7171
cellNeighbors[i].reset();
72+
__threadfence();
7273
#ifdef __CUDACC__
7374
auto zero = (PtrAsInt)(&cellNeighbors[0]);
7475
atomicCAS((PtrAsInt*)(&theOuterNeighbors),
@@ -89,6 +90,7 @@ class GPUCACell {
8990
auto i = cellTracks.extend(); // maybe wasted....
9091
if (i > 0) {
9192
cellTracks[i].reset();
93+
__threadfence();
9294
#ifdef __CUDACC__
9395
auto zero = (PtrAsInt)(&cellTracks[0]);
9496
atomicCAS((PtrAsInt*)(&theTracks), zero, (PtrAsInt)(&cellTracks[i])); // if fails we cannot give "i" back...

0 commit comments

Comments
 (0)