forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrimaryVertexContextNV.h
140 lines (115 loc) · 5.19 KB
/
PrimaryVertexContextNV.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file PrimaryVertexContextNVNV.h
/// \brief
///
#ifndef TRACKINGITSU_INCLUDE_PRIMARYVERTEXCONTEXTNVNV_H_
#define TRACKINGITSU_INCLUDE_PRIMARYVERTEXCONTEXTNVNV_H_
#include <array>
#include "ITStracking/Configuration.h"
#include "ITStracking/Constants.h"
#include "ITStracking/Definitions.h"
#include "ITStracking/PrimaryVertexContext.h"
#include "ITStracking/Road.h"
#include "ITStracking/Tracklet.h"
#include "ITStrackingCUDA/DeviceStoreNV.h"
#include "ITStrackingCUDA/UniquePointer.h"
namespace o2
{
namespace its
{
class PrimaryVertexContextNV final : public PrimaryVertexContext
{
public:
PrimaryVertexContextNV() = default;
~PrimaryVertexContextNV() override;
void initialise(const MemoryParameters& memParam, const TrackingParameters& trkParam,
const std::vector<std::vector<Cluster>>& cl, const std::array<float, 3>& pv, const int iteration) override;
gpu::DeviceStoreNV& getDeviceContext();
gpu::Array<gpu::Vector<Cluster>, constants::its2::LayersNumber>& getDeviceClusters();
gpu::Array<gpu::Vector<Tracklet>, constants::its2::TrackletsPerRoad>& getDeviceTracklets();
gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad>& getDeviceTrackletsLookupTable();
gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad>& getDeviceTrackletsPerClustersTable();
gpu::Array<gpu::Vector<Cell>, constants::its2::CellsPerRoad>& getDeviceCells();
gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad - 1>& getDeviceCellsLookupTable();
gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad - 1>& getDeviceCellsPerTrackletTable();
std::array<gpu::Vector<int>, constants::its2::CellsPerRoad>& getTempTableArray();
std::array<gpu::Vector<Tracklet>, constants::its2::CellsPerRoad>& getTempTrackletArray();
std::array<gpu::Vector<Cell>, constants::its2::CellsPerRoad - 1>& getTempCellArray();
void updateDeviceContext();
private:
gpu::DeviceStoreNV mGPUContext;
gpu::UniquePointer<gpu::DeviceStoreNV> mGPUContextDevicePointer;
std::array<gpu::Vector<int>, constants::its2::CellsPerRoad> mTempTableArray;
std::array<gpu::Vector<Tracklet>, constants::its2::CellsPerRoad> mTempTrackletArray;
std::array<gpu::Vector<Cell>, constants::its2::CellsPerRoad - 1> mTempCellArray;
};
inline PrimaryVertexContextNV::~PrimaryVertexContextNV() = default;
inline gpu::DeviceStoreNV& PrimaryVertexContextNV::getDeviceContext()
{
return *mGPUContextDevicePointer;
}
inline gpu::Array<gpu::Vector<Cluster>, constants::its2::LayersNumber>& PrimaryVertexContextNV::getDeviceClusters()
{
return mGPUContext.getClusters();
}
inline gpu::Array<gpu::Vector<Tracklet>, constants::its2::TrackletsPerRoad>& PrimaryVertexContextNV::getDeviceTracklets()
{
return mGPUContext.getTracklets();
}
inline gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getDeviceTrackletsLookupTable()
{
return mGPUContext.getTrackletsLookupTable();
}
inline gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad>&
PrimaryVertexContextNV::getDeviceTrackletsPerClustersTable()
{
return mGPUContext.getTrackletsPerClusterTable();
}
inline gpu::Array<gpu::Vector<Cell>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getDeviceCells()
{
return mGPUContext.getCells();
}
inline gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad - 1>& PrimaryVertexContextNV::getDeviceCellsLookupTable()
{
return mGPUContext.getCellsLookupTable();
}
inline gpu::Array<gpu::Vector<int>, constants::its2::CellsPerRoad - 1>&
PrimaryVertexContextNV::getDeviceCellsPerTrackletTable()
{
return mGPUContext.getCellsPerTrackletTable();
}
inline std::array<gpu::Vector<int>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getTempTableArray()
{
return mTempTableArray;
}
inline std::array<gpu::Vector<Tracklet>, constants::its2::CellsPerRoad>& PrimaryVertexContextNV::getTempTrackletArray()
{
return mTempTrackletArray;
}
inline std::array<gpu::Vector<Cell>, constants::its2::CellsPerRoad - 1>& PrimaryVertexContextNV::getTempCellArray()
{
return mTempCellArray;
}
inline void PrimaryVertexContextNV::updateDeviceContext()
{
mGPUContextDevicePointer = gpu::UniquePointer<gpu::DeviceStoreNV>{mGPUContext};
}
inline void PrimaryVertexContextNV::initialise(const MemoryParameters& memParam, const TrackingParameters& trkParam,
const std::vector<std::vector<Cluster>>& cl, const std::array<float, 3>& pv, const int iteration)
{
///TODO: to be re-enabled in the future
// this->PrimaryVertexContext::initialise(memParam, cl, pv, iteration);
// mGPUContextDevicePointer = mGPUContext.initialise(mPrimaryVertex, mClusters, mTracklets, mCells, mCellsLookupTable, mMinR, mMaxR);
}
} // namespace its
} // namespace o2
#endif /* TRACKINGITSU_INCLUDE_PRIMARYVERTEXCONTEXTNV_H_ */