Project
Loading...
Searching...
No Matches
GPUChainTrackingRefit.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 "GPUChainTracking.h"
16#include "GPUChainTrackingGetters.inc"
17#include "GPULogging.h"
18#include "GPUO2DataTypes.h"
19#include "GPUTrackingRefit.h"
20#include "GPUConstantMem.h"
22
23using namespace o2::gpu;
24
26{
27 bool doGPU = GetRecoStepsGPU() & RecoStep::Refit;
29 GPUTrackingRefitProcessor& RefitShadow = doGPU ? processorsShadow()->trackingRefit : Refit;
30
31 const auto& threadContext = GetThreadContext();
32 (void)threadContext;
33 SetupGPUProcessor(&Refit, false);
34 RefitShadow.SetPtrsFromGPUConstantMem(processorsShadow(), doGPU ? &processorsDevice()->param : nullptr);
36 RefitShadow.mPTracks = (doGPU ? processorsShadow() : processors())->tpcMerger.OutputTracks();
37 WriteToConstantMemory(RecoStep::Refit, (char*)&processors()->trackingRefit - (char*)processors(), &RefitShadow, sizeof(RefitShadow), 0);
38 // TransferMemoryResourcesToGPU(RecoStep::Refit, &Refit, 0);
39 if (param().rec.trackingRefitGPUModel) {
40 runKernel<GPUTrackingRefitKernel, GPUTrackingRefitKernel::mode0asGPU>(GetGrid(mIOPtrs.nMergedTracks, 0));
41 } else {
42 runKernel<GPUTrackingRefitKernel, GPUTrackingRefitKernel::mode1asTrackParCov>(GetGrid(mIOPtrs.nMergedTracks, 0));
43 }
44 // TransferMemoryResourcesToHost(RecoStep::Refit, &Refit, 0);
46 return 0;
47}
const o2::base::Propagator * GetO2Propagator() const
GPUTrackingInOutPointers & mIOPtrs
GPUConstantMem * processorsDevice()
Definition GPUChain.h:85
GPUReconstruction::RecoStepField GetRecoStepsGPU() const
Definition GPUChain.h:71
void WriteToConstantMemory(RecoStep step, size_t offset, const void *src, size_t size, int32_t stream=-1, deviceEvent *ev=nullptr)
Definition GPUChain.h:126
virtual std::unique_ptr< GPUReconstructionProcessing::threadContext > GetThreadContext()
Definition GPUChain.h:108
GPUConstantMem * processors()
Definition GPUChain.h:83
GPUParam & param()
Definition GPUChain.h:86
void SetupGPUProcessor(T *proc, bool allocate)
Definition GPUChain.h:219
void SynchronizeStream(int32_t stream)
Definition GPUChain.h:88
GPUConstantMem * processorsShadow()
Definition GPUChain.h:84
krnlExec GetGrid(uint32_t totalItems, uint32_t nThreads, int32_t stream, GPUReconstruction::krnlDeviceType d=GPUReconstruction::krnlDeviceType::Auto, GPUDataTypes::RecoStep st=GPUDataTypes::RecoStep::NoRecoStep)
Definition GPUChain.cxx:21
GPUReconstruction * rec()
Definition GPUChain.h:65
void SetPtrsFromGPUConstantMem(const GPUConstantMem *v, GPUParam *p=nullptr)
void SetPropagator(const o2::base::Propagator *v)
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
S< o2::base::PropagatorImpl< float > >::type * o2Propagator
GPUTrackingRefitProcessor trackingRefit
GPUCalibObjectsConst calibObjects