Skip to content

Commit b687967

Browse files
committed
Adjusting for comments
1 parent bca1014 commit b687967

File tree

7 files changed

+70
-91
lines changed

7 files changed

+70
-91
lines changed

GPU/GPUTracking/CMakeLists.txt

Lines changed: 36 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -161,69 +161,40 @@ set(HDRS_INSTALL
161161

162162
set(SRCS_NO_CINT ${SRCS_NO_CINT} display/GPUDisplayInterface.cxx)
163163

164+
set(SRCS_NO_CINT ${SRCS_NO_CINT}
165+
Global/GPUChainITS.cxx
166+
ITS/GPUITSFitter.cxx
167+
ITS/GPUITSFitterKernels.cxx
168+
dEdx/GPUdEdx.cxx
169+
TPCConvert/GPUTPCConvert.cxx
170+
TPCConvert/GPUTPCConvertKernel.cxx
171+
DataCompression/GPUTPCCompression.cxx
172+
DataCompression/GPUTPCCompressionTrackModel.cxx
173+
DataCompression/GPUTPCCompressionKernels.cxx
174+
DataCompression/GPUTPCDecompression.cxx
175+
DataCompression/GPUTPCDecompressionKernels.cxx
176+
DataCompression/TPCClusterDecompressor.cxx
177+
DataCompression/GPUTPCClusterStatistics.cxx
178+
TPCClusterFinder/GPUTPCClusterFinder.cxx
179+
TPCClusterFinder/ClusterAccumulator.cxx
180+
TPCClusterFinder/MCLabelAccumulator.cxx
181+
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
182+
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
183+
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
184+
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
185+
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
186+
TPCClusterFinder/GPUTPCCFClusterizer.cxx
187+
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
188+
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
189+
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
190+
TPCClusterFinder/GPUTPCCFGather.cxx
191+
Refit/GPUTrackingRefit.cxx
192+
Refit/GPUTrackingRefitKernel.cxx
193+
Merger/GPUTPCGMO2Output.cxx)
194+
164195
if(NOT ALIGPU_BUILD_TYPE STREQUAL "Standalone")
165-
set(SRCS_NO_CINT ${SRCS_NO_CINT}
166-
Global/GPUChainITS.cxx
167-
ITS/GPUITSFitter.cxx
168-
ITS/GPUITSFitterKernels.cxx
169-
dEdx/GPUdEdx.cxx
170-
TPCConvert/GPUTPCConvert.cxx
171-
TPCConvert/GPUTPCConvertKernel.cxx
172-
DataCompression/GPUTPCCompression.cxx
173-
DataCompression/GPUTPCCompressionTrackModel.cxx
174-
DataCompression/GPUTPCCompressionKernels.cxx
175-
DataCompression/GPUTPCDecompression.cxx
176-
DataCompression/GPUTPCDecompressionKernels.cxx
177-
DataCompression/TPCClusterDecompressor.cxx
178-
DataCompression/GPUTPCClusterStatistics.cxx
179-
TPCClusterFinder/GPUTPCClusterFinder.cxx
180-
TPCClusterFinder/ClusterAccumulator.cxx
181-
TPCClusterFinder/MCLabelAccumulator.cxx
182-
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
183-
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
184-
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
185-
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
186-
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
187-
TPCClusterFinder/GPUTPCCFClusterizer.cxx
188-
TPCClusterFinder/GPUTPCNNClusterizer.cxx
189-
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
190-
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
191-
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
192-
TPCClusterFinder/GPUTPCCFGather.cxx
193-
Refit/GPUTrackingRefit.cxx
194-
Refit/GPUTrackingRefitKernel.cxx
195-
Merger/GPUTPCGMO2Output.cxx)
196-
else()
197-
set(SRCS_NO_CINT ${SRCS_NO_CINT}
198-
Global/GPUChainITS.cxx
199-
ITS/GPUITSFitter.cxx
200-
ITS/GPUITSFitterKernels.cxx
201-
dEdx/GPUdEdx.cxx
202-
TPCConvert/GPUTPCConvert.cxx
203-
TPCConvert/GPUTPCConvertKernel.cxx
204-
DataCompression/GPUTPCCompression.cxx
205-
DataCompression/GPUTPCCompressionTrackModel.cxx
206-
DataCompression/GPUTPCCompressionKernels.cxx
207-
DataCompression/GPUTPCDecompression.cxx
208-
DataCompression/GPUTPCDecompressionKernels.cxx
209-
DataCompression/TPCClusterDecompressor.cxx
210-
DataCompression/GPUTPCClusterStatistics.cxx
211-
TPCClusterFinder/GPUTPCClusterFinder.cxx
212-
TPCClusterFinder/ClusterAccumulator.cxx
213-
TPCClusterFinder/MCLabelAccumulator.cxx
214-
TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
215-
TPCClusterFinder/GPUTPCCFStreamCompaction.cxx
216-
TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx
217-
TPCClusterFinder/GPUTPCCFPeakFinder.cxx
218-
TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx
219-
TPCClusterFinder/GPUTPCCFClusterizer.cxx
220-
TPCClusterFinder/GPUTPCCFDeconvolution.cxx
221-
TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx
222-
TPCClusterFinder/GPUTPCCFDecodeZS.cxx
223-
TPCClusterFinder/GPUTPCCFGather.cxx
224-
Refit/GPUTrackingRefit.cxx
225-
Refit/GPUTrackingRefitKernel.cxx
226-
Merger/GPUTPCGMO2Output.cxx)
196+
list(APPEND SRCS_NO_CINT TPCClusterFinder/GPUTPCNNClusterizer.cxx)
197+
list(APPEND SRCS_NO_CINT TPCClusterFinder/GPUTPCNNClusterizerInternals.cxx)
227198
endif()
228199

229200
set(SRCS_DATATYPES
@@ -297,8 +268,7 @@ unset(HDRS_TMP)
297268
# Main CMake part for O2
298269
if(ALIGPU_BUILD_TYPE STREQUAL "O2")
299270

300-
if(NOT ALIGPU_BUILD_TYPE STREQUAL "Standalone")
301-
o2_add_library(GPUDataTypes
271+
o2_add_library(GPUDataTypes
302272
TARGETVARNAME targetName
303273
PUBLIC_INCLUDE_DIRECTORIES .
304274
Definitions
@@ -307,23 +277,13 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2")
307277
O2::GPUCommon
308278
O2::ReconstructionDataFormats
309279
O2::TPCFastTransformation
310-
O2::ML
311280
PRIVATE_LINK_LIBRARIES O2::DataFormatsTPC
312281
SOURCES ${SRCS_DATATYPES})
282+
if(NOT ALIGPU_BUILD_TYPE STREQUAL "Standalone")
313283
add_compile_definitions(GPUCA_HAS_ONNX=1)
314284
target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2 GPUCA_HAS_ONNX)
285+
target_link_libraries(${targetName} PUBLIC O2::ML)
315286
else()
316-
o2_add_library(GPUDataTypes
317-
TARGETVARNAME targetName
318-
PUBLIC_INCLUDE_DIRECTORIES .
319-
Definitions
320-
DataTypes
321-
PUBLIC_LINK_LIBRARIES O2::GPUUtils
322-
O2::GPUCommon
323-
O2::ReconstructionDataFormats
324-
O2::TPCFastTransformation
325-
PRIVATE_LINK_LIBRARIES O2::DataFormatsTPC
326-
SOURCES ${SRCS_DATATYPES})
327287
target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2)
328288
endif()
329289

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
#include <Vc/Vc>
4242
#endif
4343

44+
#ifdef GPUCA_HAS_ONNX
45+
#include "GPUTPCNNClusterizer.h"
46+
#include "GPUTPCNNClusterizerInternals.h"
47+
#endif
48+
4449
using namespace o2::gpu;
4550
using namespace o2::tpc;
4651
using namespace o2::tpc::constants;
@@ -873,10 +878,12 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
873878
return;
874879
}
875880

881+
if (GetProcessingSettings().nn.applyNNclusterizer) {
876882
#ifdef GPUCA_HAS_ONNX
877-
GPUSettingsProcessingNNclusterizer nn_settings = GetProcessingSettings().nn;
878-
if (nn_settings.applyNNclusterizer) {
879883
// Settings for the clusterizer
884+
GPUSettingsProcessingNNclusterizer nn_settings = GetProcessingSettings().nn;
885+
GPUTPCNNClusterizerInternals nnSettingsInternal;
886+
clusterer.nnInternals = &nnSettingsInternal;
880887
(clusterer.nnInternals)->nnClusterizerUseCfRegression = nn_settings.nnClusterizerUseCfRegression;
881888
(clusterer.nnInternals)->nnClusterizerSizeInputRow = nn_settings.nnClusterizerSizeInputRow;
882889
(clusterer.nnInternals)->nnClusterizerSizeInputPad = nn_settings.nnClusterizerSizeInputPad;
@@ -989,15 +996,14 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
989996
if ((clusterer.nnInternals)->nnClusterizerVerbosity < 3) {
990997
LOG(info) << "[NN CF] Apply NN (fragment " << fragment.index << ", lane: " << lane << ", slice: " << iSector << "): filling data " << time_fill << "s ; clusterizer: " << time_clusterizer << "s ; " << clusterer.mPmemory->counters.nClusters << " clusters --> " << clusterer.mPmemory->counters.nClusters / (time_fill + time_clusterizer) << " clusters/s";
991998
}
992-
} else {
999+
#else
1000+
GPUFatal("Project not compiled with neural network clusterization. Aborting.");
9931001
#endif
1002+
} else {
9941003
runKernel<GPUTPCCFDeconvolution>({GetGrid(clusterer.mPmemory->counters.nPositions, lane), {iSector}});
9951004
DoDebugAndDump(RecoStep::TPCClusterFinding, 262144 << 4, clusterer, &GPUTPCClusterFinder::DumpChargeMap, *mDebugFile, "Split Charges");
9961005
runKernel<GPUTPCCFClusterizer>({GetGrid(clusterer.mPmemory->counters.nClusters, lane, GPUReconstruction::krnlDeviceType::CPU), {iSector}}, 0);
997-
998-
#ifdef GPUCA_HAS_ONNX
9991006
}
1000-
#endif
10011007

10021008
if (doGPU && propagateMCLabels) {
10031009
TransferMemoryResourceLinkToHost(RecoStep::TPCClusterFinding, clusterer.mScratchId, lane);

GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
#include "GPUDataTypes.h"
2121
#include "CfFragment.h"
2222

23-
#ifdef GPUCA_HAS_ONNX
24-
#include "GPUTPCNNClusterizerInternals.h"
25-
#endif
26-
2723
namespace o2
2824
{
2925

@@ -147,9 +143,7 @@ class GPUTPCClusterFinder : public GPUProcessor
147143
int16_t mZSOffsetId = -1;
148144
int16_t mOutputId = -1;
149145

150-
#ifdef GPUCA_HAS_ONNX
151-
GPUTPCNNClusterizerInternals* nnInternals;
152-
#endif
146+
GPUTPCNNClusterizerInternals* nnInternals = nullptr;
153147

154148
#ifndef GPUCA_GPUCODE
155149
void DumpDigits(std::ostream& out);

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// \author Christian Sonnabend
1414

1515
#include "GPUTPCNNClusterizer.h"
16+
#include "GPUTPCNNClusterizerInternals.h"
1617
#include "GPUTPCCFClusterizer.h"
1718

1819
#include "CfConsts.h"

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace o2::gpu
3232

3333
class ClusterAccumulator;
3434
class MCLabelAccumulator;
35+
class GPUTPCNNClusterizerInternals;
3536

3637
class GPUTPCNNClusterizer : public GPUKernelTemplate
3738
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file GPUTPCNNClusterizerInternals.cxx
13+
/// \author Christian Sonnabend
14+
15+
#include "GPUTPCNNClusterizerInternals.h"

GPU/GPUTracking/TPCClusterFinder/GPUTPCNNClusterizerInternals.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
/// \file GPUTPCNNClusterizerInternals.h
1313
/// \author Christian Sonnabend
1414

15+
#ifndef O2_GPUTPCNNCLUSTERIZERINTERNALS_H
16+
#define O2_GPUTPCNNCLUSTERIZERINTERNALS_H
17+
1518
#include "ML/3rdparty/GPUORTFloat16.h"
1619
#include "ML/OrtInterface.h"
1720
#include "ChargePos.h"
1821

19-
#ifndef O2_GPU_NN_CLUSTERIZER_INTERNALS_H
20-
#define O2_GPU_NN_CLUSTERIZER_INTERNALS_H
22+
using namespace o2::ml;
2123

2224
namespace o2::gpu
2325
{

0 commit comments

Comments
 (0)