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 "GPUCommonDef.h"
19
20#include "GPUTPCTracker.h"
21#include "GPUParam.h"
22#include "GPUDataTypesIO.h"
23#include "GPUErrors.h"
24
25#include "GPUTPCGMMerger.h"
26#include "GPUTRDTracker.h"
27
28#include "GPUTPCCompression.h"
29#include "GPUTPCDecompression.h"
30#include "GPUTPCClusterFinder.h"
31#include "GPUTrackingRefit.h"
32
33#ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT
35#endif
36
37#ifdef GPUCA_HAS_ONNX
38#include "GPUTPCNNClusterizer.h"
39#endif
40
41namespace o2::gpu
42{
45 GPUTPCTracker tpcTrackers[GPUTPCGeometry::NSECTORS];
51 GPUTPCClusterFinder tpcClusterer[GPUTPCGeometry::NSECTORS];
56#ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT
57 GPUKernelDebugOutput debugOutput;
58#endif
59#ifdef GPUCA_HAS_ONNX
60 GPUTPCNNClusterizer tpcNNClusterer[GPUTPCGeometry::NSECTORS];
61#endif
62 template <int32_t I>
63 GPUd() auto& getTRDTracker();
64};
65
66template <>
67GPUdi() auto& GPUConstantMem::getTRDTracker<0>()
68{
69 return trdTrackerGPU;
70}
71template <>
72GPUdi() auto& GPUConstantMem::getTRDTracker<1>()
73{
74 return trdTrackerO2;
75}
76
78#if !defined(__OPENCL__) || defined(__OPENCL_HOST__)
79 GPUh() GPUConstantMemCopyable() {} // NOLINT: We want an empty constructor, not a default one
80 GPUh() ~GPUConstantMemCopyable() {} // NOLINT: We want an empty destructor, not a default one
82 {
83 for (uint32_t k = 0; k < sizeof(GPUConstantMem) / sizeof(int32_t); k++) {
84 ((int32_t*)&v)[k] = ((int32_t*)&o.v)[k];
85 }
86 }
87#endif
89};
90
91#if defined(GPUCA_GPUCODE)
92static GPUglobalconstexpr() size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1);
93#endif
94} // namespace o2::gpu
95#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
96GPUconstant() o2::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer; // TODO: This should go into o2::gpu namespace, but then CUDA or HIP would not find the symbol
97#endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
98namespace o2::gpu
99{
100
101// Must be placed here, to avoid circular header dependency
102GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
103{
104#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
105 return &GPUCA_CONSMEM;
106#else
107 return mConstantMem;
108#endif
109}
110
111GPUdi() GPUconstantref() const GPUParam& GPUProcessor::Param() const
112{
113 return GetConstantMem()->param;
114}
115
116GPUdi() void GPUProcessor::raiseError(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3) const
117{
118 GetConstantMem()->errorCodes.raiseError(code, param1, param2, param3);
119}
120
121} // namespace o2::gpu
122
123#endif
#define GPUconstantref()
#define GPUconstant()
#define GPUCA_CONSMEM
Online TRD tracker based on extrapolated TPC tracks.
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GPUglobalconstexpr() float MaxSinPhi=0.999f
Definition CfChargePos.h:61
GPUdi() o2
Definition TrackTRD.h:39
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
GPUTRDTrackerGPU trdTrackerGPU
GPUTPCDecompression tpcDecompressor
GPUTPCTracker tpcTrackers[GPUTPCGeometry::NSECTORS]
GPUTrackingRefitProcessor trackingRefit
GPUCalibObjectsConst calibObjects
GPUTPCClusterFinder tpcClusterer[GPUTPCGeometry::NSECTORS]
GPUd() auto &getTRDTracker()
GPUTrackingInOutPointers ioPtrs
GPUTPCCompression tpcCompressor
GPUh() GPUConstantMemCopyable(const GPUConstantMemCopyable &o)
GPUh() GPUConstantMemCopyable()
GPUh() ~GPUConstantMemCopyable()