Project
Loading...
Searching...
No Matches
GPUChainITS.cxx
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#include "GPUChainITS.h"
16#include "GPUConstantMem.h"
20#include <algorithm>
21
22using namespace o2::gpu;
23
24namespace o2::its
25{
27{
28 public:
29 void* allocate(size_t size) override
30 {
32 }
33
35
36 private:
38};
39} // namespace o2::its
40
46
47GPUChainITS::GPUChainITS(GPUReconstruction* rec, uint32_t maxTracks) : GPUChain(rec), mMaxTracks(maxTracks) {}
48
50
52{
53 if (GetRecoStepsGPU() & RecoStep::ITSTracking) {
54 mRec->RegisterGPUDeviceProcessor(&processorsShadow()->itsFitter, &processors()->itsFitter);
55 }
56}
57
58void GPUChainITS::MemorySize(size_t& gpuMem, size_t& pageLockedHostMem)
59{
60 gpuMem = mMaxTracks * sizeof(GPUITSTrack) + GPUCA_MEMALIGN;
61 pageLockedHostMem = gpuMem;
62}
63
64int32_t GPUChainITS::Init() { return 0; }
65
67{
68 if (mITSTrackerTraits == nullptr) {
69 mRec->GetITSTraits(&mITSTrackerTraits, nullptr, nullptr);
70 }
71 return mITSTrackerTraits.get();
72}
73
75{
76 if (mITSVertexerTraits == nullptr) {
77 mRec->GetITSTraits(nullptr, &mITSVertexerTraits, nullptr);
78 }
79 return mITSVertexerTraits.get();
80}
81
83{
84 if (mITSTimeFrame == nullptr) {
85 mRec->GetITSTraits(nullptr, nullptr, &mITSTimeFrame);
86 }
87#if !defined(GPUCA_STANDALONE)
88 if (mITSTimeFrame->mIsGPU) {
89 auto doFWExtAlloc = [this](size_t size) -> void* { return rec()->AllocateDirectMemory(size, GPUMemoryResource::MEMORY_GPU); };
90
92 mFrameworkAllocator->setReconstructionFramework(rec());
93 mITSTimeFrame->setExternalAllocator(mFrameworkAllocator.get());
94 }
95#endif
96 return mITSTimeFrame.get();
97}
98
99int32_t GPUChainITS::PrepareEvent() { return 0; }
100
101int32_t GPUChainITS::Finalize() { return 0; }
102
103int32_t GPUChainITS::RunChain() { return 0; }
#define GPUCA_MEMALIGN
Definition of the ITS track.
void RegisterPermanentMemoryAndProcessors() override
std::unique_ptr< o2::its::TrackerTraits > mITSTrackerTraits
Definition GPUChainITS.h:52
void MemorySize(size_t &gpuMem, size_t &pageLockedHostMem) override
int32_t RunChain() override
int32_t PrepareEvent() override
std::unique_ptr< o2::its::GPUFrameworkExternalAllocator > mFrameworkAllocator
Definition GPUChainITS.h:55
o2::its::VertexerTraits * GetITSVertexerTraits()
void RegisterGPUProcessors() override
std::unique_ptr< o2::its::TimeFrame > mITSTimeFrame
Definition GPUChainITS.h:54
int32_t Init() override
o2::its::TimeFrame * GetITSTimeframe()
o2::its::TrackerTraits * GetITSTrackerTraits()
int32_t Finalize() override
GPUChainITS(GPUReconstruction *rec, uint32_t maxTracks=GPUCA_MAX_ITS_FIT_TRACKS)
std::unique_ptr< o2::its::VertexerTraits > mITSVertexerTraits
Definition GPUChainITS.h:53
GPUReconstruction::RecoStepField GetRecoStepsGPU() const
Definition GPUChain.h:71
GPUConstantMem * processors()
Definition GPUChain.h:83
GPUReconstructionCPU * mRec
Definition GPUChain.h:78
GPUConstantMem * processorsShadow()
Definition GPUChain.h:84
GPUReconstruction * rec()
Definition GPUChain.h:65
void RegisterGPUDeviceProcessor(GPUProcessor *proc, GPUProcessor *slaveProcessor)
virtual void GetITSTraits(std::unique_ptr< o2::its::TrackerTraits > *trackerTraits, std::unique_ptr< o2::its::VertexerTraits > *vertexerTraits, std::unique_ptr< o2::its::TimeFrame > *timeFrame)
void RegisterGPUProcessor(T *proc, bool deviceSlave)
void * AllocateDirectMemory(size_t size, int32_t type)
void setReconstructionFramework(o2::gpu::GPUReconstruction *fwr)
void * allocate(size_t size) override
GLsizeiptr size
Definition glcorearb.h:659
GPUReconstruction * rec