forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
GPUO2Interface.h
83 lines (68 loc) · 2.38 KB
/
GPUO2Interface.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
// 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 GPUO2Interface.h
/// \author David Rohr
#ifndef GPUO2INTERFACE_H
#define GPUO2INTERFACE_H
// Some defines denoting that we are compiling for O2
#ifndef HAVE_O2HEADERS
#define HAVE_O2HEADERS
#endif
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif
#include <memory>
#include "GPUCommonDef.h"
#include "GPUDataTypes.h"
namespace o2::tpc
{
struct ClusterNativeAccess;
struct ClusterNative;
} // namespace o2::tpc
namespace o2::gpu
{
class GPUReconstruction;
class GPUChainTracking;
struct GPUO2InterfaceConfiguration;
struct GPUInterfaceOutputs;
struct GPUOutputControl;
class GPUTPCO2Interface
{
public:
GPUTPCO2Interface();
~GPUTPCO2Interface();
int Initialize(const GPUO2InterfaceConfiguration& config);
void Deinitialize();
int RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceOutputs* outputs = nullptr);
void Clear(bool clearOutputs);
bool GetParamContinuous() { return (mContinuous); }
void GetClusterErrors2(int row, float z, float sinPhi, float DzDs, short clusterState, float& ErrY2, float& ErrZ2) const;
int registerMemoryForGPU(const void* ptr, size_t size);
int unregisterMemoryForGPU(const void* ptr);
const GPUO2InterfaceConfiguration& getConfig() const { return *mConfig; }
private:
GPUTPCO2Interface(const GPUTPCO2Interface&);
GPUTPCO2Interface& operator=(const GPUTPCO2Interface&);
bool mInitialized = false;
bool mContinuous = false;
std::unique_ptr<GPUReconstruction> mRec;
GPUChainTracking* mChain = nullptr;
std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
std::unique_ptr<GPUOutputControl> mOutputCompressedClusters;
std::unique_ptr<GPUOutputControl> mOutputClustersNative;
std::unique_ptr<GPUOutputControl> mOutputTPCTracks;
std::unique_ptr<GPUOutputControl> mOutputTPCClusterLabels;
std::unique_ptr<GPUOutputControl> mOutputSharedClusterMap;
};
} // namespace o2::gpu
#endif