Project
Loading...
Searching...
No Matches
CfArray2D.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 O2_GPU_ARRAY2D_H
16#define O2_GPU_ARRAY2D_H
17
18#include "clusterFinderDefs.h"
19#include "CfChargePos.h"
20
21namespace o2::gpu
22{
23
24template <typename T, typename Layout>
26{
27
28 public:
29 GPUdi() explicit AbstractCfArray2D(T* d) : data(d) {}
30
31 GPUdi() T& operator[](const CfChargePos& p) { return data[Layout::idx(p)]; }
32 GPUdi() const T& operator[](const CfChargePos& p) const { return data[Layout::idx(p)]; }
33
34 GPUdi() void safeWrite(const CfChargePos& p, const T& v)
35 {
36 if (data != nullptr) {
37 (*this)[p] = v;
38 }
39 }
40
41 private:
42 T* data;
43};
44
45template <typename Grid>
47{
48 public:
49 enum {
50 Height = Grid::Height,
51 Width = Grid::Width,
53 };
54
55 GPUdi() static tpccf::SizeT idx(const CfChargePos& p)
56 {
57 const tpccf::SizeT tilePad = p.gpad / Width;
58 const tpccf::SizeT tileTime = p.timePadded / Height;
59
60 const tpccf::SizeT inTilePad = p.gpad % Width;
61 const tpccf::SizeT inTileTime = p.timePadded % Height;
62
63 return (tileTime * WidthInTiles + tilePad) * (Width * Height) + inTileTime * Width + inTilePad;
64 }
65
66 GPUd() static size_t items(size_t fragmentLen)
67 {
69 }
70};
71
73{
74 public:
75 GPUdi() static tpccf::SizeT idx(const CfChargePos& p)
76 {
77 return TPC_CLUSTERER_STRIDED_PAD_COUNT * p.timePadded + p.gpad;
78 }
79
80 GPUd() static size_t items(size_t fragmentLen)
81 {
83 }
84};
85
86template <tpccf::SizeT S>
87struct GridSize;
88
89template <>
90struct GridSize<1> {
91 enum {
92 Width = 8,
93 Height = 8,
94 };
95};
96
97template <>
98struct GridSize<2> {
99 enum {
100 Width = 8,
101 Height = 4,
102 };
103};
104
105template <>
106struct GridSize<4> {
107 enum {
108 Width = 4,
109 Height = 4,
110 };
111};
112
113#if defined(CHARGEMAP_TILING_LAYOUT)
114template <typename T>
115using TPCMapMemoryLayout = TilingLayout<GridSize<sizeof(T)>>;
116#else
117template <typename T>
119#endif
120
121template <typename T>
123
124} // namespace o2::gpu
125
126#endif
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
GPUdi() explicit AbstractCfArray2D(T *d)
Definition CfArray2D.h:29
GPUdi() T &operator[](const CfChargePos &p)
Definition CfArray2D.h:31
GPUdi() void safeWrite(const CfChargePos &p
GPUdi() const T &operator[](const CfChargePos &p) const
Definition CfArray2D.h:32
GPUdi() static tpccf
Definition CfArray2D.h:75
GPUd() static size_t items(size_t fragmentLen)
Definition CfArray2D.h:80
GPUdi() static tpccf
Definition CfArray2D.h:55
GPUd() static size_t items(size_t fragmentLen)
Definition CfArray2D.h:66
#define TPC_CLUSTERER_STRIDED_PAD_COUNT
#define TPC_MAX_FRAGMENT_LEN_PADDED(size)
const GLdouble * v
Definition glcorearb.h:832
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
LinearLayout TPCMapMemoryLayout
Definition CfArray2D.h:118