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 "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{
64
65template <>
66GPUdi() auto& GPUConstantMem::getTRDTracker<0>()
67{
68 return trdTrackerGPU;
69}
70template <>
71GPUdi() auto& GPUConstantMem::getTRDTracker<1>()
72{
73 return trdTrackerO2;
74}
75
77#if !defined(__OPENCL__) || defined(__OPENCL_HOST__)
78 GPUh() GPUConstantMemCopyable() {} // NOLINT: We want an empty constructor, not a default one
79 GPUh() ~GPUConstantMemCopyable() {} // NOLINT: We want an empty destructor, not a default one
81 {
82 for (uint32_t k = 0; k < sizeof(GPUConstantMem) / sizeof(int32_t); k++) {
83 ((int32_t*)&v)[k] = ((int32_t*)&o.v)[k];
84 }
85 }
86#endif
88};
89
90#if defined(GPUCA_GPUCODE)
91static constexpr size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1);
92#endif
93} // namespace o2::gpu
94#if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
95GPUconstant() o2::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer; // TODO: This should go into o2::gpu namespace, but then CUDA or HIP would not find the symbol
96#endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM
97namespace o2::gpu
98{
99
100// Must be placed here, to avoid circular header dependency
101GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
102{
103#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
104 return &GPUCA_CONSMEM;
105#else
106 return mConstantMem;
107#endif
108}
109
110GPUdi() GPUconstantref() const GPUParam& GPUProcessor::Param() const
111{
112 return GetConstantMem()->param;
113}
114
115GPUdi() void GPUProcessor::raiseError(uint32_t code, uint32_t param1, uint32_t param2, uint32_t param3) const
116{
117 GetConstantMem()->errorCodes.raiseError(code, param1, param2, param3);
118}
119
120} // namespace o2::gpu
121
122#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()