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 "GPUDataTypesIO.h"
21#include "GPUErrors.h"
22
23#include "GPUTPCGMMerger.h"
24#include "GPUTRDTracker.h"
25
26#include "GPUTPCCompression.h"
27#include "GPUTPCDecompression.h"
28#include "GPUTPCClusterFinder.h"
29#include "GPUTrackingRefit.h"
30
31#ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT
33#endif
34
35#ifdef GPUCA_HAS_ONNX
36#include "GPUTPCNNClusterizer.h"
37#endif
38
39namespace o2::gpu
40{
63
64template <>
65GPUdi() auto& GPUConstantMem::getTRDTracker<0>()
66{
67 return trdTrackerGPU;
68}
69template <>
70GPUdi() auto& GPUConstantMem::getTRDTracker<1>()
71{
72 return trdTrackerO2;
73}
74
76#if !defined(__OPENCL__) || defined(__OPENCL_HOST__)
77 GPUh() GPUConstantMemCopyable() {} // NOLINT: We want an empty constructor, not a default one
78 GPUh() ~GPUConstantMemCopyable() {} // NOLINT: We want an empty destructor, not a default one
80 {
81 for (uint32_t k = 0; k < sizeof(GPUConstantMem) / sizeof(int32_t); k++) {
82 ((int32_t*)&v)[k] = ((int32_t*)&o.v)[k];
83 }
84 }
85#endif
87};
88
89#if defined(GPUCA_GPUCODE)
90static constexpr size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1);
91#endif
92} // namespace o2::gpu
93#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
94GPUconstant() o2::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer; // TODO: This should go into o2::gpu namespace, but then CUDA or HIP would not find the symbol
95#endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
96namespace o2::gpu
97{
98
99// Must be placed here, to avoid circular header dependency
100GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
101{
102#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
103 return &GPUCA_CONSMEM;
104#else
105 return mConstantMem;
106#endif
107}
108
109GPUdi() GPUconstantref() const GPUParam& GPUProcessor::Param() const
110{
111 return GetConstantMem()->param;
112}
113
114GPUdi() void GPUProcessor::raiseError(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3) const
115{
116 GetConstantMem()->errorCodes.raiseError(code, param1, param2, param3);
117}
118
119} // namespace o2::gpu
120
121#endif
#define GPUconstantref()
#define GPUconstant()
#define GPUCA_CONSMEM
#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()