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 "GPULogging.h"
17#include "GPUO2DataTypes.h"
18
19using namespace o2::gpu;
20
22{
23 bool doGPU = GetRecoStepsGPU() & RecoStep::Refit;
26
27 const auto& threadContext = GetThreadContext();
28 (void)threadContext;
29 SetupGPUProcessor(&Refit, false);
30 RefitShadow.SetPtrsFromGPUConstantMem(processorsShadow(), doGPU ? &processorsDevice()->param : nullptr);
32 RefitShadow.mPTracks = (doGPU ? processorsShadow() : processors())->tpcMerger.OutputTracks();
33 WriteToConstantMemory(RecoStep::Refit, (char*)&processors()->trackingRefit - (char*)processors(), &RefitShadow, sizeof(RefitShadow), 0);
34 //TransferMemoryResourcesToGPU(RecoStep::Refit, &Refit, 0);
35 if (param().rec.trackingRefitGPUModel) {
36 runKernel<GPUTrackingRefitKernel, GPUTrackingRefitKernel::mode0asGPU>(GetGrid(mIOPtrs.nMergedTracks, 0));
37 } else {
38 runKernel<GPUTrackingRefitKernel, GPUTrackingRefitKernel::mode1asTrackParCov>(GetGrid(mIOPtrs.nMergedTracks, 0));
39 }
40 //TransferMemoryResourcesToHost(RecoStep::Refit, &Refit, 0);
42 return 0;
43}
Refit
const o2::base::Propagator * GetO2Propagator() const
GPUTrackingInOutPointers & mIOPtrs
GPUConstantMem * processorsDevice()
Definition GPUChain.h:82
GPUReconstruction::RecoStepField GetRecoStepsGPU() const
Definition GPUChain.h:68
virtual std::unique_ptr< gpu_reconstruction_kernels::threadContext > GetThreadContext()
Definition GPUChain.h:104
void WriteToConstantMemory(RecoStep step, size_t offset, const void *src, size_t size, int32_t stream=-1, deviceEvent *ev=nullptr)
Definition GPUChain.h:122
GPUConstantMem * processors()
Definition GPUChain.h:80
GPUParam & param()
Definition GPUChain.h:83
void SetupGPUProcessor(T *proc, bool allocate)
Definition GPUChain.h:212
void SynchronizeStream(int32_t stream)
Definition GPUChain.h:85
GPUConstantMem * processorsShadow()
Definition GPUChain.h:81
krnlExec GetGrid(uint32_t totalItems, uint32_t nThreads, int32_t stream, GPUReconstruction::krnlDeviceType d=GPUReconstruction::krnlDeviceType::Auto, GPUCA_RECO_STEP st=GPUCA_RECO_STEP::NoRecoStep)
Definition GPUChain.cxx:21
GPUReconstruction * rec()
Definition GPUChain.h:62
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