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"
19#include <algorithm>
20
21using namespace o2::gpu;
22
23namespace o2::its
24{
26{
27 public:
28 void* allocate(size_t size) override
29 {
31 }
32
34
35 private:
37};
38} // namespace o2::its
39
45
46GPUChainITS::GPUChainITS(GPUReconstruction* rec, uint32_t maxTracks) : GPUChain(rec), mMaxTracks(maxTracks) {}
47
49
51{
52 if (GetRecoStepsGPU() & RecoStep::ITSTracking) {
53 mRec->RegisterGPUDeviceProcessor(&processorsShadow()->itsFitter, &processors()->itsFitter);
54 }
55}
56
57void GPUChainITS::MemorySize(size_t& gpuMem, size_t& pageLockedHostMem)
58{
59 gpuMem = mMaxTracks * sizeof(GPUITSTrack) + GPUCA_MEMALIGN;
60 pageLockedHostMem = gpuMem;
61}
62
63int32_t GPUChainITS::Init() { return 0; }
64
66{
67 if (mITSTrackerTraits == nullptr) {
68 mRec->GetITSTraits(&mITSTrackerTraits, nullptr, nullptr);
69 }
70 return mITSTrackerTraits.get();
71}
72
74{
75 if (mITSVertexerTraits == nullptr) {
76 mRec->GetITSTraits(nullptr, &mITSVertexerTraits, nullptr);
77 }
78 return mITSVertexerTraits.get();
79}
80
82{
83 if (mITSTimeFrame == nullptr) {
84 mRec->GetITSTraits(nullptr, nullptr, &mITSTimeFrame);
85 }
86#if !defined(GPUCA_STANDALONE)
87 if (mITSTimeFrame->mIsGPU) {
88 auto doFWExtAlloc = [this](size_t size) -> void* { return rec()->AllocateUnmanagedMemory(size, GPUMemoryResource::MEMORY_GPU); };
89
91 mFrameworkAllocator->setReconstructionFramework(rec());
92 mITSTimeFrame->setExternalAllocator(mFrameworkAllocator.get());
93 }
94#endif
95 return mITSTimeFrame.get();
96}
97
98int32_t GPUChainITS::PrepareEvent() { return 0; }
99
100int32_t GPUChainITS::Finalize() { return 0; }
101
102int32_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:68
GPUConstantMem * processors()
Definition GPUChain.h:80
GPUReconstructionCPU * mRec
Definition GPUChain.h:75
GPUConstantMem * processorsShadow()
Definition GPUChain.h:81
GPUReconstruction * rec()
Definition GPUChain.h:62
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 * AllocateUnmanagedMemory(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