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