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#include "GPUO2ExternalUser.h"
19#include "GPUCommonDef.h"
20#include "GPUDataTypes.h"
21
22#include <memory>
23#include <array>
24#include <vector>
25
26namespace o2::base
27{
28template <typename value_T>
29class PropagatorImpl;
30using Propagator = PropagatorImpl<float>;
31} // namespace o2::base
32namespace o2::tpc
33{
34struct ClusterNativeAccess;
35struct ClusterNative;
36} // namespace o2::tpc
37
38namespace o2::its
39{
40template <int>
41class TrackerTraits;
42template <int>
43class VertexerTraits;
44template <int>
45class TimeFrame;
46} // namespace o2::its
47
48namespace o2::gpu
49{
50class GPUReconstruction;
51class GPUChainTracking;
52class GPUChainITS;
53struct GPUO2InterfaceConfiguration;
54struct GPUInterfaceOutputs;
55struct GPUInterfaceInputUpdate;
56struct GPUTrackingOutputs;
57struct GPUConstantMem;
58struct GPUNewCalibValues;
59
60struct GPUO2Interface_processingContext;
61struct GPUO2Interface_Internals;
62
64{
65 public:
68
69 int32_t Initialize(const GPUO2InterfaceConfiguration& config);
70 void Deinitialize();
71
72 int32_t RunTracking(GPUTrackingInOutPointers* data, GPUInterfaceOutputs* outputs = nullptr, uint32_t iThread = 0, GPUInterfaceInputUpdate* inputUpdateCallback = nullptr);
73 void Clear(bool clearOutputs, uint32_t iThread = 0);
74 void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers* data, uint32_t iThread, const char* dir = "");
75 void DumpSettings(uint32_t iThread, const char* dir = "");
76
77 void GetITSTraits(o2::its::TrackerTraits<7>*& trackerTraits, o2::its::VertexerTraits<7>*& vertexerTraits, o2::its::TimeFrame<7>*& timeFrame);
78 const o2::base::Propagator* GetDeviceO2Propagator(int32_t iThread = 0) const;
80
81 // Updates all calibration objects that are != nullptr in newCalib
82 int32_t UpdateCalibration(const GPUCalibObjectsConst& newCalib, const GPUNewCalibValues& newVals, uint32_t iThread = 0);
83
84 int32_t registerMemoryForGPU(const void* ptr, size_t size);
85 int32_t unregisterMemoryForGPU(const void* ptr);
86 void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v);
87
88 const GPUO2InterfaceConfiguration& getConfig() const { return *mConfig; }
89
90 private:
92 GPUO2Interface& operator=(const GPUO2Interface&);
93
94 bool mContinuous = false;
95
96 uint32_t mNContexts = 0;
97 std::unique_ptr<GPUO2Interface_processingContext[]> mCtx;
98
99 std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
100 GPUChainITS* mChainITS = nullptr;
101 std::unique_ptr<GPUO2Interface_Internals> mInternals;
102};
103} // namespace o2::gpu
104
105#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 DumpSettings(uint32_t iThread, const char *dir="")
void setErrorCodeOutput(std::vector< std::array< uint32_t, 4 > > *v)
void UseGPUPolynomialFieldInPropagator(o2::base::Propagator *prop) const
const GPUO2InterfaceConfiguration & getConfig() const
void DumpEvent(int32_t nEvent, GPUTrackingInOutPointers *data, uint32_t iThread, const char *dir="")
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:223
Global TPC definitions and constants.
Definition SimTraits.h:168