Project
Loading...
Searching...
No Matches
GPUO2Interface.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.
11
14
15#ifndef GPUO2INTERFACE_H
16#define GPUO2INTERFACE_H
17
18// Some defines denoting that we are compiling for O2
19#ifndef GPUCA_TPC_GEOMETRY_O2
20#define GPUCA_TPC_GEOMETRY_O2
21#endif
22#ifndef GPUCA_O2_INTERFACE
23#define GPUCA_O2_INTERFACE
24#endif
25
26#include <memory>
27#include <array>
28#include <vector>
29#include "GPUCommonDef.h"
30#include "GPUDataTypes.h"
31
32namespace o2::base
33{
34template <typename value_T>
35class PropagatorImpl;
36using Propagator = PropagatorImpl<float>;
37} // namespace o2::base
38namespace o2::tpc
39{
40struct ClusterNativeAccess;
41struct ClusterNative;
42} // namespace o2::tpc
43
44namespace o2::its
45{
46template <int>
47class TrackerTraits;
48template <int>
49class VertexerTraits;
50template <int>
51class TimeFrame;
52} // namespace o2::its
53
54namespace o2::gpu
55{
56class GPUReconstruction;
57class GPUChainTracking;
58class GPUChainITS;
59struct GPUO2InterfaceConfiguration;
60struct GPUInterfaceOutputs;
61struct GPUInterfaceInputUpdate;
62struct GPUTrackingOutputs;
63struct GPUConstantMem;
64struct GPUNewCalibValues;
65
66struct GPUO2Interface_processingContext;
67struct GPUO2Interface_Internals;
68
70{
71 public:
74
75 int32_t Initialize(const GPUO2InterfaceConfiguration& config);
76 void Deinitialize();
77
78 int32_t RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceOutputs* outputs = nullptr, uint32_t iThread = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
79 void Clear(bool clearOutputs, uint32_t iThread = 0);
80 void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers* data);
81 void DumpSettings();
82
83 void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits<7>*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame);
84 const o2::base::Propagator* GetDeviceO2Propagator(int32_t iThread = 0) const;
86
87 // Updates all calibration objects that are != nullptr in newCalib
88 int32_t UpdateCalibration(const GPUCalibObjectsConst& newCalib, const GPUNewCalibValues& newVals, uint32_t iThread = 0);
89
90 int32_t registerMemoryForGPU(const void* ptr, size_t size);
91 int32_t unregisterMemoryForGPU(const void* ptr);
92 void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v);
93
94 const GPUO2InterfaceConfiguration& getConfig() const { return *mConfig; }
95
96 private:
98 GPUO2Interface& operator=(const GPUO2Interface&);
99
100 bool mContinuous = false;
101
102 uint32_t mNContexts = 0;
103 std::unique_ptr<GPUO2Interface_processingContext[]> mCtx;
104
105 std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
106 GPUChainITS* mChainITS = nullptr;
107 std::unique_ptr<GPUO2Interface_Internals> mInternals;
108};
109} // namespace o2::gpu
110
111#endif
TBranch * ptr
int32_t unregisterMemoryForGPU(const void *ptr)
const o2::base::Propagator * GetDeviceO2Propagator(int32_t iThread=0) const
int32_t Initialize(const GPUO2InterfaceConfiguration &config)
void GetITSTraits(o2::its::TrackerTraits< 7 > *&trackerTraits, o2::its::VertexerTraits< 7 > *&vertexerTraits, o2::its::TimeFrame< 7 > *&timeFrame)
void setErrorCodeOutput(std::vector< std::array< uint32_t, 4 > > *v)
void UseGPUPolynomialFieldInPropagator(o2::base::Propagator *prop) const
void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers *data)
const GPUO2InterfaceConfiguration & getConfig() const
int32_t RunTracking(GPUTrackingInOutPointers *data, GPUInterfaceOutputs *outputs=nullptr, uint32_t iThread=0, GPUInterfaceInputUpdate *inputUpdateCallback=nullptr)
int32_t registerMemoryForGPU(const void *ptr, size_t size)
void Clear(bool clearOutputs, uint32_t iThread=0)
int32_t UpdateCalibration(const GPUCalibObjectsConst &newCalib, const GPUNewCalibValues &newVals, uint32_t iThread=0)
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
GLboolean * data
Definition glcorearb.h:298
PropagatorF Propagator
Definition Propagator.h:182
Global TPC definitions and constants.
Definition SimTraits.h:167