Skip to content

Commit

Permalink
Backport: enforce memory order to avoid crash on Ampere (cms-sw#34386)
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn authored and fwyzard committed Aug 6, 2021
1 parent b86942b commit f397769
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RecoPixelVertexing/PixelTriplets/plugins/GPUCACell.h
Expand Up @@ -69,6 +69,7 @@ class GPUCACell {
auto i = cellNeighbors.extend(); // maybe waisted....
if (i > 0) {
cellNeighbors[i].reset();
__threadfence();
#ifdef __CUDACC__
auto zero = (ptrAsInt)(&cellNeighbors[0]);
atomicCAS((ptrAsInt*)(&theOuterNeighbors),
Expand All @@ -89,6 +90,7 @@ class GPUCACell {
auto i = cellTracks.extend(); // maybe waisted....
if (i > 0) {
cellTracks[i].reset();
__threadfence();
#ifdef __CUDACC__
auto zero = (ptrAsInt)(&cellTracks[0]);
atomicCAS((ptrAsInt*)(&theTracks), zero, (ptrAsInt)(&cellTracks[i])); // if fails we cannot give "i" back...
Expand Down

0 comments on commit f397769

Please sign in to comment.