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