Skip to content

Commit

Permalink
GPU TPC: Fix parallel linking of global tracks to local tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Feb 26, 2024
1 parent 2d17052 commit b162f2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ GPUd() void GPUTPCGMMerger::LinkGlobalTracks(int nBlocks, int nThreads, int iBlo
for (int itr = SliceTrackInfoGlobalFirst(0) + iBlock * nThreads + iThread; itr < SliceTrackInfoGlobalLast(NSLICES - 1); itr += nThreads * nBlocks) {
GPUTPCGMSliceTrack& globalTrack = mSliceTrackInfos[itr];
GPUTPCGMSliceTrack& localTrack = mSliceTrackInfos[globalTrack.LocalTrackId()];
localTrack.SetGlobalTrackId(localTrack.GlobalTrackId(0) != -1, itr); // Todo: broken in parallel
if (localTrack.GlobalTrackId(0) != -1 || !CAMath::AtomicCAS(&localTrack.GlobalTrackIds()[0], -1, itr)) {
localTrack.SetGlobalTrackId(1, itr);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class GPUTPCGMSliceTrack
GPUd() void SetLocalTrackId(int v) { mLocalTrackId = v; }
GPUd() int GlobalTrackId(int n) const { return mGlobalTrackIds[n]; }
GPUd() void SetGlobalTrackId(int n, int v) { mGlobalTrackIds[n] = v; }
GPUd() int* GlobalTrackIds() { return mGlobalTrackIds; }

GPUd() float MaxClusterZT() const { return CAMath::Max(mClusterZT[0], mClusterZT[1]); }
GPUd() float MinClusterZT() const { return CAMath::Min(mClusterZT[0], mClusterZT[1]); }
Expand Down

0 comments on commit b162f2e

Please sign in to comment.