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 void deallocate(char* ptr, size_t) override {}
35
36 private:
38};
39} // namespace o2::its
40
46
48
49int32_t GPUChainITS::Init() { return 0; }
50
52{
53 if (mITSTrackerTraits == nullptr) {
54 mRec->GetITSTraits(&mITSTrackerTraits, nullptr, nullptr);
55 }
56 return mITSTrackerTraits.get();
57}
58
60{
61 if (mITSVertexerTraits == nullptr) {
62 mRec->GetITSTraits(nullptr, &mITSVertexerTraits, nullptr);
63 }
64 return mITSVertexerTraits.get();
65}
66
68{
69 if (mITSTimeFrame == nullptr) {
70 mRec->GetITSTraits(nullptr, nullptr, &mITSTimeFrame);
71 }
72#if !defined(GPUCA_STANDALONE)
73 if (mITSTimeFrame->mIsGPU) {
74 auto doFWExtAlloc = [this](size_t size) -> void* { return rec()->AllocateDirectMemory(size, GPUMemoryResource::MEMORY_GPU); };
75
77 mFrameworkAllocator->setReconstructionFramework(rec());
78 mITSTimeFrame->setExternalAllocator(mFrameworkAllocator.get());
79 }
80#endif
81 return mITSTimeFrame.get();
82}
83
84int32_t GPUChainITS::PrepareEvent() { return 0; }
85
86int32_t GPUChainITS::Finalize() { return 0; }
87
88int32_t GPUChainITS::RunChain() { return 0; }
TBranch * ptr
Definition of the ITS track.
GPUChainITS(GPUReconstruction *rec)
int32_t RunChain() override
int32_t PrepareEvent() override
std::unique_ptr< o2::its::GPUFrameworkExternalAllocator > mFrameworkAllocator
Definition GPUChainITS.h:56
o2::its::TimeFrame< 7 > * GetITSTimeframe()
o2::its::TrackerTraits< 7 > * GetITSTrackerTraits()
o2::its::VertexerTraits * GetITSVertexerTraits()
std::unique_ptr< o2::its::TimeFrame< 7 > > mITSTimeFrame
Definition GPUChainITS.h:55
std::unique_ptr< o2::its::TrackerTraits< 7 > > mITSTrackerTraits
Definition GPUChainITS.h:53
int32_t Init() override
int32_t Finalize() override
std::unique_ptr< o2::its::VertexerTraits > mITSVertexerTraits
Definition GPUChainITS.h:54
GPUReconstructionCPU * mRec
Definition GPUChain.h:79
GPUReconstruction * rec()
Definition GPUChain.h:66
virtual void GetITSTraits(std::unique_ptr< o2::its::TrackerTraits< 7 > > *trackerTraits, std::unique_ptr< o2::its::VertexerTraits > *vertexerTraits, std::unique_ptr< o2::its::TimeFrame< 7 > > *timeFrame)
void * AllocateDirectMemory(size_t size, int32_t type)
void setReconstructionFramework(o2::gpu::GPUReconstruction *fwr)
void * allocate(size_t size) override
void deallocate(char *ptr, size_t) override
GLsizeiptr size
Definition glcorearb.h:659
GPUReconstruction * rec