-
Notifications
You must be signed in to change notification settings - Fork 496
Expand file tree
/
Copy pathGPUO2Interface.h
More file actions
109 lines (89 loc) · 3.38 KB
/
GPUO2Interface.h
File metadata and controls
109 lines (89 loc) · 3.38 KB
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
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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 GPUO2Interface.h
/// \author David Rohr
#ifndef GPUO2INTERFACE_H
#define GPUO2INTERFACE_H
#include "GPUO2ExternalUser.h"
#include "GPUCommonDef.h"
#include "GPUDataTypesIO.h"
#include "GPUDataTypesConfig.h"
#include <memory>
#include <array>
#include <vector>
namespace o2::base
{
template <typename value_T>
class PropagatorImpl;
using Propagator = PropagatorImpl<float>;
} // namespace o2::base
namespace o2::tpc
{
struct ClusterNativeAccess;
struct ClusterNative;
} // namespace o2::tpc
namespace o2::its
{
template <int>
class TrackerTraits;
template <int>
class VertexerTraits;
template <int>
class TimeFrame;
} // namespace o2::its
namespace o2::gpu
{
class GPUReconstruction;
class GPUChainTracking;
class GPUChainITS;
struct GPUO2InterfaceConfiguration;
struct GPUInterfaceOutputs;
struct GPUInterfaceInputUpdate;
struct GPUTrackingOutputs;
struct GPUConstantMem;
struct GPUNewCalibValues;
struct GPUSettingsProcessing;
struct GPUSettingsRec;
struct GPUO2Interface_processingContext;
struct GPUO2Interface_Internals;
class GPUO2Interface
{
public:
GPUO2Interface();
~GPUO2Interface();
int32_t Initialize(const GPUO2InterfaceConfiguration& config);
void Deinitialize();
int32_t RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceOutputs* outputs = nullptr, uint32_t iThread = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
void Clear(bool clearOutputs, uint32_t iThread = 0);
void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers* data, uint32_t iThread, const char* dir = "");
void DumpSettings(uint32_t iThread, const char* dir = "");
void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits<7>*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame);
const o2::base::Propagator* GetDeviceO2Propagator(int32_t iThread = 0) const;
void UseGPUPolynomialFieldInPropagator(o2::base::Propagator* prop) const;
// Updates all calibration objects that are != nullptr in newCalib
int32_t UpdateCalibration(const GPUCalibObjectsConst& newCalib, const GPUNewCalibValues& newVals, uint32_t iThread = 0);
static void ApplySyncSettings(GPUSettingsProcessing& proc, GPUSettingsRec& rec, gpudatatypes::RecoStepField& steps, bool syncMode, int32_t dEdxMode = -2);
int32_t registerMemoryForGPU(const void* ptr, size_t size);
int32_t unregisterMemoryForGPU(const void* ptr);
void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v);
const GPUO2InterfaceConfiguration& getConfig() const { return *mConfig; }
private:
GPUO2Interface(const GPUO2Interface&);
GPUO2Interface& operator=(const GPUO2Interface&);
bool mContinuous = false;
uint32_t mNContexts = 0;
std::unique_ptr<GPUO2Interface_processingContext[]> mCtx;
std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
GPUChainITS* mChainITS = nullptr;
std::unique_ptr<GPUO2Interface_Internals> mInternals;
};
} // namespace o2::gpu
#endif