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
20#include "ITStrackingGPU/Stream.h"
21
22#include <gsl/gsl>
23
24namespace o2::its::gpu
25{
26template <int nLayers>
29 void set(const TrackingParameters& pars)
30 {
33 NSigmaCut = pars.NSigmaCut;
34 PVres = pars.PVres;
35 DeltaROF = pars.DeltaROF;
36 ZBins = pars.ZBins;
37 PhiBins = pars.PhiBins;
39 }
40
43 int MinTrackLength = nLayers;
44 float NSigmaCut = 5;
45 float PVres = 1.e-2f;
46 int DeltaROF = 0;
47 int ZBins{256};
48 int PhiBins{128};
49
52};
53
54template <int nLayers>
56{
57 public:
58 static size_t computeScalingSizeBytes(const int, const TimeFrameGPUParameters&);
60 static size_t computeRofPerChunk(const TimeFrameGPUParameters&, const size_t);
61
64 {
65 mTimeFramePtr = tf;
66 mTFGPUParams = &conf;
67 }
69
71 void allocate(const size_t, Stream&);
72 void reset(const Task, Stream&);
73 size_t loadDataOnDevice(const size_t, const size_t, const int, Stream&);
74
78 int* getDeviceIndexTables(const int);
84 TimeFrameGPUParameters* getTimeFrameGPUParameters() const { return mTFGPUParams; }
85
86 int* getDeviceCUBTmpBuffer() { return mCUBTmpBufferDevice; }
87 int* getDeviceFoundTracklets() { return mFoundTrackletsDevice; }
88 int* getDeviceNFoundCells() { return mNFoundCellsDevice; }
90 int* getDeviceCellNeighbours(const int);
91 CellSeed** getDeviceArrayCells() const { return mCellsDeviceArray; }
92 int** getDeviceArrayNeighboursCell() const { return mNeighboursCellDeviceArray; }
93 int** getDeviceArrayNeighboursCellLUT() const { return mNeighboursCellLookupTablesDeviceArray; }
94
96 int* getDeviceNTrackletCluster(const int combid) { return mNTrackletsPerClusterDevice[combid]; }
97 Line* getDeviceLines() { return mLinesDevice; };
98 int* getDeviceNFoundLines() { return mNFoundLinesDevice; }
99 int* getDeviceNExclusiveFoundLines() { return mNExclusiveFoundLinesDevice; }
100 unsigned char* getDeviceUsedTracklets() { return mUsedTrackletsDevice; }
101 int* getDeviceClusteredLines() { return mClusteredLinesDevice; }
102 size_t getNPopulatedRof() const { return mNPopulatedRof; }
103
104 private:
106 std::array<gsl::span<const Cluster>, nLayers> mHostClusters;
107 std::array<gsl::span<const int>, nLayers> mHostIndexTables;
108
110 std::array<Cluster*, nLayers> mClustersDevice;
111 std::array<int*, nLayers> mClusterExternalIndicesDevice;
112 std::array<int*, nLayers> mIndexTablesDevice;
113 std::array<Tracklet*, nLayers - 1> mTrackletsDevice;
114 std::array<int*, nLayers - 1> mTrackletsLookupTablesDevice;
115 std::array<CellSeed*, nLayers - 2> mCellsDevice;
116 // Road<nLayers - 2>* mRoadsDevice;
117 std::array<int*, nLayers - 2> mCellsLookupTablesDevice;
118 std::array<int*, nLayers - 3> mNeighboursCellDevice;
119 std::array<int*, nLayers - 3> mNeighboursCellLookupTablesDevice;
120 std::array<int*, nLayers - 2> mRoadsLookupTablesDevice;
121
122 // These are to make them accessible using layer index
123 CellSeed** mCellsDeviceArray;
124 int** mNeighboursCellDeviceArray;
125 int** mNeighboursCellLookupTablesDeviceArray;
126
127 // Small accessory buffers
128 int* mCUBTmpBufferDevice;
129 int* mFoundTrackletsDevice;
130 int* mNFoundCellsDevice;
131
133 Line* mLinesDevice;
134 int* mNFoundLinesDevice;
135 int* mNExclusiveFoundLinesDevice;
136 unsigned char* mUsedTrackletsDevice;
137 std::array<int*, 2> mNTrackletsPerClusterDevice;
138 int* mClusteredLinesDevice;
139
141 bool mAllocated = false;
142 size_t mNRof = 0;
143 size_t mNPopulatedRof = 0;
144 o2::its::TimeFrame* mTimeFramePtr = nullptr;
145 TimeFrameGPUParameters* mTFGPUParams = nullptr;
146};
147} // namespace o2::its::gpu
148#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.