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;
48class VertexerTraits;
49template <int>
50class TimeFrame;
51} // namespace o2::its
52
53namespace o2::gpu
54{
55class GPUReconstruction;
56class GPUChainTracking;
57class GPUChainITS;
58struct GPUO2InterfaceConfiguration;
59struct GPUInterfaceOutputs;
60struct GPUInterfaceInputUpdate;
61struct GPUTrackingOutputs;
62struct GPUConstantMem;
63struct GPUNewCalibValues;
64
65struct GPUO2Interface_processingContext;
66struct GPUO2Interface_Internals;
67
69{
70 public:
73
74 int32_t Initialize(const GPUO2InterfaceConfiguration& config);
75 void Deinitialize();
76
77 int32_t RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceOutputs* outputs = nullptr, uint32_t iThread = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
78 void Clear(bool clearOutputs, uint32_t iThread = 0);
79 void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers* data);
80 void DumpSettings();
81
82 void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame);
83 const o2::base::Propagator* GetDeviceO2Propagator(int32_t iThread = 0) const;
85
86 // Updates all calibration objects that are != nullptr in newCalib
87 int32_t UpdateCalibration(const GPUCalibObjectsConst& newCalib, const GPUNewCalibValues& newVals, uint32_t iThread = 0);
88
89 int32_t registerMemoryForGPU(const void* ptr, size_t size);
90 int32_t unregisterMemoryForGPU(const void* ptr);
91 void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v);
92
93 const GPUO2InterfaceConfiguration& getConfig() const { return *mConfig; }
94
95 private:
97 GPUO2Interface& operator=(const GPUO2Interface&);
98
99 bool mContinuous = false;
100
101 uint32_t mNContexts = 0;
102 std::unique_ptr<GPUO2Interface_processingContext[]> mCtx;
103
104 std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
105 GPUChainITS* mChainITS = nullptr;
106 std::unique_ptr<GPUO2Interface_Internals> mInternals;
107};
108} // namespace o2::gpu
109
110#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 setErrorCodeOutput(std::vector< std::array< uint32_t, 4 > > *v)
void UseGPUPolynomialFieldInPropagator(o2::base::Propagator *prop) const
void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers *data)
void GetITSTraits(o2::its::TrackerTraits< 7 > *&trackerTraits, o2::its::VertexerTraits *&vertexerTraits, o2::its::TimeFrame< 7 > *&timeFrame)
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