Project
Loading...
Searching...
No Matches
GPUReconstruction.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#if !defined(GPURECONSTRUCTION_H) && !defined(__OPENCL__)
16#define GPURECONSTRUCTION_H
17
18#include <cstddef>
19#include <cstdio>
20#include <cstring>
21#include <string>
22#include <memory>
23#include <iosfwd>
24#include <vector>
25#include <functional>
26#include <unordered_map>
27#include <unordered_set>
28
29#include "GPUDataTypes.h"
30#include "GPUMemoryResource.h"
31#include "GPUOutputControl.h"
32
33/*#include "GPUParam.h"
34#include "GPUSettings.h"
35#include "GPULogging.h"*/
36
37namespace o2::its
38{
39template <int>
40class TrackerTraits;
41template <int>
42class VertexerTraits;
43template <int>
44class TimeFrame;
45} // namespace o2::its
46
47namespace o2::gpu
48{
49class GPUChain;
50struct GPUMemorySizeScalers;
51struct GPUReconstructionPipelineContext;
52struct GPUReconstructionThreading;
53class GPUROOTDumpCore;
54class ThrustVolatileAllocator;
55struct GPUDefParameters;
56class GPUMemoryResource;
57struct GPUSettingsDeviceBackend;
58struct GPUSettingsGRP;
59struct GPUSettingsProcessing;
60struct GPUSettingsRec;
61struct GPUSettingsRecDynamic;
62struct GPUMemoryReuse;
63
64namespace gpu_reconstruction_kernels
65{
66struct deviceEvent;
67class threadContext;
68} // namespace gpu_reconstruction_kernels
69
71{
72 protected:
73 class LibraryLoader; // These must be the first members to ensure correct destructor order!
74 std::shared_ptr<LibraryLoader> mMyLib = nullptr;
75 std::vector<GPUMemoryResource> mMemoryResources;
76 std::vector<std::unique_ptr<GPUChain>> mChains;
77
78 public:
79 virtual ~GPUReconstruction();
82
83 // General definitions
84 constexpr static uint32_t NSECTORS = GPUCA_NSECTORS;
85
92
93 static constexpr const char* const GEOMETRY_TYPE_NAMES[] = {"INVALID", "ALIROOT", "O2"};
94#ifdef GPUCA_TPC_GEOMETRY_O2
95 static constexpr GeometryType geometryType = GeometryType::O2;
96#else
97 static constexpr GeometryType geometryType = GeometryType::ALIROOT;
98#endif
99
100 static DeviceType GetDeviceType(const char* type);
101 enum InOutPointerType : uint32_t { CLUSTER_DATA = 0,
115 TPC_ZS = 14,
121 static constexpr const char* const IOTYPENAMES[] = {"TPC HLT Clusters", "TPC Sector Tracks", "TPC Sector Track Clusters", "TPC Cluster MC Labels", "TPC Track MC Informations", "TPC Tracks", "TPC Track Clusters", "TRD Tracks", "TRD Tracklets",
122 "TPC Raw Clusters", "TPC Native Clusters", "TRD Tracklet MC Labels", "TPC Compressed Clusters", "TPC Digit", "TPC ZS Page", "TPC Native Clusters MC Labels", "TPC Digit MC Labeels",
123 "TRD Spacepoints", "TRD Triggerrecords", "TF Settings"};
125
126 // Functionality to create an instance of GPUReconstruction for the desired device
128 static GPUReconstruction* CreateInstance(DeviceType type = DeviceType::CPU, bool forceType = true, GPUReconstruction* master = nullptr);
129 static GPUReconstruction* CreateInstance(int32_t type, bool forceType, GPUReconstruction* master = nullptr) { return CreateInstance((DeviceType)type, forceType, master); }
130 static GPUReconstruction* CreateInstance(const char* type, bool forceType, GPUReconstruction* master = nullptr);
131 static bool CheckInstanceAvailable(DeviceType type, bool verbose);
132
133 enum class krnlDeviceType : int32_t { CPU = 0,
134 Device = 1,
135 Auto = -1 };
136
137 // Global steering functions
138 template <class T, typename... Args>
139 T* AddChain(Args... args);
140
141 int32_t Init();
142 int32_t Finalize();
143 int32_t Exit();
144
145 void DumpSettings(const char* dir = "");
146 int32_t ReadSettings(const char* dir = "");
147
148 void PrepareEvent();
149 virtual int32_t RunChains() = 0;
152 int32_t registerMemoryForGPU(const void* ptr, size_t size);
153 int32_t unregisterMemoryForGPU(const void* ptr);
154 virtual void* getGPUPointer(void* ptr) { return ptr; }
155 virtual void startGPUProfiling() {}
156 virtual void endGPUProfiling() {}
157 int32_t GPUChkErrA(const int64_t error, const char* file, int32_t line, bool failOnError);
158 int32_t CheckErrorCodes(bool cpuOnly = false, bool forceShowErrors = false, std::vector<std::array<uint32_t, 4>>* fillErrors = nullptr);
159 void RunPipelineWorker();
161
162 // Helpers for memory allocation
164 template <class T>
165 int16_t RegisterMemoryAllocation(T* proc, void* (T::*setPtr)(void*), int32_t type, const char* name = "", const GPUMemoryReuse& re = GPUMemoryReuse());
167 size_t AllocateRegisteredMemory(GPUProcessor* proc, bool resetCustom = false);
168
169 size_t AllocateRegisteredMemory(int16_t res, GPUOutputControl* control = nullptr);
171 void* AllocateDirectMemory(size_t size, int32_t type);
173 void* AllocateVolatileMemory(size_t size, bool device);
175 void FreeRegisteredMemory(GPUProcessor* proc, bool freeCustom = false, bool freePermanent = false);
176 void FreeRegisteredMemory(int16_t res);
177 void ClearAllocatedMemory(bool clearOutputs = true);
181 void PushNonPersistentMemory(uint64_t tag);
182 void PopNonPersistentMemory(RecoStep step, uint64_t tag);
187 void ComputeReuseMax(GPUProcessor* proc);
189 void PrintMemoryOverview();
190 void PrintMemoryMax();
191 void SetMemoryExternalInput(int16_t res, void* ptr);
193
194 // Helpers to fetch processors from other shared libraries
195 virtual void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits<7>>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits<7>>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame<7>>* timeFrame);
196 bool slavesExist() { return mSlaves.size() || mMaster; }
197 int slaveId() { return mSlaveId; }
198
199 // Getters / setters for parameters
201 bool IsGPU() const { return GetDeviceType() != DeviceType::INVALID_DEVICE && GetDeviceType() != DeviceType::CPU; }
202 const GPUParam& GetParam() const;
205 const GPUSettingsGRP& GetGRPSettings() const { return *mGRPSettings; }
207 const GPUSettingsProcessing& GetProcessingSettings() const { return *mProcessingSettings; }
208 const GPUCalibObjectsConst& GetCalib() const;
209 bool IsInitialized() const { return mInitialized; }
210 void SetSettings(float solenoidBzNominalGPU, const GPURecoStepConfiguration* workflow = nullptr);
211 void SetSettings(const GPUSettingsGRP* grp, const GPUSettingsRec* rec = nullptr, const GPUSettingsProcessing* proc = nullptr, const GPURecoStepConfiguration* workflow = nullptr);
212 void SetResetTimers(bool reset); // May update also after Init()
213 void SetDebugLevelTmp(int32_t level); // Temporarily, before calling SetSettings()
214 void UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessing* p = nullptr, const GPUSettingsRecDynamic* d = nullptr);
215 void UpdateDynamicSettings(const GPUSettingsRecDynamic* d);
217 void SetOutputControl(void* ptr, size_t size);
218 void SetInputControl(void* ptr, size_t size);
220 uint32_t NStreams() const { return mNStreams; }
221 const void* DeviceMemoryBase() const { return mDeviceMemoryBase; }
222 virtual const GPUDefParameters& getGPUParameters(bool doGPU) const = 0;
223
228 int32_t getRecoStepNum(RecoStep step, bool validCheck = true);
229 int32_t getGeneralStepNum(GeneralStep step, bool validCheck = true);
230
231 void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v) { mOutputErrorCodes = v; }
232 std::vector<std::array<uint32_t, 4>>* getErrorCodeOutput() { return mOutputErrorCodes; }
233
234 // Registration of GPU Processors
235 template <class T>
236 void RegisterGPUProcessor(T* proc, bool deviceSlave);
237 template <class T>
238 void SetupGPUProcessor(T* proc, bool allocate);
239 void RegisterGPUDeviceProcessor(GPUProcessor* proc, GPUProcessor* slaveProcessor);
241
242 // Support / Debugging
243 virtual void PrintKernelOccupancies() {}
245 double GetStatWallTime() { return mStatWallTime; }
246 void setDebugDumpCallback(std::function<void()>&& callback = std::function<void()>(nullptr));
247 bool triggerDebugDump();
248 std::string getDebugFolder(const std::string& prefix = ""); // empty string = no debug
249
250 // Threading
251 std::shared_ptr<GPUReconstructionThreading> mThreading;
252 static int32_t getHostThreadIndex();
253 int32_t GetMaxBackendThreads() const { return mMaxBackendThreads; }
254
255 protected:
258 GPUReconstruction(const GPUSettingsDeviceBackend& cfg); // Constructor
259 int32_t InitPhaseBeforeDevice();
260 virtual int32_t InitDevice() = 0;
261 int32_t InitPhasePermanentMemory();
262 int32_t InitPhaseAfterDevice();
263 void WriteConstantParams();
264 virtual int32_t ExitDevice() = 0;
265 virtual size_t WriteToConstantMemory(size_t offset, const void* src, size_t size, int32_t stream = -1, gpu_reconstruction_kernels::deviceEvent* ev = nullptr) = 0;
266 void UpdateMaxMemoryUsed();
267 int32_t EnqueuePipeline(bool terminate = false);
269 virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const { return 0; }
270
271 virtual int32_t registerMemoryForGPU_internal(const void* ptr, size_t size) = 0;
272 virtual int32_t unregisterMemoryForGPU_internal(const void* ptr) = 0;
273
274 // Management for GPU thread contexts
275 virtual std::unique_ptr<gpu_reconstruction_kernels::threadContext> GetThreadContext() = 0;
276
277 // Private helpers for library loading
278 static std::shared_ptr<LibraryLoader>* GetLibraryInstance(DeviceType type, bool verbose);
279 static std::string getBackendVersions();
280
281 // Private helper functions for memory management
282 size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*), void*& memorypoolend, const char* device);
284
285 // Private helper functions for reading / writing / allocating IO buffer from/to file
286 template <class T, class S>
287 uint32_t DumpData(FILE* fp, const T* const* entries, const S* num, InOutPointerType type);
288 template <class T, class S>
289 size_t ReadData(FILE* fp, const T** entries, S* num, std::unique_ptr<T[]>* mem, InOutPointerType type, T** nonConstPtrs = nullptr);
290 template <class T>
291 T* AllocateIOMemoryHelper(size_t n, const T*& ptr, std::unique_ptr<T[]>& u);
292 int16_t RegisterMemoryAllocationHelper(GPUProcessor* proc, void* (GPUProcessor::*setPtr)(void*), int32_t type, const char* name, const GPUMemoryReuse& re);
293
294 // Private helper functions to dump / load flat objects
295 template <class T>
296 void DumpFlatObjectToFile(const T* obj, const char* file);
297 template <class T>
298 std::unique_ptr<T> ReadFlatObjectFromFile(const char* file);
299 template <class T>
300 void DumpStructToFile(const T* obj, const char* file);
301 template <class T>
302 std::unique_ptr<T> ReadStructFromFile(const char* file);
303 template <class T>
304 int32_t ReadStructFromFile(const char* file, T* obj);
305
306 // Others
307 virtual RecoStepField AvailableGPURecoSteps() { return RecoStep::AllRecoSteps; }
308 virtual bool CanQueryMaxMemory() { return false; }
309
310 // Pointers to tracker classes
312 const GPUConstantMem* processors() const { return mHostConstantMem.get(); }
313 GPUParam& param();
314 std::unique_ptr<GPUConstantMem> mHostConstantMem;
316
317 // Settings
318 std::unique_ptr<GPUSettingsGRP> mGRPSettings; // Global Run Parameters
319 std::unique_ptr<GPUSettingsDeviceBackend> mDeviceBackendSettings; // Processing Parameters (at constructor level)
320 std::unique_ptr<GPUSettingsProcessing> mProcessingSettings; // Processing Parameters (at init level)
321 GPUOutputControl mOutputControl; // Controls the output of the individual components
322 GPUOutputControl mInputControl; // Prefefined input memory location for reading standalone dumps
323 std::unique_ptr<GPUMemorySizeScalers> mMemoryScalers; // Scalers how much memory will be needed
324
326
327 std::string mDeviceName = "CPU";
328
329 // Ptrs to host and device memory;
330 void* mHostMemoryBase = nullptr; // Ptr to begin of large host memory buffer
331 void* mHostMemoryPermanent = nullptr; // Ptr to large host memory buffer offset by permanently allocated memory
332 void* mHostMemoryPool = nullptr; // Ptr to next free location in host memory buffer
333 void* mHostMemoryPoolEnd = nullptr; // Ptr to end of pool
334 void* mHostMemoryPoolBlocked = nullptr; // Ptr to end of pool
335 size_t mHostMemorySize = 0; // Size of host memory buffer
336 size_t mHostMemoryUsedMax = 0; // Maximum host memory size used over time
337 void* mDeviceMemoryBase = nullptr; // Same for device ...
338 void* mDeviceMemoryPermanent = nullptr; // ...
339 void* mDeviceMemoryPool = nullptr; // ...
340 void* mDeviceMemoryPoolEnd = nullptr; // ...
341 void* mDeviceMemoryPoolBlocked = nullptr; // ...
342 size_t mDeviceMemorySize = 0; // ...
343 size_t mDeviceMemoryUsedMax = 0; // ...
344 void* mVolatileMemoryStart = nullptr; // Ptr to beginning of temporary volatile memory allocation, nullptr if uninitialized
345 bool mDeviceMemoryAsVolatile = false; // Make device memory allocations volatile
346
347 std::unordered_set<const void*> mRegisteredMemoryPtrs; // List of pointers registered for GPU
348
349 GPUReconstruction* mMaster = nullptr; // Ptr to a GPUReconstruction object serving as master, sharing GPU memory, events, etc.
350 std::vector<GPUReconstruction*> mSlaves; // Ptr to slave GPUReconstructions
351 int mSlaveId = -1; // Id of this slave (-1 for master)
352
353 // Others
354 bool mInitialized = false;
355 bool mInErrorHandling = false;
356 uint32_t mStatNEvents = 0;
357 uint32_t mNEventsProcessed = 0;
358 double mStatKernelTime = 0.;
359 double mStatWallTime = 0.;
360 double mStatCPUTime = 0.;
361 std::shared_ptr<GPUROOTDumpCore> mROOTDump;
362 std::vector<std::array<uint32_t, 4>>* mOutputErrorCodes = nullptr;
363
364 int32_t mMaxBackendThreads = 0; // Maximum number of threads that may be running, on CPU or GPU
365 int32_t mGPUStuck = 0; // Marks that the GPU is stuck, skip future events
366 int32_t mNStreams = 1; // Number of parallel GPU streams
367 int32_t mMaxHostThreads = 0; // Maximum number of OMP threads
368
369 // Management for GPUProcessors
377 std::vector<ProcessorData> mProcessors;
379 MemoryReuseMeta() = default;
380 MemoryReuseMeta(GPUProcessor* p, uint16_t r) : proc(p), res{r} {}
381 GPUProcessor* proc = nullptr;
382 std::vector<uint16_t> res;
383 };
385 void operator()(void* ptr) { ::operator delete[](ptr, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)); };
386 };
387 std::unordered_map<GPUMemoryReuse::ID, MemoryReuseMeta> mMemoryReuse1to1;
388 std::vector<std::tuple<void*, void*, size_t, size_t, uint64_t>> mNonPersistentMemoryStack; // hostPoolAddress, devicePoolAddress, individualAllocationCount, directIndividualAllocationCound, tag
389 std::vector<GPUMemoryResource*> mNonPersistentIndividualAllocations;
390 std::vector<std::unique_ptr<char[], alignedDeleter>> mNonPersistentIndividualDirectAllocations;
391 std::vector<std::unique_ptr<char[], alignedDeleter>> mDirectMemoryChunks;
392 std::vector<std::unique_ptr<char[], alignedDeleter>> mVolatileChunks;
393
394 std::unique_ptr<GPUReconstructionPipelineContext> mPipelineContext;
395
396 // Helpers for loading device library via dlopen
398 {
399 public:
401 LibraryLoader(const LibraryLoader&) = delete;
402 const LibraryLoader& operator=(const LibraryLoader&) = delete;
403
404 private:
405 friend class GPUReconstruction;
406 LibraryLoader(const char* lib, const char* func);
407 int32_t LoadLibrary();
408 int32_t CloseLibrary();
410
411 const char* mLibName;
412 const char* mFuncName;
413 void* mGPULib;
414 void* mGPUEntry;
415 };
416 static std::shared_ptr<LibraryLoader> sLibCUDA, sLibHIP, sLibOCL;
417
418 // Debugging
419 struct debugInternal;
420 static std::unique_ptr<debugInternal> mDebugData;
421 bool mDebugEnabled = false;
422 void debugInit();
423 void debugExit();
424
426};
427
428template <class T, typename... Args>
429inline T* GPUReconstruction::AddChain(Args... args)
430{
431 mChains.emplace_back(new T(this, args...));
432 return (T*)mChains.back().get();
433}
434
435template <class T>
436inline int16_t GPUReconstruction::RegisterMemoryAllocation(T* proc, void* (T::*setPtr)(void*), int32_t type, const char* name, const GPUMemoryReuse& re)
437{
438 return RegisterMemoryAllocationHelper(proc, static_cast<void* (GPUProcessor::*)(void*)>(setPtr), type, name, re);
439}
440
441template <class T>
442inline void GPUReconstruction::RegisterGPUProcessor(T* proc, bool deviceSlave)
443{
444 mProcessors.emplace_back(proc, static_cast<void (GPUProcessor::*)()>(&T::RegisterMemoryAllocation), static_cast<void (GPUProcessor::*)()>(&T::InitializeProcessor), static_cast<void (GPUProcessor::*)(const GPUTrackingInOutPointers& io)>(&T::SetMaxData));
446 proc->InitGPUProcessor(this, processorType);
447}
448
449template <class T>
450inline void GPUReconstruction::SetupGPUProcessor(T* proc, bool allocate)
451{
452 static_assert(sizeof(T) > sizeof(GPUProcessor), "Need to setup derived class");
453 if (allocate) {
454 proc->SetMaxData(GetIOPtrs());
455 }
456 if (proc->mGPUProcessorType != GPUProcessor::PROCESSOR_TYPE_DEVICE && proc->mLinkedProcessor) {
457 std::memcpy((void*)proc->mLinkedProcessor, (const void*)proc, sizeof(*proc));
458 proc->mLinkedProcessor->InitGPUProcessor((GPUReconstruction*)this, GPUProcessor::PROCESSOR_TYPE_DEVICE, proc);
459 }
460 if (allocate) {
461 AllocateRegisteredMemory(proc, true);
462 } else {
464 }
465}
466
467} // namespace o2::gpu
468
469#endif
int32_t i
#define GPUCA_BUFFER_ALIGNMENT
#define GPUCA_NSECTORS
uint32_t res
Definition RawData.h:0
TBranch * ptr
double num
bitfield< RecoStep, uint32_t > RecoStepField
bitfield< InOutType, uint32_t > InOutTypeField
const LibraryLoader & operator=(const LibraryLoader &)=delete
LibraryLoader(const LibraryLoader &)=delete
GPURecoStepConfiguration mRecoSteps
std::vector< std::array< uint32_t, 4 > > * getErrorCodeOutput()
void SetupGPUProcessor(T *proc, bool allocate)
static DeviceType GetDeviceType(const char *type)
std::unordered_set< const void * > mRegisteredMemoryPtrs
int16_t RegisterMemoryAllocationHelper(GPUProcessor *proc, void *(GPUProcessor::*setPtr)(void *), int32_t type, const char *name, const GPUMemoryReuse &re)
std::vector< std::unique_ptr< GPUChain > > mChains
GPUDataTypes::RecoStep RecoStep
void * AllocateVolatileMemory(size_t size, bool device)
ThrustVolatileAllocator getThrustVolatileDeviceAllocator()
std::unique_ptr< GPUMemorySizeScalers > mMemoryScalers
void AllocateRegisteredForeignMemory(int16_t res, GPUReconstruction *rec, GPUOutputControl *control=nullptr)
void SetInputControl(void *ptr, size_t size)
GPUConstantMem * mDeviceConstantMem
void ConstructGPUProcessor(GPUProcessor *proc)
virtual void * getGPUPointer(void *ptr)
std::shared_ptr< GPUROOTDumpCore > mROOTDump
void PopNonPersistentMemory(RecoStep step, uint64_t tag)
static uint32_t getNIOTypeMultiplicity(InOutPointerType type)
size_t AllocateRegisteredMemoryHelper(GPUMemoryResource *res, void *&ptr, void *&memorypool, void *memorybase, size_t memorysize, void *(GPUMemoryResource::*SetPointers)(void *), void *&memorypoolend, const char *device)
const GPUSettingsDeviceBackend & GetDeviceBackendSettings() const
void ComputeReuseMax(GPUProcessor *proc)
void SetMemoryExternalInput(int16_t res, void *ptr)
int32_t getGeneralStepNum(GeneralStep step, bool validCheck=true)
std::string getDebugFolder(const std::string &prefix="")
static constexpr uint32_t NSECTORS
RecoStepField GetRecoStepsGPU() const
void RegisterGPUDeviceProcessor(GPUProcessor *proc, GPUProcessor *slaveProcessor)
uint32_t DumpData(FILE *fp, const T *const *entries, const S *num, InOutPointerType type)
std::vector< GPUReconstruction * > mSlaves
static std::shared_ptr< LibraryLoader > sLibHIP
std::vector< std::tuple< void *, void *, size_t, size_t, uint64_t > > mNonPersistentMemoryStack
std::unique_ptr< T > ReadStructFromFile(const char *file)
GPUDataTypes::DeviceType DeviceType
std::unique_ptr< T > ReadFlatObjectFromFile(const char *file)
void UpdateDynamicSettings(const GPUSettingsRecDynamic *d)
std::unique_ptr< GPUSettingsDeviceBackend > mDeviceBackendSettings
std::vector< GPUMemoryResource > mMemoryResources
void RegisterGPUProcessor(T *proc, bool deviceSlave)
void setDebugDumpCallback(std::function< void()> &&callback=std::function< void()>(nullptr))
static std::shared_ptr< LibraryLoader > * GetLibraryInstance(DeviceType type, bool verbose)
std::unique_ptr< GPUReconstructionPipelineContext > mPipelineContext
std::unique_ptr< GPUConstantMem > mHostConstantMem
void ResetRegisteredMemoryPointers(GPUProcessor *proc)
void DumpStructToFile(const T *obj, const char *file)
void AllocateRegisteredMemoryInternal(GPUMemoryResource *res, GPUOutputControl *control, GPUReconstruction *recPool)
InOutTypeField GetRecoStepsInputs() const
static bool CheckInstanceAvailable(DeviceType type, bool verbose)
virtual int32_t registerMemoryForGPU_internal(const void *ptr, size_t size)=0
virtual size_t WriteToConstantMemory(size_t offset, const void *src, size_t size, int32_t stream=-1, gpu_reconstruction_kernels::deviceEvent *ev=nullptr)=0
std::unordered_map< GPUMemoryReuse::ID, MemoryReuseMeta > mMemoryReuse1to1
std::shared_ptr< LibraryLoader > mMyLib
std::vector< ProcessorData > mProcessors
void * AllocateVolatileDeviceMemory(size_t size)
virtual int32_t InitDevice()=0
void SetSettings(float solenoidBzNominalGPU, const GPURecoStepConfiguration *workflow=nullptr)
const GPUCalibObjectsConst & GetCalib() const
const GPUTrackingInOutPointers GetIOPtrs() const
const GPUConstantMem * processors() const
virtual std::unique_ptr< gpu_reconstruction_kernels::threadContext > GetThreadContext()=0
GPUReconstruction(const GPUReconstruction &)=delete
static constexpr GeometryType geometryType
static std::shared_ptr< LibraryLoader > sLibOCL
std::vector< std::unique_ptr< char[], alignedDeleter > > mNonPersistentIndividualDirectAllocations
T * AllocateIOMemoryHelper(size_t n, const T *&ptr, std::unique_ptr< T[]> &u)
GPUDataTypes::GeometryType GeometryType
int16_t RegisterMemoryAllocation(T *proc, void *(T::*setPtr)(void *), int32_t type, const char *name="", const GPUMemoryReuse &re=GPUMemoryReuse())
void setErrorCodeOutput(std::vector< std::array< uint32_t, 4 > > *v)
void FreeRegisteredMemory(GPUProcessor *proc, bool freeCustom=false, bool freePermanent=false)
std::vector< std::unique_ptr< char[], alignedDeleter > > mVolatileChunks
static GPUReconstruction * CreateInstance(const GPUSettingsDeviceBackend &cfg)
GPUMemoryResource & Res(int16_t num)
virtual RecoStepField AvailableGPURecoSteps()
static constexpr const char *const IOTYPENAMES[]
GPUReconstruction & operator=(const GPUReconstruction &)=delete
static GPUReconstruction * GPUReconstruction_Create_CPU(const GPUSettingsDeviceBackend &cfg)
std::vector< std::unique_ptr< char[], alignedDeleter > > mDirectMemoryChunks
void UpdateSettings(const GPUSettingsGRP *g, const GPUSettingsProcessing *p=nullptr, const GPUSettingsRecDynamic *d=nullptr)
RecoStepField GetRecoSteps() const
virtual int32_t RunChains()=0
int32_t CheckErrorCodes(bool cpuOnly=false, bool forceShowErrors=false, std::vector< std::array< uint32_t, 4 > > *fillErrors=nullptr)
const GPUParam & GetParam() const
void ClearAllocatedMemory(bool clearOutputs=true)
static constexpr const char *const GEOMETRY_TYPE_NAMES[]
const GPUConstantMem & GetConstantMem() const
virtual int32_t ExitDevice()=0
std::unique_ptr< GPUSettingsGRP > mGRPSettings
std::unique_ptr< GPUSettingsProcessing > mProcessingSettings
const void * DeviceMemoryBase() const
void PushNonPersistentMemory(uint64_t tag)
InOutTypeField GetRecoStepsOutputs() const
size_t ReadData(FILE *fp, const T **entries, S *num, std::unique_ptr< T[]> *mem, InOutPointerType type, T **nonConstPtrs=nullptr)
int32_t getRecoStepNum(RecoStep step, bool validCheck=true)
static std::unique_ptr< debugInternal > mDebugData
virtual int32_t unregisterMemoryForGPU_internal(const void *ptr)=0
GPUMemorySizeScalers * MemoryScalers()
GPUDataTypes::GeneralStep GeneralStep
void BlockStackedMemory(GPUReconstruction *rec)
const GPUSettingsProcessing & GetProcessingSettings() const
void DumpSettings(const char *dir="")
void * AllocateDirectMemory(size_t size, int32_t type)
void DumpFlatObjectToFile(const T *obj, const char *file)
virtual void GetITSTraits(std::unique_ptr< o2::its::TrackerTraits< 7 > > *trackerTraits, std::unique_ptr< o2::its::VertexerTraits< 7 > > *vertexerTraits, std::unique_ptr< o2::its::TimeFrame< 7 > > *timeFrame)
int32_t unregisterMemoryForGPU(const void *ptr)
virtual const GPUDefParameters & getGPUParameters(bool doGPU) const =0
static GPUReconstruction * CreateInstance(int32_t type, bool forceType, GPUReconstruction *master=nullptr)
int32_t registerMemoryForGPU(const void *ptr, size_t size)
static std::shared_ptr< LibraryLoader > sLibCUDA
const GPUSettingsGRP & GetGRPSettings() const
void SetDebugLevelTmp(int32_t level)
int32_t EnqueuePipeline(bool terminate=false)
std::shared_ptr< GPUReconstructionThreading > mThreading
std::vector< GPUMemoryResource * > mNonPersistentIndividualAllocations
virtual int32_t GPUChkErrInternal(const int64_t error, const char *file, int32_t line) const
int32_t GPUChkErrA(const int64_t error, const char *file, int32_t line, bool failOnError)
GPUOutputControl & OutputControl()
size_t AllocateRegisteredMemory(GPUProcessor *proc, bool resetCustom=false)
int32_t ReadSettings(const char *dir="")
void SetOutputControl(const GPUOutputControl &v)
std::vector< std::array< uint32_t, 4 > > * mOutputErrorCodes
GLdouble n
Definition glcorearb.h:1982
GLenum func
Definition glcorearb.h:778
GLenum src
Definition glcorearb.h:1767
GLsizeiptr size
Definition glcorearb.h:659
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLintptr offset
Definition glcorearb.h:660
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean g
Definition glcorearb.h:1233
GLboolean r
Definition glcorearb.h:1233
GLuint GLuint stream
Definition glcorearb.h:1806
GPUReconstruction * rec
GPUDataTypes::RecoStepField stepsGPUMask
GPUDataTypes::InOutTypeField outputs
GPUDataTypes::RecoStepField steps
GPUDataTypes::InOutTypeField inputs
ProcessorData(GPUProcessor *p, void(GPUProcessor::*r)(), void(GPUProcessor::*i)(), void(GPUProcessor::*d)(const GPUTrackingInOutPointers &))
void(GPUProcessor::* SetMaxData)(const GPUTrackingInOutPointers &)