Project
Loading...
Searching...
No Matches
TimeFrameChunk.h
Go to the documentation of this file.
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.
12
13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMECHUNKGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMECHUNKGPU_H
15
18
23
24#include <gsl/gsl>
25
26namespace o2::its::gpu
27{
28template <int nLayers>
31 void set(const TrackingParameters& pars)
32 {
35 NSigmaCut = pars.NSigmaCut;
36 PVres = pars.PVres;
37 DeltaROF = pars.DeltaROF;
38 ZBins = pars.ZBins;
39 PhiBins = pars.PhiBins;
41 }
42
45 int MinTrackLength = nLayers;
46 float NSigmaCut = 5;
47 float PVres = 1.e-2f;
48 int DeltaROF = 0;
49 int ZBins{256};
50 int PhiBins{128};
51
54};
55
56template <int nLayers>
58{
59 public:
60 static size_t computeScalingSizeBytes(const int, const TimeFrameGPUParameters&);
62 static size_t computeRofPerChunk(const TimeFrameGPUParameters&, const size_t);
63
66 {
67 mTimeFramePtr = tf;
68 mTFGPUParams = &conf;
69 }
71
73 void allocate(const size_t, Stream&);
74 void reset(const Task, Stream&);
75 size_t loadDataOnDevice(const size_t, const size_t, const int, Stream&);
76
80 int* getDeviceIndexTables(const int);
86 TimeFrameGPUParameters* getTimeFrameGPUParameters() const { return mTFGPUParams; }
87
88 int* getDeviceCUBTmpBuffer() { return mCUBTmpBufferDevice; }
89 int* getDeviceFoundTracklets() { return mFoundTrackletsDevice; }
90 int* getDeviceNFoundCells() { return mNFoundCellsDevice; }
92 int* getDeviceCellNeighbours(const int);
93 CellSeed** getDeviceArrayCells() const { return mCellsDeviceArray; }
94 int** getDeviceArrayNeighboursCell() const { return mNeighboursCellDeviceArray; }
95 int** getDeviceArrayNeighboursCellLUT() const { return mNeighboursCellLookupTablesDeviceArray; }
96
98 int* getDeviceNTrackletCluster(const int combid) { return mNTrackletsPerClusterDevice[combid]; }
99 Line* getDeviceLines() { return mLinesDevice; };
100 int* getDeviceNFoundLines() { return mNFoundLinesDevice; }
101 int* getDeviceNExclusiveFoundLines() { return mNExclusiveFoundLinesDevice; }
102 unsigned char* getDeviceUsedTracklets() { return mUsedTrackletsDevice; }
103 int* getDeviceClusteredLines() { return mClusteredLinesDevice; }
104 size_t getNPopulatedRof() const { return mNPopulatedRof; }
105
106 private:
108 std::array<gsl::span<const Cluster>, nLayers> mHostClusters;
109 std::array<gsl::span<const int>, nLayers> mHostIndexTables;
110
112 std::array<Cluster*, nLayers> mClustersDevice;
113 std::array<int*, nLayers> mClusterExternalIndicesDevice;
114 std::array<int*, nLayers> mIndexTablesDevice;
115 std::array<Tracklet*, nLayers - 1> mTrackletsDevice;
116 std::array<int*, nLayers - 1> mTrackletsLookupTablesDevice;
117 std::array<CellSeed*, nLayers - 2> mCellsDevice;
118 // Road<nLayers - 2>* mRoadsDevice;
119 std::array<int*, nLayers - 2> mCellsLookupTablesDevice;
120 std::array<int*, nLayers - 3> mNeighboursCellDevice;
121 std::array<int*, nLayers - 3> mNeighboursCellLookupTablesDevice;
122 std::array<int*, nLayers - 2> mRoadsLookupTablesDevice;
123
124 // These are to make them accessible using layer index
125 CellSeed** mCellsDeviceArray;
126 int** mNeighboursCellDeviceArray;
127 int** mNeighboursCellLookupTablesDeviceArray;
128
129 // Small accessory buffers
130 int* mCUBTmpBufferDevice;
131 int* mFoundTrackletsDevice;
132 int* mNFoundCellsDevice;
133
135 Line* mLinesDevice;
136 int* mNFoundLinesDevice;
137 int* mNExclusiveFoundLinesDevice;
138 unsigned char* mUsedTrackletsDevice;
139 std::array<int*, 2> mNTrackletsPerClusterDevice;
140 int* mClusteredLinesDevice;
141
143 bool mAllocated = false;
144 size_t mNRof = 0;
145 size_t mNPopulatedRof = 0;
146 o2::its::TimeFrame* mTimeFramePtr = nullptr;
147 TimeFrameGPUParameters* mTFGPUParams = nullptr;
148};
149} // namespace o2::its::gpu
150#endif
GPU-compliant version of ClusterLines, for the moment separated, might create a common traits for Clu...
int * getDeviceClusterExternalIndices(const int)
CellSeed ** getDeviceArrayCells() const
int * getDeviceRoadsLookupTables(const int)
int * getDeviceCellsLookupTables(const int)
int * getDeviceCellNeighbours(const int)
int * getDeviceTrackletsLookupTables(const int)
void reset(const Task, Stream &)
int ** getDeviceArrayNeighboursCell() const
unsigned char * getDeviceUsedTracklets()
static size_t computeScalingSizeBytes(const int, const TimeFrameGPUParameters &)
void allocate(const size_t, Stream &)
Most relevant operations.
size_t loadDataOnDevice(const size_t, const size_t, const int, Stream &)
GpuTimeFrameChunk(o2::its::TimeFrame *tf, TimeFrameGPUParameters &conf)
int ** getDeviceArrayNeighboursCellLUT() const
CellSeed * getDeviceCells(const int)
Cluster * getDeviceClusters(const int)
Interface.
static size_t computeFixedSizeBytes(const TimeFrameGPUParameters &)
TimeFrameGPUParameters * getTimeFrameGPUParameters() const
int * getDeviceCellNeigboursLookupTables(const int)
Tracklet * getDeviceTracklets(const int)
int * getDeviceIndexTables(const int)
int * getDeviceNTrackletCluster(const int combid)
Vertexer only.
static size_t computeRofPerChunk(const TimeFrameGPUParameters &, const size_t)
std::unique_ptr< GPUReconstructionTimeframe > tf
float CellDeltaTanLambdaSigma
Cell finding cuts.
int ClusterSharing
General parameters.
void set(const TrackingParameters &pars)
StaticTrackingParameters< nLayers > & operator=(const StaticTrackingParameters< nLayers > &t)=default
float CellDeltaTanLambdaSigma
Cell finding cuts.