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 <unordered_map>
26#include <unordered_set>
27
28#include "GPUDataTypes.h"
29#include "GPUMemoryResource.h"
30#include "GPUOutputControl.h"
31
32/*#include "GPUParam.h"
33#include "GPUSettings.h"
34#include "GPULogging.h"*/
35
36namespace o2::its
37{
38class TrackerTraits;
39class VertexerTraits;
40class TimeFrame;
41} // namespace o2::its
42
43namespace o2::gpu
44{
45class GPUChain;
46struct GPUMemorySizeScalers;
47struct GPUReconstructionPipelineContext;
48struct GPUReconstructionThreading;
49class GPUROOTDumpCore;
50class ThrustVolatileAllocator;
51struct GPUDefParameters;
52class GPUMemoryResource;
53struct GPUSettingsDeviceBackend;
54struct GPUSettingsGRP;
55struct GPUSettingsProcessing;
56struct GPUSettingsRec;
57struct GPUSettingsRecDynamic;
58struct GPUMemoryReuse;
59
60namespace gpu_reconstruction_kernels
61{
62struct deviceEvent;
63class threadContext;
64} // namespace gpu_reconstruction_kernels
65
67{
68 protected:
69 class LibraryLoader; // These must be the first members to ensure correct destructor order!
70 std::shared_ptr<LibraryLoader> mMyLib = nullptr;
71 std::vector<GPUMemoryResource> mMemoryResources;
72 std::vector<std::unique_ptr<GPUChain>> mChains;
73
74 public:
75 virtual ~GPUReconstruction();
78
79 // General definitions
80 constexpr static uint32_t NSECTORS = GPUCA_NSECTORS;
81
88
89 static constexpr const char* const GEOMETRY_TYPE_NAMES[] = {"INVALID", "ALIROOT", "O2"};
90#ifdef GPUCA_TPC_GEOMETRY_O2
91 static constexpr GeometryType geometryType = GeometryType::O2;
92#else
93 static constexpr GeometryType geometryType = GeometryType::ALIROOT;
94#endif
95
96 static DeviceType GetDeviceType(const char* type);
97 enum InOutPointerType : uint32_t { CLUSTER_DATA = 0,
111 TPC_ZS = 14,
117 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",
118 "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",
119 "TRD Spacepoints", "TRD Triggerrecords", "TF Settings"};
121
122 // Functionality to create an instance of GPUReconstruction for the desired device
124 static GPUReconstruction* CreateInstance(DeviceType type = DeviceType::CPU, bool forceType = true, GPUReconstruction* master = nullptr);
125 static GPUReconstruction* CreateInstance(int32_t type, bool forceType, GPUReconstruction* master = nullptr) { return CreateInstance((DeviceType)type, forceType, master); }
126 static GPUReconstruction* CreateInstance(const char* type, bool forceType, GPUReconstruction* master = nullptr);
127 static bool CheckInstanceAvailable(DeviceType type, bool verbose);
128
129 enum class krnlDeviceType : int32_t { CPU = 0,
130 Device = 1,
131 Auto = -1 };
132
133 // Global steering functions
134 template <class T, typename... Args>
135 T* AddChain(Args... args);
136
137 int32_t Init();
138 int32_t Finalize();
139 int32_t Exit();
140
141 void DumpSettings(const char* dir = "");
142 int32_t ReadSettings(const char* dir = "");
143
144 void PrepareEvent();
145 virtual int32_t RunChains() = 0;
148 int32_t registerMemoryForGPU(const void* ptr, size_t size);
149 int32_t unregisterMemoryForGPU(const void* ptr);
150 virtual void* getGPUPointer(void* ptr) { return ptr; }
151 virtual void startGPUProfiling() {}
152 virtual void endGPUProfiling() {}
153 int32_t GPUChkErrA(const int64_t error, const char* file, int32_t line, bool failOnError);
154 int32_t CheckErrorCodes(bool cpuOnly = false, bool forceShowErrors = false, std::vector<std::array<uint32_t, 4>>* fillErrors = nullptr);
155 void RunPipelineWorker();
157
158 // Helpers for memory allocation
160 template <class T>
161 int16_t RegisterMemoryAllocation(T* proc, void* (T::*setPtr)(void*), int32_t type, const char* name = "", const GPUMemoryReuse& re = GPUMemoryReuse());
163 size_t AllocateRegisteredMemory(GPUProcessor* proc, bool resetCustom = false);
164
165 size_t AllocateRegisteredMemory(int16_t res, GPUOutputControl* control = nullptr);
167 void* AllocateDirectMemory(size_t size, int32_t type);
169 void* AllocateVolatileMemory(size_t size, bool device);
171 void FreeRegisteredMemory(GPUProcessor* proc, bool freeCustom = false, bool freePermanent = false);
172 void FreeRegisteredMemory(int16_t res);
173 void ClearAllocatedMemory(bool clearOutputs = true);
177 void PushNonPersistentMemory(uint64_t tag);
178 void PopNonPersistentMemory(RecoStep step, uint64_t tag);
183 void ComputeReuseMax(GPUProcessor* proc);
185 void PrintMemoryOverview();
186 void PrintMemoryMax();
187 void SetMemoryExternalInput(int16_t res, void* ptr);
189
190 // Helpers to fetch processors from other shared libraries
191 virtual void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits>* vertexerTraits, std::unique_ptr<o2::its::TimeFrame>* timeFrame);
192 bool slavesExist() { return mSlaves.size() || mMaster; }
193
194 // Getters / setters for parameters
196 bool IsGPU() const { return GetDeviceType() != DeviceType::INVALID_DEVICE && GetDeviceType() != DeviceType::CPU; }
197 const GPUParam& GetParam() const;
200 const GPUSettingsGRP& GetGRPSettings() const { return *mGRPSettings; }
202 const GPUSettingsProcessing& GetProcessingSettings() const { return *mProcessingSettings; }
203 const GPUCalibObjectsConst& GetCalib() const;
204 bool IsInitialized() const { return mInitialized; }
205 void SetSettings(float solenoidBzNominalGPU, const GPURecoStepConfiguration* workflow = nullptr);
206 void SetSettings(const GPUSettingsGRP* grp, const GPUSettingsRec* rec = nullptr, const GPUSettingsProcessing* proc = nullptr, const GPURecoStepConfiguration* workflow = nullptr);
207 void SetResetTimers(bool reset); // May update also after Init()
208 void SetDebugLevelTmp(int32_t level); // Temporarily, before calling SetSettings()
209 void UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessing* p = nullptr, const GPUSettingsRecDynamic* d = nullptr);
210 void UpdateDynamicSettings(const GPUSettingsRecDynamic* d);
212 void SetOutputControl(void* ptr, size_t size);
213 void SetInputControl(void* ptr, size_t size);
215 uint32_t NStreams() const { return mNStreams; }
216 const void* DeviceMemoryBase() const { return mDeviceMemoryBase; }
217 virtual const GPUDefParameters& getGPUParameters(bool doGPU) const = 0;
218
223 int32_t getRecoStepNum(RecoStep step, bool validCheck = true);
224 int32_t getGeneralStepNum(GeneralStep step, bool validCheck = true);
225
226 void setErrorCodeOutput(std::vector<std::array<uint32_t, 4>>* v) { mOutputErrorCodes = v; }
227 std::vector<std::array<uint32_t, 4>>* getErrorCodeOutput() { return mOutputErrorCodes; }
228
229 // Registration of GPU Processors
230 template <class T>
231 void RegisterGPUProcessor(T* proc, bool deviceSlave);
232 template <class T>
233 void SetupGPUProcessor(T* proc, bool allocate);
234 void RegisterGPUDeviceProcessor(GPUProcessor* proc, GPUProcessor* slaveProcessor);
236
237 // Support / Debugging
238 virtual void PrintKernelOccupancies() {}
240 double GetStatWallTime() { return mStatWallTime; }
241
242 // Threading
243 std::shared_ptr<GPUReconstructionThreading> mThreading;
244 static int32_t getHostThreadIndex();
245 int32_t GetMaxBackendThreads() const { return mMaxBackendThreads; }
246
247 protected:
250 GPUReconstruction(const GPUSettingsDeviceBackend& cfg); // Constructor
251 int32_t InitPhaseBeforeDevice();
252 virtual int32_t InitDevice() = 0;
253 int32_t InitPhasePermanentMemory();
254 int32_t InitPhaseAfterDevice();
255 void WriteConstantParams();
256 virtual int32_t ExitDevice() = 0;
257 virtual size_t WriteToConstantMemory(size_t offset, const void* src, size_t size, int32_t stream = -1, gpu_reconstruction_kernels::deviceEvent* ev = nullptr) = 0;
258 void UpdateMaxMemoryUsed();
259 int32_t EnqueuePipeline(bool terminate = false);
261 virtual int32_t GPUChkErrInternal(const int64_t error, const char* file, int32_t line) const { return 0; }
262
263 virtual int32_t registerMemoryForGPU_internal(const void* ptr, size_t size) = 0;
264 virtual int32_t unregisterMemoryForGPU_internal(const void* ptr) = 0;
265
266 // Management for GPU thread contexts
267 virtual std::unique_ptr<gpu_reconstruction_kernels::threadContext> GetThreadContext() = 0;
268
269 // Private helpers for library loading
270 static std::shared_ptr<LibraryLoader>* GetLibraryInstance(DeviceType type, bool verbose);
271
272 // Private helper functions for memory management
273 size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*), void*& memorypoolend, const char* device);
275
276 // Private helper functions for reading / writing / allocating IO buffer from/to file
277 template <class T, class S>
278 uint32_t DumpData(FILE* fp, const T* const* entries, const S* num, InOutPointerType type);
279 template <class T, class S>
280 size_t ReadData(FILE* fp, const T** entries, S* num, std::unique_ptr<T[]>* mem, InOutPointerType type, T** nonConstPtrs = nullptr);
281 template <class T>
282 T* AllocateIOMemoryHelper(size_t n, const T*& ptr, std::unique_ptr<T[]>& u);
283 int16_t RegisterMemoryAllocationHelper(GPUProcessor* proc, void* (GPUProcessor::*setPtr)(void*), int32_t type, const char* name, const GPUMemoryReuse& re);
284
285 // Private helper functions to dump / load flat objects
286 template <class T>
287 void DumpFlatObjectToFile(const T* obj, const char* file);
288 template <class T>
289 std::unique_ptr<T> ReadFlatObjectFromFile(const char* file);
290 template <class T>
291 void DumpStructToFile(const T* obj, const char* file);
292 template <class T>
293 std::unique_ptr<T> ReadStructFromFile(const char* file);
294 template <class T>
295 int32_t ReadStructFromFile(const char* file, T* obj);
296
297 // Others
298 virtual RecoStepField AvailableGPURecoSteps() { return RecoStep::AllRecoSteps; }
299 virtual bool CanQueryMaxMemory() { return false; }
300
301 // Pointers to tracker classes
303 const GPUConstantMem* processors() const { return mHostConstantMem.get(); }
304 GPUParam& param();
305 std::unique_ptr<GPUConstantMem> mHostConstantMem;
307
308 // Settings
309 std::unique_ptr<GPUSettingsGRP> mGRPSettings; // Global Run Parameters
310 std::unique_ptr<GPUSettingsDeviceBackend> mDeviceBackendSettings; // Processing Parameters (at constructor level)
311 std::unique_ptr<GPUSettingsProcessing> mProcessingSettings; // Processing Parameters (at init level)
312 GPUOutputControl mOutputControl; // Controls the output of the individual components
313 GPUOutputControl mInputControl; // Prefefined input memory location for reading standalone dumps
314 std::unique_ptr<GPUMemorySizeScalers> mMemoryScalers; // Scalers how much memory will be needed
315
317
318 std::string mDeviceName = "CPU";
319
320 // Ptrs to host and device memory;
321 void* mHostMemoryBase = nullptr; // Ptr to begin of large host memory buffer
322 void* mHostMemoryPermanent = nullptr; // Ptr to large host memory buffer offset by permanently allocated memory
323 void* mHostMemoryPool = nullptr; // Ptr to next free location in host memory buffer
324 void* mHostMemoryPoolEnd = nullptr; // Ptr to end of pool
325 void* mHostMemoryPoolBlocked = nullptr; // Ptr to end of pool
326 size_t mHostMemorySize = 0; // Size of host memory buffer
327 size_t mHostMemoryUsedMax = 0; // Maximum host memory size used over time
328 void* mDeviceMemoryBase = nullptr; // Same for device ...
329 void* mDeviceMemoryPermanent = nullptr; // ...
330 void* mDeviceMemoryPool = nullptr; // ...
331 void* mDeviceMemoryPoolEnd = nullptr; // ...
332 void* mDeviceMemoryPoolBlocked = nullptr; // ...
333 size_t mDeviceMemorySize = 0; // ...
334 size_t mDeviceMemoryUsedMax = 0; // ...
335 void* mVolatileMemoryStart = nullptr; // Ptr to beginning of temporary volatile memory allocation, nullptr if uninitialized
336 bool mDeviceMemoryAsVolatile = false; // Make device memory allocations volatile
337
338 std::unordered_set<const void*> mRegisteredMemoryPtrs; // List of pointers registered for GPU
339
340 GPUReconstruction* mMaster = nullptr; // Ptr to a GPUReconstruction object serving as master, sharing GPU memory, events, etc.
341 std::vector<GPUReconstruction*> mSlaves; // Ptr to slave GPUReconstructions
342
343 // Others
344 bool mInitialized = false;
345 bool mInErrorHandling = false;
346 uint32_t mStatNEvents = 0;
347 uint32_t mNEventsProcessed = 0;
348 double mStatKernelTime = 0.;
349 double mStatWallTime = 0.;
350 double mStatCPUTime = 0.;
351 std::shared_ptr<GPUROOTDumpCore> mROOTDump;
352 std::vector<std::array<uint32_t, 4>>* mOutputErrorCodes = nullptr;
353
354 int32_t mMaxBackendThreads = 0; // Maximum number of threads that may be running, on CPU or GPU
355 int32_t mGPUStuck = 0; // Marks that the GPU is stuck, skip future events
356 int32_t mNStreams = 1; // Number of parallel GPU streams
357 int32_t mMaxHostThreads = 0; // Maximum number of OMP threads
358
359 // Management for GPUProcessors
367 std::vector<ProcessorData> mProcessors;
369 MemoryReuseMeta() = default;
370 MemoryReuseMeta(GPUProcessor* p, uint16_t r) : proc(p), res{r} {}
371 GPUProcessor* proc = nullptr;
372 std::vector<uint16_t> res;
373 };
375 void operator()(void* ptr) { ::operator delete(ptr, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)); };
376 };
377 std::unordered_map<GPUMemoryReuse::ID, MemoryReuseMeta> mMemoryReuse1to1;
378 std::vector<std::tuple<void*, void*, size_t, size_t, uint64_t>> mNonPersistentMemoryStack; // hostPoolAddress, devicePoolAddress, individualAllocationCount, directIndividualAllocationCound, tag
379 std::vector<GPUMemoryResource*> mNonPersistentIndividualAllocations;
380 std::vector<std::unique_ptr<char[], alignedDeleter>> mNonPersistentIndividualDirectAllocations;
381 std::vector<std::unique_ptr<char[], alignedDeleter>> mDirectMemoryChunks;
382 std::vector<std::unique_ptr<char[], alignedDeleter>> mVolatileChunks;
383
384 std::unique_ptr<GPUReconstructionPipelineContext> mPipelineContext;
385
386 // Helpers for loading device library via dlopen
388 {
389 public:
391 LibraryLoader(const LibraryLoader&) = delete;
392 const LibraryLoader& operator=(const LibraryLoader&) = delete;
393
394 private:
395 friend class GPUReconstruction;
396 LibraryLoader(const char* lib, const char* func);
397 int32_t LoadLibrary();
398 int32_t CloseLibrary();
400
401 const char* mLibName;
402 const char* mFuncName;
403 void* mGPULib;
404 void* mGPUEntry;
405 };
406 static std::shared_ptr<LibraryLoader> sLibCUDA, sLibHIP, sLibOCL;
407
409};
410
411template <class T, typename... Args>
412inline T* GPUReconstruction::AddChain(Args... args)
413{
414 mChains.emplace_back(new T(this, args...));
415 return (T*)mChains.back().get();
416}
417
418template <class T>
419inline int16_t GPUReconstruction::RegisterMemoryAllocation(T* proc, void* (T::*setPtr)(void*), int32_t type, const char* name, const GPUMemoryReuse& re)
420{
421 return RegisterMemoryAllocationHelper(proc, static_cast<void* (GPUProcessor::*)(void*)>(setPtr), type, name, re);
422}
423
424template <class T>
425inline void GPUReconstruction::RegisterGPUProcessor(T* proc, bool deviceSlave)
426{
427 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));
429 proc->InitGPUProcessor(this, processorType);
430}
431
432template <class T>
433inline void GPUReconstruction::SetupGPUProcessor(T* proc, bool allocate)
434{
435 static_assert(sizeof(T) > sizeof(GPUProcessor), "Need to setup derived class");
436 if (allocate) {
437 proc->SetMaxData(GetIOPtrs());
438 }
439 if (proc->mGPUProcessorType != GPUProcessor::PROCESSOR_TYPE_DEVICE && proc->mLinkedProcessor) {
440 std::memcpy((void*)proc->mLinkedProcessor, (const void*)proc, sizeof(*proc));
441 proc->mLinkedProcessor->InitGPUProcessor((GPUReconstruction*)this, GPUProcessor::PROCESSOR_TYPE_DEVICE, proc);
442 }
443 if (allocate) {
444 AllocateRegisteredMemory(proc, true);
445 } else {
447 }
448}
449
450} // namespace o2::gpu
451
452#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)
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)
virtual void GetITSTraits(std::unique_ptr< o2::its::TrackerTraits > *trackerTraits, std::unique_ptr< o2::its::VertexerTraits > *vertexerTraits, std::unique_ptr< o2::its::TimeFrame > *timeFrame)
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)
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)
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)
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 &)