Skip to content

Commit 15e83e4

Browse files
fweigdavidrohr
authored andcommitted
TPC Cluster Finder: Fix invalid write during deconvolution.
1 parent f9b1d32 commit 15e83e4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ GPUdii() void GPUTPCCFDeconvolution::deconvolutionImpl(int nBlocks, int nThreads
5050
ushort partId = ll;
5151

5252
ushort in3x3 = 0;
53-
partId = CfUtils::partition<SCRATCH_PAD_WORK_GROUP_SIZE>(smem, ll, iamPeak, SCRATCH_PAD_WORK_GROUP_SIZE, &in3x3);
53+
bool exclude3x3 = iamPeak || !pos.valid();
54+
partId = CfUtils::partition<SCRATCH_PAD_WORK_GROUP_SIZE>(smem, ll, exclude3x3, SCRATCH_PAD_WORK_GROUP_SIZE, &in3x3);
5455

5556
if (partId < in3x3) {
5657
smem.posBcast1[partId] = pos;
@@ -74,7 +75,7 @@ GPUdii() void GPUTPCCFDeconvolution::deconvolutionImpl(int nBlocks, int nThreads
7475
}
7576

7677
ushort in5x5 = 0;
77-
partId = CfUtils::partition<SCRATCH_PAD_WORK_GROUP_SIZE>(smem, partId, peakCount > 0 && !iamPeak, in3x3, &in5x5);
78+
partId = CfUtils::partition<SCRATCH_PAD_WORK_GROUP_SIZE>(smem, partId, peakCount > 0 && !exclude3x3, in3x3, &in5x5);
7879

7980
if (partId < in5x5) {
8081
smem.posBcast1[partId] = pos;
@@ -99,7 +100,7 @@ GPUdii() void GPUTPCCFDeconvolution::deconvolutionImpl(int nBlocks, int nThreads
99100
peakCount *= -1;
100101
}
101102

102-
if (iamDummy) {
103+
if (iamDummy || !pos.valid()) {
103104
return;
104105
}
105106

0 commit comments

Comments
 (0)