Project
Loading...
Searching...
No Matches
o2::gpu::GPUReconstructionProcessing Class Reference

#include <GPUReconstructionProcessing.h>

Inherits o2::gpu::GPUReconstruction.

Inherited by o2::gpu::GPUReconstructionCPUBackend.

Classes

struct  RecoStepTimerMeta
 
struct  timerMeta
 

Public Member Functions

 ~GPUReconstructionProcessing () override=default
 
int32_t getNKernelHostThreads (bool splitCores)
 
uint32_t getNActiveThreadsOuterLoop () const
 
void SetNActiveThreadsOuterLoop (uint32_t f)
 
uint32_t SetAndGetNActiveThreadsOuterLoop (bool condition, uint32_t max)
 
void runParallelOuterLoop (bool doGPU, uint32_t nThreads, std::function< void(uint32_t)> lambda)
 
void SetNActiveThreads (int32_t n)
 
auto & getRecoStepTimer (RecoStep step)
 
HighResTimergetGeneralStepTimer (GeneralStep step)
 
template<class T >
void AddGPUEvents (T *&events)
 
virtual std::unique_ptr< gpu_reconstruction_kernels::threadContextGetThreadContext () override
 
- Public Member Functions inherited from o2::gpu::GPUReconstruction
virtual ~GPUReconstruction ()
 
 GPUReconstruction (const GPUReconstruction &)=delete
 
GPUReconstructionoperator= (const GPUReconstruction &)=delete
 
template<class T , typename... Args>
T * AddChain (Args... args)
 
int32_t Init ()
 
int32_t Finalize ()
 
int32_t Exit ()
 
void DumpSettings (const char *dir="")
 
int32_t ReadSettings (const char *dir="")
 
void PrepareEvent ()
 
virtual int32_t RunChains ()=0
 
uint32_t getNEventsProcessed ()
 
uint32_t getNEventsProcessedInStat ()
 
int32_t registerMemoryForGPU (const void *ptr, size_t size)
 
int32_t unregisterMemoryForGPU (const void *ptr)
 
virtual voidgetGPUPointer (void *ptr)
 
virtual void startGPUProfiling ()
 
virtual void endGPUProfiling ()
 
int32_t CheckErrorCodes (bool cpuOnly=false, bool forceShowErrors=false, std::vector< std::array< uint32_t, 4 > > *fillErrors=nullptr)
 
void RunPipelineWorker ()
 
void TerminatePipelineWorker ()
 
GPUMemoryResourceRes (int16_t num)
 
template<class T >
int16_t RegisterMemoryAllocation (T *proc, void *(T::*setPtr)(void *), int32_t type, const char *name="", const GPUMemoryReuse &re=GPUMemoryReuse())
 
size_t AllocateMemoryResources ()
 
size_t AllocateRegisteredMemory (GPUProcessor *proc, bool resetCustom=false)
 
size_t AllocateRegisteredMemory (int16_t res, GPUOutputControl *control=nullptr)
 
void AllocateRegisteredForeignMemory (int16_t res, GPUReconstruction *rec, GPUOutputControl *control=nullptr)
 
voidAllocateUnmanagedMemory (size_t size, int32_t type)
 
voidAllocateVolatileDeviceMemory (size_t size)
 
voidAllocateVolatileMemory (size_t size, bool device)
 
void FreeRegisteredMemory (GPUProcessor *proc, bool freeCustom=false, bool freePermanent=false)
 
void FreeRegisteredMemory (int16_t res)
 
void ClearAllocatedMemory (bool clearOutputs=true)
 
void ReturnVolatileDeviceMemory ()
 
void ReturnVolatileMemory ()
 
void PushNonPersistentMemory (uint64_t tag)
 
void PopNonPersistentMemory (RecoStep step, uint64_t tag)
 
void BlockStackedMemory (GPUReconstruction *rec)
 
void UnblockStackedMemory ()
 
void ResetRegisteredMemoryPointers (GPUProcessor *proc)
 
void ResetRegisteredMemoryPointers (int16_t res)
 
void ComputeReuseMax (GPUProcessor *proc)
 
void PrintMemoryStatistics ()
 
void PrintMemoryOverview ()
 
void PrintMemoryMax ()
 
void SetMemoryExternalInput (int16_t res, void *ptr)
 
GPUMemorySizeScalersMemoryScalers ()
 
virtual void GetITSTraits (std::unique_ptr< o2::its::TrackerTraits > *trackerTraits, std::unique_ptr< o2::its::VertexerTraits > *vertexerTraits, std::unique_ptr< o2::its::TimeFrame > *timeFrame)
 
bool slavesExist ()
 
DeviceType GetDeviceType () const
 
bool IsGPU () const
 
const GPUParamGetParam () const
 
const GPUConstantMemGetConstantMem () const
 
const GPUSettingsGRPGetGRPSettings () const
 
const GPUSettingsDeviceBackendGetDeviceBackendSettings ()
 
const GPUSettingsProcessing & GetProcessingSettings () const
 
bool IsInitialized () const
 
void SetSettings (float solenoidBzNominalGPU, const GPURecoStepConfiguration *workflow=nullptr)
 
void SetSettings (const GPUSettingsGRP *grp, const GPUSettingsRec *rec=nullptr, const GPUSettingsProcessing *proc=nullptr, const GPURecoStepConfiguration *workflow=nullptr)
 
void SetResetTimers (bool reset)
 
void SetDebugLevelTmp (int32_t level)
 
void UpdateSettings (const GPUSettingsGRP *g, const GPUSettingsProcessing *p=nullptr, const GPUSettingsRecDynamic *d=nullptr)
 
void UpdateDynamicSettings (const GPUSettingsRecDynamic *d)
 
void SetOutputControl (const GPUOutputControl &v)
 
void SetOutputControl (void *ptr, size_t size)
 
void SetInputControl (void *ptr, size_t size)
 
GPUOutputControlOutputControl ()
 
int32_t NStreams () const
 
const voidDeviceMemoryBase () const
 
RecoStepField GetRecoSteps () const
 
RecoStepField GetRecoStepsGPU () const
 
InOutTypeField GetRecoStepsInputs () const
 
InOutTypeField GetRecoStepsOutputs () const
 
int32_t getRecoStepNum (RecoStep step, bool validCheck=true)
 
int32_t getGeneralStepNum (GeneralStep step, bool validCheck=true)
 
void setErrorCodeOutput (std::vector< std::array< uint32_t, 4 > > *v)
 
std::vector< std::array< uint32_t, 4 > > * getErrorCodeOutput ()
 
template<class T >
void RegisterGPUProcessor (T *proc, bool deviceSlave)
 
template<class T >
void SetupGPUProcessor (T *proc, bool allocate)
 
void RegisterGPUDeviceProcessor (GPUProcessor *proc, GPUProcessor *slaveProcessor)
 
void ConstructGPUProcessor (GPUProcessor *proc)
 
virtual void PrintKernelOccupancies ()
 
double GetStatKernelTime ()
 
double GetStatWallTime ()
 
int32_t GetMaxBackendThreads () const
 

Static Public Member Functions

template<class T , int32_t I>
static constexpr const charGetKernelName ()
 
- Static Public Member Functions inherited from o2::gpu::GPUReconstruction
static DeviceType GetDeviceType (const char *type)
 
static uint32_t getNIOTypeMultiplicity (InOutPointerType type)
 
static GPUReconstructionCreateInstance (const GPUSettingsDeviceBackend &cfg)
 
static GPUReconstructionCreateInstance (DeviceType type=DeviceType::CPU, bool forceType=true, GPUReconstruction *master=nullptr)
 
static GPUReconstructionCreateInstance (int32_t type, bool forceType, GPUReconstruction *master=nullptr)
 
static GPUReconstructionCreateInstance (const char *type, bool forceType, GPUReconstruction *master=nullptr)
 
static bool CheckInstanceAvailable (DeviceType type, bool verbose)
 
static int32_t getHostThreadIndex ()
 

Protected Types

using deviceEvent = gpu_reconstruction_kernels::deviceEvent
 

Protected Member Functions

 GPUReconstructionProcessing (const GPUSettingsDeviceBackend &cfg)
 
template<class T , int32_t I = 0>
HighResTimergetKernelTimer (RecoStep step, int32_t num=0, size_t addMemorySize=0, bool increment=true)
 
template<class T , int32_t J = -1>
HighResTimergetTimer (const char *name, int32_t num=-1)
 
- Protected Member Functions inherited from o2::gpu::GPUReconstruction
void AllocateRegisteredMemoryInternal (GPUMemoryResource *res, GPUOutputControl *control, GPUReconstruction *recPool)
 
void FreeRegisteredMemory (GPUMemoryResource *res)
 
 GPUReconstruction (const GPUSettingsDeviceBackend &cfg)
 
int32_t InitPhaseBeforeDevice ()
 
virtual void UpdateAutomaticProcessingSettings ()
 
virtual int32_t InitDevice ()=0
 
int32_t InitPhasePermanentMemory ()
 
int32_t InitPhaseAfterDevice ()
 
void WriteConstantParams ()
 
virtual int32_t ExitDevice ()=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
 
void UpdateMaxMemoryUsed ()
 
int32_t EnqueuePipeline (bool terminate=false)
 
GPUChainGetNextChainInQueue ()
 
virtual int32_t registerMemoryForGPU_internal (const void *ptr, size_t size)=0
 
virtual int32_t unregisterMemoryForGPU_internal (const void *ptr)=0
 
size_t AllocateRegisteredMemoryHelper (GPUMemoryResource *res, void *&ptr, void *&memorypool, void *memorybase, size_t memorysize, void *(GPUMemoryResource::*SetPointers)(void *), void *&memorypoolend, const char *device)
 
size_t AllocateRegisteredPermanentMemory ()
 
template<class T , class S >
uint32_t DumpData (FILE *fp, const T *const *entries, const S *num, InOutPointerType type)
 
template<class T , class S >
size_t ReadData (FILE *fp, const T **entries, S *num, std::unique_ptr< T[]> *mem, InOutPointerType type, T **nonConstPtrs=nullptr)
 
template<class T >
T * AllocateIOMemoryHelper (size_t n, const T *&ptr, std::unique_ptr< T[]> &u)
 
template<class T >
void DumpFlatObjectToFile (const T *obj, const char *file)
 
template<class T >
std::unique_ptr< T > ReadFlatObjectFromFile (const char *file)
 
template<class T >
void DumpStructToFile (const T *obj, const char *file)
 
template<class T >
std::unique_ptr< T > ReadStructFromFile (const char *file)
 
template<class T >
int32_t ReadStructFromFile (const char *file, T *obj)
 
virtual RecoStepField AvailableGPURecoSteps ()
 
virtual bool CanQueryMaxMemory ()
 
GPUConstantMemprocessors ()
 
const GPUConstantMemprocessors () const
 
GPUParamparam ()
 

Protected Attributes

int32_t mActiveHostKernelThreads = 0
 
uint32_t mNActiveThreadsOuterLoop = 1
 
std::vector< std::vector< deviceEvent > > mEvents
 
HighResTimer mTimersGeneralSteps [GPUDataTypes::N_GENERAL_STEPS]
 
std::vector< std::unique_ptr< timerMeta > > mTimers
 
RecoStepTimerMeta mTimersRecoSteps [GPUDataTypes::N_RECO_STEPS]
 
HighResTimer mTimerTotal
 
- Protected Attributes inherited from o2::gpu::GPUReconstruction
std::shared_ptr< LibraryLoadermMyLib = nullptr
 
std::vector< GPUMemoryResourcemMemoryResources
 
std::vector< std::unique_ptr< char[]> > mUnmanagedChunks
 
std::vector< std::unique_ptr< char[]> > mVolatileChunks
 
std::vector< std::unique_ptr< GPUChain > > mChains
 
std::unique_ptr< GPUConstantMemmHostConstantMem
 
GPUConstantMemmDeviceConstantMem = nullptr
 
GPUSettingsGRP mGRPSettings
 
GPUSettingsDeviceBackend mDeviceBackendSettings
 
GPUSettingsProcessing mProcessingSettings
 
GPUOutputControl mOutputControl
 
GPUOutputControl mInputControl
 
std::unique_ptr< GPUMemorySizeScalersmMemoryScalers
 
GPURecoStepConfiguration mRecoSteps
 
std::string mDeviceName = "CPU"
 
voidmHostMemoryBase = nullptr
 
voidmHostMemoryPermanent = nullptr
 
voidmHostMemoryPool = nullptr
 
voidmHostMemoryPoolEnd = nullptr
 
voidmHostMemoryPoolBlocked = nullptr
 
size_t mHostMemorySize = 0
 
size_t mHostMemoryUsedMax = 0
 
voidmDeviceMemoryBase = nullptr
 
voidmDeviceMemoryPermanent = nullptr
 
voidmDeviceMemoryPool = nullptr
 
voidmDeviceMemoryPoolEnd = nullptr
 
voidmDeviceMemoryPoolBlocked = nullptr
 
size_t mDeviceMemorySize = 0
 
voidmVolatileMemoryStart = nullptr
 
size_t mDeviceMemoryUsedMax = 0
 
std::unordered_set< const void * > mRegisteredMemoryPtrs
 
GPUReconstructionmMaster = nullptr
 
std::vector< GPUReconstruction * > mSlaves
 
bool mInitialized = false
 
uint32_t mStatNEvents = 0
 
uint32_t mNEventsProcessed = 0
 
double mStatKernelTime = 0.
 
double mStatWallTime = 0.
 
double mStatCPUTime = 0.
 
std::shared_ptr< GPUROOTDumpCoremROOTDump
 
std::vector< std::array< uint32_t, 4 > > * mOutputErrorCodes = nullptr
 
int32_t mMaxBackendThreads = 0
 
int32_t mGPUStuck = 0
 
int32_t mNStreams = 1
 
int32_t mMaxHostThreads = 0
 
std::vector< ProcessorDatamProcessors
 
std::unordered_map< GPUMemoryReuse::ID, MemoryReuseMetamMemoryReuse1to1
 
std::vector< std::tuple< void *, void *, size_t, uint64_t > > mNonPersistentMemoryStack
 
std::vector< GPUMemoryResource * > mNonPersistentIndividualAllocations
 
std::unique_ptr< GPUReconstructionPipelineContextmPipelineContext
 

Additional Inherited Members

- Public Types inherited from o2::gpu::GPUReconstruction
enum  InOutPointerType : uint32_t {
  CLUSTER_DATA = 0 , SECTOR_OUT_TRACK = 1 , SECTOR_OUT_CLUSTER = 2 , MC_LABEL_TPC = 3 ,
  MC_INFO_TPC = 4 , MERGED_TRACK = 5 , MERGED_TRACK_HIT = 6 , TRD_TRACK = 7 ,
  TRD_TRACKLET = 8 , RAW_CLUSTERS = 9 , CLUSTERS_NATIVE = 10 , TRD_TRACKLET_MC = 11 ,
  TPC_COMPRESSED_CL = 12 , TPC_DIGIT = 13 , TPC_ZS = 14 , CLUSTER_NATIVE_MC = 15 ,
  TPC_DIGIT_MC = 16 , TRD_SPACEPOINT = 17 , TRD_TRIGGERRECORDS = 18 , TF_SETTINGS = 19
}
 
enum class  krnlDeviceType : int32_t { CPU = 0 , Device = 1 , Auto = -1 }
 
using GeometryType = GPUDataTypes::GeometryType
 
using DeviceType = GPUDataTypes::DeviceType
 
using RecoStep = GPUDataTypes::RecoStep
 
using GeneralStep = GPUDataTypes::GeneralStep
 
using RecoStepField = GPUDataTypes::RecoStepField
 
using InOutTypeField = GPUDataTypes::InOutTypeField
 
- Public Attributes inherited from o2::gpu::GPUReconstruction
std::shared_ptr< GPUReconstructionThreadingmThreading
 
- Static Public Attributes inherited from o2::gpu::GPUReconstruction
static constexpr uint32_t NSECTORS = GPUCA_NSECTORS
 
static constexpr const char *const GEOMETRY_TYPE_NAMES [] = {"INVALID", "ALIROOT", "O2"}
 
static constexpr GeometryType geometryType = GeometryType::ALIROOT
 
static constexpr const char *const IOTYPENAMES []
 
- Static Protected Member Functions inherited from o2::gpu::GPUReconstruction
static std::shared_ptr< LibraryLoader > * GetLibraryInstance (DeviceType type, bool verbose)
 
static GPUReconstructionGPUReconstruction_Create_CPU (const GPUSettingsDeviceBackend &cfg)
 
- Static Protected Attributes inherited from o2::gpu::GPUReconstruction
static std::shared_ptr< LibraryLoadersLibCUDA
 
static std::shared_ptr< LibraryLoadersLibHIP
 
static std::shared_ptr< LibraryLoadersLibOCL
 

Detailed Description

Definition at line 62 of file GPUReconstructionProcessing.h.

Member Typedef Documentation

◆ deviceEvent

Constructor & Destructor Documentation

◆ ~GPUReconstructionProcessing()

o2::gpu::GPUReconstructionProcessing::~GPUReconstructionProcessing ( )
overridedefault

◆ GPUReconstructionProcessing()

o2::gpu::GPUReconstructionProcessing::GPUReconstructionProcessing ( const GPUSettingsDeviceBackend cfg)
inlineprotected

Definition at line 100 of file GPUReconstructionProcessing.h.

Member Function Documentation

◆ AddGPUEvents()

template<class T >
void o2::gpu::GPUReconstructionProcessing::AddGPUEvents ( T *&  events)
inline

Definition at line 136 of file GPUReconstructionProcessing.h.

◆ getGeneralStepTimer()

HighResTimer & o2::gpu::GPUReconstructionProcessing::getGeneralStepTimer ( GeneralStep  step)
inline

Definition at line 81 of file GPUReconstructionProcessing.h.

◆ GetKernelName()

template<class T , int32_t I>
static constexpr const char * o2::gpu::GPUReconstructionProcessing::GetKernelName ( )
staticconstexpr

◆ getKernelTimer()

template<class T , int32_t I>
HighResTimer & o2::gpu::GPUReconstructionProcessing::getKernelTimer ( RecoStep  step,
int32_t  num = 0,
size_t  addMemorySize = 0,
bool  increment = true 
)
protected

Definition at line 143 of file GPUReconstructionProcessing.h.

◆ getNActiveThreadsOuterLoop()

uint32_t o2::gpu::GPUReconstructionProcessing::getNActiveThreadsOuterLoop ( ) const
inline

Definition at line 69 of file GPUReconstructionProcessing.h.

◆ getNKernelHostThreads()

int32_t GPUReconstructionProcessing::getNKernelHostThreads ( bool  splitCores)

Definition at line 20 of file GPUReconstructionProcessing.cxx.

◆ getRecoStepTimer()

auto & o2::gpu::GPUReconstructionProcessing::getRecoStepTimer ( RecoStep  step)
inline

Definition at line 80 of file GPUReconstructionProcessing.h.

◆ GetThreadContext()

std::unique_ptr< gpu_reconstruction_kernels::threadContext > GPUReconstructionProcessing::GetThreadContext ( )
overridevirtual

Implements o2::gpu::GPUReconstruction.

Reimplemented in o2::gpu::GPUReconstructionCUDA.

Definition at line 113 of file GPUReconstructionProcessing.cxx.

◆ getTimer()

template<class T , int32_t J>
HighResTimer & o2::gpu::GPUReconstructionProcessing::getTimer ( const char name,
int32_t  num = -1 
)
protected

Definition at line 160 of file GPUReconstructionProcessing.h.

◆ runParallelOuterLoop()

void GPUReconstructionProcessing::runParallelOuterLoop ( bool  doGPU,
uint32_t  nThreads,
std::function< void(uint32_t)>  lambda 
)

Definition at line 46 of file GPUReconstructionProcessing.cxx.

◆ SetAndGetNActiveThreadsOuterLoop()

uint32_t GPUReconstructionProcessing::SetAndGetNActiveThreadsOuterLoop ( bool  condition,
uint32_t  max 
)

Definition at line 100 of file GPUReconstructionProcessing.cxx.

◆ SetNActiveThreads()

void GPUReconstructionProcessing::SetNActiveThreads ( int32_t  n)

Definition at line 37 of file GPUReconstructionProcessing.cxx.

◆ SetNActiveThreadsOuterLoop()

void o2::gpu::GPUReconstructionProcessing::SetNActiveThreadsOuterLoop ( uint32_t  f)
inline

Definition at line 70 of file GPUReconstructionProcessing.h.

Member Data Documentation

◆ mActiveHostKernelThreads

int32_t o2::gpu::GPUReconstructionProcessing::mActiveHostKernelThreads = 0
protected

Definition at line 103 of file GPUReconstructionProcessing.h.

◆ mEvents

std::vector<std::vector<deviceEvent> > o2::gpu::GPUReconstructionProcessing::mEvents
protected

Definition at line 106 of file GPUReconstructionProcessing.h.

◆ mNActiveThreadsOuterLoop

uint32_t o2::gpu::GPUReconstructionProcessing::mNActiveThreadsOuterLoop = 1
protected

Definition at line 104 of file GPUReconstructionProcessing.h.

◆ mTimers

std::vector<std::unique_ptr<timerMeta> > o2::gpu::GPUReconstructionProcessing::mTimers
protected

Definition at line 121 of file GPUReconstructionProcessing.h.

◆ mTimersGeneralSteps

HighResTimer o2::gpu::GPUReconstructionProcessing::mTimersGeneralSteps[GPUDataTypes::N_GENERAL_STEPS]
protected

Definition at line 119 of file GPUReconstructionProcessing.h.

◆ mTimersRecoSteps

RecoStepTimerMeta o2::gpu::GPUReconstructionProcessing::mTimersRecoSteps[GPUDataTypes::N_RECO_STEPS]
protected

Definition at line 122 of file GPUReconstructionProcessing.h.

◆ mTimerTotal

HighResTimer o2::gpu::GPUReconstructionProcessing::mTimerTotal
protected

Definition at line 123 of file GPUReconstructionProcessing.h.


The documentation for this class was generated from the following files: