Skip to content

Commit 64c47f6

Browse files
authored
ITS-GPU: various fixes + separate vertexing kernels (AliceO2Group#13473)
* Staging * Move vertexer kernels away from the traits * Fix GPU APIs compatibility * Fix Hybrid interfaces for CPU * Checkpoint work * Unregister memory in sync and async when iteration == par.size()-1 * Fix USEMatCorrNONE case in gpu fit * Update usage * Make TrackingFrameInfo array const * Update methods
1 parent 5215528 commit 64c47f6

File tree

12 files changed

+509
-456
lines changed

12 files changed

+509
-456
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ class GpuTimeFrameChunk
174174
template <int nLayers = 7>
175175
class TimeFrameGPU : public TimeFrame
176176
{
177-
public:
178177
friend class GpuTimeFrameChunk<nLayers>;
179178

179+
public:
180180
TimeFrameGPU();
181181
~TimeFrameGPU();
182182

@@ -185,7 +185,7 @@ class TimeFrameGPU : public TimeFrame
185185
void unregisterHostMemory(const int);
186186
void initialise(const int, const TrackingParameters&, const int, IndexTableUtils* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
187187
void initialiseHybrid(const int, const TrackingParameters&, const int, IndexTableUtils* utils = nullptr, const TimeFrameGPUParameters* pars = nullptr);
188-
void initDevice(const int, IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
188+
void initDevice(IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int, const int);
189189
void initDeviceSAFitting();
190190
void loadTrackingFrameInfoDevice(const int);
191191
void loadUnsortedClustersDevice();
@@ -227,7 +227,8 @@ class TimeFrameGPU : public TimeFrame
227227
TrackITSExt* getDeviceTrackITSExt() { return mTrackITSExtDevice; }
228228
gpuPair<int, int>* getDeviceNeighbours(const int layer) { return mNeighboursDevice[layer]; }
229229
TrackingFrameInfo* getDeviceTrackingFrameInfo(const int);
230-
TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() { return mTrackingFrameInfoDeviceArray; }
230+
// TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() { return mTrackingFrameInfoDeviceArray; }
231+
const TrackingFrameInfo** getDeviceArrayTrackingFrameInfo() const { return mTrackingFrameInfoDeviceArray; }
231232
Cluster** getDeviceArrayClusters() const { return mClustersDeviceArray; }
232233
Cluster** getDeviceArrayUnsortedClusters() const { return mUnsortedClustersDeviceArray; }
233234
Tracklet** getDeviceArrayTracklets() const { return mTrackletsDeviceArray; }
@@ -275,7 +276,7 @@ class TimeFrameGPU : public TimeFrame
275276
TrackITSExt* mTrackITSExtDevice;
276277
std::array<gpuPair<int, int>*, nLayers - 2> mNeighboursDevice;
277278
std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
278-
TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
279+
const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
279280

280281
// State
281282
std::vector<Stream> mGpuStreams;

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
#include "DetectorsBase/Propagator.h"
1717
#include "GPUCommonDef.h"
1818

19-
namespace o2
20-
{
21-
namespace its
19+
namespace o2::its
2220
{
2321
class CellSeed;
2422
namespace gpu
@@ -40,9 +38,9 @@ GPUd() bool fitTrack(TrackITSExt& track,
4038
template <int nLayers = 7>
4139
GPUg() void fitTrackSeedsKernel(
4240
CellSeed* trackSeeds,
43-
TrackingFrameInfo** foundTrackingFrameInfo,
41+
const TrackingFrameInfo** foundTrackingFrameInfo,
4442
o2::its::TrackITSExt* tracks,
45-
const size_t nSeeds,
43+
const unsigned int nSeeds,
4644
const float Bz,
4745
const int startLevel,
4846
float maxChi2ClusterAttachment,
@@ -53,15 +51,14 @@ GPUg() void fitTrackSeedsKernel(
5351
} // namespace gpu
5452

5553
void trackSeedHandler(CellSeed* trackSeeds,
56-
TrackingFrameInfo** foundTrackingFrameInfo,
54+
const TrackingFrameInfo** foundTrackingFrameInfo,
5755
o2::its::TrackITSExt* tracks,
58-
const size_t nSeeds,
56+
const unsigned int nSeeds,
5957
const float Bz,
6058
const int startLevel,
6159
float maxChi2ClusterAttachment,
6260
float maxChi2NDF,
6361
const o2::base::Propagator* propagator,
6462
const o2::base::PropagatorF::MatCorrType matCorrType);
65-
} // namespace its
66-
} // namespace o2
63+
} // namespace o2::its
6764
#endif // ITSTRACKINGGPU_TRACKINGKERNELS_H_
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
13+
#ifndef ITSTRACKINGGPU_VERTEXINGKERNELS_H_
14+
#define ITSTRACKINGGPU_VERTEXINGKERNELS_H_
15+
#include "ITStracking/MathUtils.h"
16+
#include "ITStracking/Configuration.h"
17+
#include "ITStracking/ClusterLines.h"
18+
#include "ITStracking/Tracklet.h"
19+
20+
#include "ITStrackingGPU/Utils.h"
21+
#include "ITStrackingGPU/ClusterLinesGPU.h"
22+
#include "ITStrackingGPU/VertexerTraitsGPU.h"
23+
#include "ITStrackingGPU/TracerGPU.h"
24+
25+
#include "GPUCommonArray.h"
26+
27+
namespace o2::its::gpu
28+
{
29+
#ifdef GPUCA_GPUCODE // GPUg() global kernels must only when compiled by GPU compiler
30+
template <TrackletMode Mode>
31+
GPUg() void trackleterKernelMultipleRof(
32+
const Cluster* clustersNextLayer, // 0 2
33+
const Cluster* clustersCurrentLayer, // 1 1
34+
const int* sizeNextLClusters,
35+
const int* sizeCurrentLClusters,
36+
const int* nextIndexTables,
37+
Tracklet* Tracklets,
38+
int* foundTracklets,
39+
const IndexTableUtils* utils,
40+
const unsigned int startRofId,
41+
const unsigned int rofSize,
42+
const float phiCut,
43+
const size_t maxTrackletsPerCluster);
44+
#endif
45+
template <TrackletMode Mode>
46+
void trackletFinderHandler(const Cluster* clustersNextLayer, // 0 2
47+
const Cluster* clustersCurrentLayer, // 1 1
48+
const int* sizeNextLClusters,
49+
const int* sizeCurrentLClusters,
50+
const int* nextIndexTables,
51+
Tracklet* Tracklets,
52+
int* foundTracklets,
53+
const IndexTableUtils* utils,
54+
const unsigned int startRofId,
55+
const unsigned int rofSize,
56+
const float phiCut,
57+
const size_t maxTrackletsPerCluster = 1e2);
58+
} // namespace o2::its::gpu
59+
#endif

Detectors/ITSMFT/ITS/tracking/GPU/cuda/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ o2_add_library(ITStrackingCUDA
2222
TimeFrameGPU.cu
2323
TracerGPU.cu
2424
TrackingKernels.cu
25-
VertexerTraitsGPU.cu
25+
VertexingKernels.cu
26+
VertexerTraitsGPU.cxx
2627
Utils.cu
2728
PUBLIC_INCLUDE_DIRECTORIES ../
2829
PUBLIC_LINK_LIBRARIES O2::ITStracking

0 commit comments

Comments
 (0)