Skip to content

Commit 0ed462e

Browse files
authored
Merge pull request #36 from alibuild/alibot-cleanup-14657
Please consider the following formatting changes to #14657
2 parents 1bee99a + fe9b699 commit 0ed462e

File tree

2 files changed

+62
-62
lines changed

2 files changed

+62
-62
lines changed

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.cxx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ void* GPUTPCNNClusterizer::setIOPointers(void* mem)
6969
if (mNnClusterizerVerbosity > 2) {
7070
if (mNnClusterizerVerbosity > 3) {
7171
auto fmt = [](size_t bytes) {
72-
std::ostringstream os;
73-
double mb = bytes / (1024.0 * 1024.0);
74-
os << bytes << " bytes (" << std::fixed << std::setprecision(3) << mb << " MB)";
75-
return os.str();
72+
std::ostringstream os;
73+
double mb = bytes / (1024.0 * 1024.0);
74+
os << bytes << " bytes (" << std::fixed << std::setprecision(3) << mb << " MB)";
75+
return os.str();
7676
};
7777

7878
// Element counts (number of array entries, not bytes)
@@ -101,35 +101,35 @@ void* GPUTPCNNClusterizer::setIOPointers(void* mem)
101101

102102
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") Pointers set for clusterizer with memoryID " << mMemoryId << " deviceID " << mDeviceId << " and sector " << mISector;
103103
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mOutputDataClass pointer: " << mOutputDataClass
104-
<< " | elements=" << elemsOutputDataClass << " (= mNnClusterizerTotalClusters)"
105-
<< " | " << fmt(szOutputDataClass);
104+
<< " | elements=" << elemsOutputDataClass << " (= mNnClusterizerTotalClusters)"
105+
<< " | " << fmt(szOutputDataClass);
106106
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mClusterFlags pointer: " << static_cast<const void*>(mClusterFlags)
107-
<< " | elements=" << elemsClusterFlags << " (= 2 * mNnClusterizerBatchedMode)"
108-
<< " | " << fmt(szClusterFlags);
107+
<< " | elements=" << elemsClusterFlags << " (= 2 * mNnClusterizerBatchedMode)"
108+
<< " | " << fmt(szClusterFlags);
109109
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mInputData_16 pointer: " << mInputData_16
110-
<< " | elements=" << elemsInput16 << " (= mNnClusterizerBatchedMode * mNnClusterizerElementSize)"
111-
<< " | " << fmt(szInput16);
110+
<< " | elements=" << elemsInput16 << " (= mNnClusterizerBatchedMode * mNnClusterizerElementSize)"
111+
<< " | " << fmt(szInput16);
112112
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mModelProbabilities_16 pointer: " << mModelProbabilities_16
113-
<< " | elements=" << elemsProb16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelClassNumOutputNodes)"
114-
<< " | " << fmt(szProb16);
113+
<< " | elements=" << elemsProb16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelClassNumOutputNodes)"
114+
<< " | " << fmt(szProb16);
115115
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mOutputDataReg1_16 pointer: " << mOutputDataReg1_16
116-
<< " | elements=" << elemsReg1_16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg1NumOutputNodes)"
117-
<< " | " << fmt(szReg1_16);
116+
<< " | elements=" << elemsReg1_16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg1NumOutputNodes)"
117+
<< " | " << fmt(szReg1_16);
118118
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mOutputDataReg2_16 pointer: " << mOutputDataReg2_16
119-
<< " | elements=" << elemsReg2_16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg2NumOutputNodes)"
120-
<< " | " << fmt(szReg2_16);
119+
<< " | elements=" << elemsReg2_16 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg2NumOutputNodes)"
120+
<< " | " << fmt(szReg2_16);
121121
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mInputData_32 pointer: " << mInputData_32
122-
<< " | elements=" << elemsInput32 << " (= mNnClusterizerBatchedMode * mNnClusterizerElementSize)"
123-
<< " | " << fmt(szInput32);
122+
<< " | elements=" << elemsInput32 << " (= mNnClusterizerBatchedMode * mNnClusterizerElementSize)"
123+
<< " | " << fmt(szInput32);
124124
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mModelProbabilities_32 pointer: " << mModelProbabilities_32
125-
<< " | elements=" << elemsProb32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelClassNumOutputNodes)"
126-
<< " | " << fmt(szProb32);
125+
<< " | elements=" << elemsProb32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelClassNumOutputNodes)"
126+
<< " | " << fmt(szProb32);
127127
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mOutputDataReg1_32 pointer: " << mOutputDataReg1_32
128-
<< " | elements=" << elemsReg1_32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg1NumOutputNodes)"
129-
<< " | " << fmt(szReg1_32);
128+
<< " | elements=" << elemsReg1_32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg1NumOutputNodes)"
129+
<< " | " << fmt(szReg1_32);
130130
LOG(info) << "(NNCLUS, GPUTPCNNClusterizer, this=" << this << ") mOutputDataReg2_32 pointer: " << mOutputDataReg2_32
131-
<< " | elements=" << elemsReg2_32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg2NumOutputNodes)"
132-
<< " | " << fmt(szReg2_32);
131+
<< " | elements=" << elemsReg2_32 << " (= mNnClusterizerBatchedMode * mNnClusterizerModelReg2NumOutputNodes)"
132+
<< " | " << fmt(szReg2_32);
133133
}
134134
// Compute allocated bytes (difference between advanced pointer and start pointer)
135135
size_t allocatedBytes = static_cast<size_t>(reinterpret_cast<uintptr_t>(mem) - reinterpret_cast<uintptr_t>(startMem));

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerKernels.cxx

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::det
275275
if (glo_idx + batchStart >= clusterer.mPmemory->counters.nClusters || glo_idx >= clustererNN.mNnClusterizerBatchedMode) {
276276
return;
277277
}
278-
if(clustererNN.mNnClusterizerUseClassification) {
278+
if (clustererNN.mNnClusterizerUseClassification) {
279279
if (dtype == 0) {
280280
clustererNN.mOutputDataClass[glo_idx + batchStart] = (int32_t)((clustererNN.mModelProbabilities_16[glo_idx]).ToFloat() > clustererNN.mNnClassThreshold);
281281
} else if (dtype == 1) {
@@ -295,7 +295,7 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::det
295295
if (glo_idx + batchStart >= clusterer.mPmemory->counters.nClusters || glo_idx >= clustererNN.mNnClusterizerBatchedMode) {
296296
return;
297297
}
298-
if(clustererNN.mNnClusterizerUseClassification) {
298+
if (clustererNN.mNnClusterizerUseClassification) {
299299
uint32_t elem_iterator = glo_idx * clustererNN.mNnClusterizerModelClassNumOutputNodes;
300300
float current_max_prob = 0.f; // If the neural network doesn't contain the softmax as a last layer, the outputs can range in [-infty, infty]
301301
uint32_t class_label = 0;
@@ -401,20 +401,20 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::pub
401401

402402
if (dtype == 0) {
403403
pc.setFull(central_charge * clustererNN.mOutputDataReg1_16[model_output_index + 4].ToFloat(),
404-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg1_16[model_output_index].ToFloat(),
405-
notSinglePad ? clustererNN.mOutputDataReg1_16[model_output_index + 2].ToFloat() : 0.f,
406-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg1_16[model_output_index + 1].ToFloat(),
407-
notSingleTime ? clustererNN.mOutputDataReg1_16[model_output_index + 3].ToFloat() : 0.f,
408-
clustererNN.mClusterFlags[2 * glo_idx],
409-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
404+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg1_16[model_output_index].ToFloat(),
405+
notSinglePad ? clustererNN.mOutputDataReg1_16[model_output_index + 2].ToFloat() : 0.f,
406+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg1_16[model_output_index + 1].ToFloat(),
407+
notSingleTime ? clustererNN.mOutputDataReg1_16[model_output_index + 3].ToFloat() : 0.f,
408+
clustererNN.mClusterFlags[2 * glo_idx],
409+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
410410
} else if (dtype == 1) {
411411
pc.setFull(central_charge * clustererNN.mOutputDataReg1_32[model_output_index + 4],
412-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg1_32[model_output_index],
413-
notSinglePad ? clustererNN.mOutputDataReg1_32[model_output_index + 2] : 0.f,
414-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg1_32[model_output_index + 1],
415-
notSingleTime ? clustererNN.mOutputDataReg1_32[model_output_index + 3] : 0.f,
416-
clustererNN.mClusterFlags[2 * glo_idx],
417-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
412+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg1_32[model_output_index],
413+
notSinglePad ? clustererNN.mOutputDataReg1_32[model_output_index + 2] : 0.f,
414+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg1_32[model_output_index + 1],
415+
notSingleTime ? clustererNN.mOutputDataReg1_32[model_output_index + 3] : 0.f,
416+
clustererNN.mClusterFlags[2 * glo_idx],
417+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
418418
}
419419

420420
tpc::ClusterNative myCluster;
@@ -511,20 +511,20 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::pub
511511
// Cluster 1
512512
if (dtype == 0) {
513513
pc.setFull(central_charge * clustererNN.mOutputDataReg2_16[model_output_index + 8].ToFloat(),
514-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_16[model_output_index].ToFloat(),
515-
clustererNN.mOutputDataReg2_16[model_output_index + 4].ToFloat(),
516-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_16[model_output_index + 2].ToFloat(),
517-
clustererNN.mOutputDataReg2_16[model_output_index + 6].ToFloat(),
518-
clustererNN.mClusterFlags[2 * glo_idx],
519-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
514+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_16[model_output_index].ToFloat(),
515+
clustererNN.mOutputDataReg2_16[model_output_index + 4].ToFloat(),
516+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_16[model_output_index + 2].ToFloat(),
517+
clustererNN.mOutputDataReg2_16[model_output_index + 6].ToFloat(),
518+
clustererNN.mClusterFlags[2 * glo_idx],
519+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
520520
} else if (dtype == 1) {
521521
pc.setFull(central_charge * clustererNN.mOutputDataReg2_32[model_output_index + 8],
522-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index],
523-
clustererNN.mOutputDataReg2_32[model_output_index + 4],
524-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 2],
525-
clustererNN.mOutputDataReg2_32[model_output_index + 6],
526-
clustererNN.mClusterFlags[2 * glo_idx],
527-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
522+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index],
523+
clustererNN.mOutputDataReg2_32[model_output_index + 4],
524+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 2],
525+
clustererNN.mOutputDataReg2_32[model_output_index + 6],
526+
clustererNN.mClusterFlags[2 * glo_idx],
527+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
528528
}
529529

530530
tpc::ClusterNative myCluster;
@@ -559,20 +559,20 @@ GPUdii() void GPUTPCNNClusterizerKernels::Thread<GPUTPCNNClusterizerKernels::pub
559559
// Cluster 2
560560
if (dtype == 0) {
561561
pc.setFull(central_charge * clustererNN.mOutputDataReg2_16[model_output_index + 9].ToFloat(),
562-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_16[model_output_index + 1].ToFloat(),
563-
clustererNN.mOutputDataReg2_16[model_output_index + 5].ToFloat(),
564-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_16[model_output_index + 3].ToFloat(),
565-
clustererNN.mOutputDataReg2_16[model_output_index + 7].ToFloat(),
566-
clustererNN.mClusterFlags[2 * glo_idx],
567-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
562+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_16[model_output_index + 1].ToFloat(),
563+
clustererNN.mOutputDataReg2_16[model_output_index + 5].ToFloat(),
564+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_16[model_output_index + 3].ToFloat(),
565+
clustererNN.mOutputDataReg2_16[model_output_index + 7].ToFloat(),
566+
clustererNN.mClusterFlags[2 * glo_idx],
567+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
568568
} else if (dtype == 1) {
569569
pc.setFull(central_charge * clustererNN.mOutputDataReg2_32[model_output_index + 9],
570-
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index + 1],
571-
clustererNN.mOutputDataReg2_32[model_output_index + 5],
572-
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 3],
573-
clustererNN.mOutputDataReg2_32[model_output_index + 7],
574-
clustererNN.mClusterFlags[2 * glo_idx],
575-
clustererNN.mClusterFlags[2 * glo_idx + 1]);
570+
static_cast<float>(peak.pad()) + clustererNN.mOutputDataReg2_32[model_output_index + 1],
571+
clustererNN.mOutputDataReg2_32[model_output_index + 5],
572+
(clusterer.mPmemory->fragment).start + static_cast<float>(peak.time()) + clustererNN.mOutputDataReg2_32[model_output_index + 3],
573+
clustererNN.mOutputDataReg2_32[model_output_index + 7],
574+
clustererNN.mClusterFlags[2 * glo_idx],
575+
clustererNN.mClusterFlags[2 * glo_idx + 1]);
576576
}
577577

578578
rejectCluster = !pc.toNative(peak, central_charge, myCluster, clusterer.Param(), chargeMap);

0 commit comments

Comments
 (0)