Skip to content

Commit 560f77f

Browse files
authored
Merge pull request #27 from alibuild/alibot-cleanup-14510
Please consider the following formatting changes to #14510
2 parents fdf6ef8 + 7604fab commit 560f77f

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerHost.cxx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ void GPUTPCNNClusterizerHost::initClusterizer(const GPUSettingsProcessingNNclust
9393
clustererNN.mNnClusterizerElementSize = clustererNN.mNnClusterizerChargeArraySize + (settings.nnClusterizerAddIndexData ? 3 : 0);
9494
clustererNN.mBoundaryMapSizeRow = 3 * clustererNN.mNnClusterizerSizeInputRow + o2::tpc::constants::MAXGLOBALPADROW;
9595
clustererNN.mBoundaryPadding = 11; // padding on each side to account for pad_offset. N=11 since then mIsBoundary = 24320 ~< (1.5 x 2^14 = 24576) && N must be bigger than (NPads[row(end_iroc + 1)] - NPads[row(end_iroc)])/2 (=6) for pad_offset to work
96-
clustererNN.mBoundaryMapSizePadsPerRow = GPUTPCGeometry::NPads(o2::tpc::constants::MAXGLOBALPADROW) + 2*clustererNN.mBoundaryPadding;
97-
clustererNN.mBoundaryMapSize = clustererNN.mBoundaryMapSizeRow*clustererNN.mBoundaryMapSizePadsPerRow;
98-
clustererNN.mIndexLookupSize = 3*clustererNN.mNnClusterizerChargeArraySize; // local row, pad, time shift from flat index
96+
clustererNN.mBoundaryMapSizePadsPerRow = GPUTPCGeometry::NPads(o2::tpc::constants::MAXGLOBALPADROW) + 2 * clustererNN.mBoundaryPadding;
97+
clustererNN.mBoundaryMapSize = clustererNN.mBoundaryMapSizeRow * clustererNN.mBoundaryMapSizePadsPerRow;
98+
clustererNN.mIndexLookupSize = 3 * clustererNN.mNnClusterizerChargeArraySize; // local row, pad, time shift from flat index
9999
clustererNN.mNnClusterizerAddIndexData = settings.nnClusterizerAddIndexData;
100100
clustererNN.mNnClusterizerBatchedMode = settings.nnClusterizerBatchedMode;
101101
clustererNN.mNnClusterizerBoundaryFillValue = settings.nnClusterizerBoundaryFillValue;
@@ -124,34 +124,36 @@ void GPUTPCNNClusterizerHost::initClusterizer(const GPUSettingsProcessingNNclust
124124
}
125125
}
126126

127-
void GPUTPCNNClusterizerHost::createBoundary(GPUTPCNNClusterizer& clustererNN) {
127+
void GPUTPCNNClusterizerHost::createBoundary(GPUTPCNNClusterizer& clustererNN)
128+
{
128129
// Call after init of the clustererNN elements
129-
for(int r = 0; r < clustererNN.mBoundaryMapSizeRow; r++) {
130+
for (int r = 0; r < clustererNN.mBoundaryMapSizeRow; r++) {
130131
int8_t skipCheckInRow = 0;
131132
for (int p = 0; p < clustererNN.mBoundaryMapSizePadsPerRow; p++) {
132133
int32_t i = r * clustererNN.mBoundaryMapSizePadsPerRow + p;
133134
clustererNN.mIsBoundary[i] = 1;
134135
if (!skipCheckInRow && (p >= clustererNN.mBoundaryPadding || r >= clustererNN.mNnClusterizerSizeInputRow)) {
135136
if (r < (GPUTPCGeometry::EndIROC() + clustererNN.mNnClusterizerSizeInputRow)) {
136137
clustererNN.mIsBoundary[i] = (int32_t)((p - clustererNN.mBoundaryPadding) >= static_cast<int>(GPUTPCGeometry::NPads(r - clustererNN.mNnClusterizerSizeInputRow)));
137-
} else if (r >= (GPUTPCGeometry::EndIROC() + 2*clustererNN.mNnClusterizerSizeInputRow) && r < (o2::tpc::constants::MAXGLOBALPADROW + 2*clustererNN.mNnClusterizerSizeInputRow)) {
138-
clustererNN.mIsBoundary[i] = (int32_t)((p - clustererNN.mBoundaryPadding) >= static_cast<int>(GPUTPCGeometry::NPads(r - 2*clustererNN.mNnClusterizerSizeInputRow)));
138+
} else if (r >= (GPUTPCGeometry::EndIROC() + 2 * clustererNN.mNnClusterizerSizeInputRow) && r < (o2::tpc::constants::MAXGLOBALPADROW + 2 * clustererNN.mNnClusterizerSizeInputRow)) {
139+
clustererNN.mIsBoundary[i] = (int32_t)((p - clustererNN.mBoundaryPadding) >= static_cast<int>(GPUTPCGeometry::NPads(r - 2 * clustererNN.mNnClusterizerSizeInputRow)));
139140
}
140141
skipCheckInRow = (clustererNN.mIsBoundary[i] == 1); // No need to check further pads in this row
141142
}
142143
}
143144
}
144145
}
145146

146-
void GPUTPCNNClusterizerHost::createIndexLookup(GPUTPCNNClusterizer& clustererNN) {
147-
for(int32_t i = 0; i < clustererNN.mNnClusterizerChargeArraySize; i++){
147+
void GPUTPCNNClusterizerHost::createIndexLookup(GPUTPCNNClusterizer& clustererNN)
148+
{
149+
for (int32_t i = 0; i < clustererNN.mNnClusterizerChargeArraySize; i++) {
148150
int32_t r = CAMath::Floor(i / ((2 * clustererNN.mNnClusterizerSizeInputPad + 1) * (2 * clustererNN.mNnClusterizerSizeInputTime + 1))) - clustererNN.mNnClusterizerSizeInputRow;
149151
int32_t rest_1 = i % ((2 * clustererNN.mNnClusterizerSizeInputPad + 1) * (2 * clustererNN.mNnClusterizerSizeInputTime + 1));
150152
int32_t p = CAMath::Floor(rest_1 / (2 * clustererNN.mNnClusterizerSizeInputTime + 1)) - clustererNN.mNnClusterizerSizeInputPad;
151153
int32_t t = (rest_1 % (2 * clustererNN.mNnClusterizerSizeInputTime + 1)) - clustererNN.mNnClusterizerSizeInputTime;
152-
clustererNN.mIndexLookup[3*i] = r;
153-
clustererNN.mIndexLookup[3*i + 1] = p;
154-
clustererNN.mIndexLookup[3*i + 2] = t;
154+
clustererNN.mIndexLookup[3 * i] = r;
155+
clustererNN.mIndexLookup[3 * i + 1] = p;
156+
clustererNN.mIndexLookup[3 * i + 2] = t;
155157
}
156158
}
157159

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::fil
7575
int32_t isBoundaryIndex = (row_pos + row_offset + clustererNN.mNnClusterizerSizeInputRow) * clustererNN.mBoundaryMapSizePadsPerRow + pad_pos + clustererNN.mBoundaryPadding;
7676
if (!clustererNN.mIsBoundary[isBoundaryIndex] && (time_pos >= 0) && (time_pos < TPC_MAX_FRAGMENT_LEN_GPU)) {
7777
CfChargePos tmp_pos(row_pos, pad_pos, time_pos);
78-
if (!clustererNN.mNnClusterizerSetDeconvolutionFlags) { // Only if deconvolution flags are not set
78+
if (!clustererNN.mNnClusterizerSetDeconvolutionFlags) { // Only if deconvolution flags are not set
7979
if (r == 0 && !clustererNN.mClusterFlags[2 * glo_idx] && CAMath::Abs(p) < 3 && CAMath::Abs(t) < 3 && p != 0 && t != 0) { // ordering is done for short circuit optimization
8080
clustererNN.mClusterFlags[2 * glo_idx] += CfUtils::isPeak(isPeakMap[tmp_pos]);
8181
clustererNN.mClusterFlags[2 * glo_idx + 1] = clustererNN.mClusterFlags[2 * glo_idx];
@@ -162,7 +162,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::fil
162162
}
163163
} else if ((int32_t)transient_index < clustererNN.mNnClusterizerChargeArraySize) {
164164
int32_t time = static_cast<int>(peak.time());
165-
int32_t idxLookup = 3*transient_index;
165+
int32_t idxLookup = 3 * transient_index;
166166
int32_t r = clustererNN.mIndexLookup[idxLookup] + row, p = clustererNN.mIndexLookup[idxLookup + 1] + pad, t = clustererNN.mIndexLookup[idxLookup + 2] + time;
167167
int32_t row_offset = GPUTPCNNClusterizerKernels::rowOffset(row, clustererNN.mNnClusterizerSizeInputRow);
168168
int32_t pad_offset = GPUTPCNNClusterizerKernels::padOffset(row, r);
@@ -501,7 +501,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::pub
501501
// THe following arithmetic is done because the network is trained with a split between IROC and OROC boundary
502502
GPUd() int32_t GPUTPCNNClusterizerKernels::padOffset(int32_t row_ref, int32_t row_current)
503503
{
504-
if(row_current < 0 || row_current > o2::tpc::constants::MAXGLOBALPADROW) {
504+
if (row_current < 0 || row_current > o2::tpc::constants::MAXGLOBALPADROW) {
505505
return 0; // Short-circuit for negative rows
506506
} else {
507507
return (int)((GPUTPCGeometry::NPads(row_current) - GPUTPCGeometry::NPads(row_ref)) / 2);

0 commit comments

Comments
 (0)