Project
Loading...
Searching...
No Matches
GPUConstantMem.h
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#ifndef GPUCONSTANTMEM_H
16#define GPUCONSTANTMEM_H
17
18#include "GPUTPCTracker.h"
19#include "GPUParam.h"
20#include "GPUDataTypes.h"
21#include "GPUErrors.h"
22
23#include "GPUTPCGMMerger.h"
24#include "GPUTRDTracker.h"
25
26#include "GPUTPCConvert.h"
27#include "GPUTPCCompression.h"
28#include "GPUTPCDecompression.h"
29#include "GPUITSFitter.h"
30#include "GPUTPCClusterFinder.h"
31#include "GPUTrackingRefit.h"
32
33#ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT
35#endif
36
37namespace o2::gpu
38{
62
63template <>
64GPUdi() auto& GPUConstantMem::getTRDTracker<0>()
65{
66 return trdTrackerGPU;
67}
68template <>
69GPUdi() auto& GPUConstantMem::getTRDTracker<1>()
70{
71 return trdTrackerO2;
72}
73
75#if !defined(__OPENCL__) || defined(__OPENCL_HOST__)
76 GPUh() GPUConstantMemCopyable() {} // NOLINT: We want an empty constructor, not a default one
77 GPUh() ~GPUConstantMemCopyable() {} // NOLINT: We want an empty destructor, not a default one
79 {
80 for (uint32_t k = 0; k < sizeof(GPUConstantMem) / sizeof(int32_t); k++) {
81 ((int32_t*)&v)[k] = ((int32_t*)&o.v)[k];
82 }
83 }
84#endif
86};
87
88#if defined(GPUCA_GPUCODE)
89static constexpr size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1);
90#endif
91} // namespace o2::gpu
92#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM) && !defined(GPUCA_GPUCODE_HOSTONLY)
93GPUconstant() o2::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer;
94#endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
95namespace o2::gpu
96{
97
98// Must be placed here, to avoid circular header dependency
99GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
100{
101#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM) && !defined(GPUCA_GPUCODE_HOSTONLY)
102 return &GPUCA_CONSMEM;
103#else
104 return mConstantMem;
105#endif
106}
107
108GPUdi() GPUconstantref() const GPUParam& GPUProcessor::Param() const
109{
110 return GetConstantMem()->param;
111}
112
113GPUdi() void GPUProcessor::raiseError(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3) const
114{
115 GetConstantMem()->errorCodes.raiseError(code, param1, param2, param3);
116}
117
118} // namespace o2::gpu
119
120#endif
#define GPUconstantref()
#define GPUconstant()
#define GPUCA_CONSMEM
bool o
#define GPUCA_NSECTORS
Online TRD tracker based on extrapolated TPC tracks.
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GPUdi() o2
Definition TrackTRD.h:38
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUTRDTrackerGPU trdTrackerGPU
GPUTPCDecompression tpcDecompressor
GPUTPCTracker tpcTrackers[GPUCA_NSECTORS]
GPUTrackingRefitProcessor trackingRefit
GPUTPCClusterFinder tpcClusterer[GPUCA_NSECTORS]
GPUCalibObjectsConst calibObjects
GPUd() auto &getTRDTracker()
GPUTrackingInOutPointers ioPtrs
GPUTPCCompression tpcCompressor
GPUh() GPUConstantMemCopyable(const GPUConstantMemCopyable &o)
GPUh() GPUConstantMemCopyable()
GPUh() ~GPUConstantMemCopyable()