Project
Loading...
Searching...
No Matches
GPUTPCCreateOccupancyMap.cxx
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
17
18using namespace o2::gpu;
19
20template <>
21GPUdii() void GPUTPCCreateOccupancyMap::Thread<GPUTPCCreateOccupancyMap::fill>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUTPCClusterOccupancyMapBin* GPUrestrict() map)
22{
23 const GPUTrackingInOutPointers& GPUrestrict() ioPtrs = processors.ioPtrs;
25 GPUParam& GPUrestrict() param = processors.param;
26 const int32_t iSectorRow = iBlock * nThreads + iThread;
27 if (iSectorRow >= GPUCA_ROW_COUNT * GPUCA_NSECTORS) {
28 return;
29 }
30 const uint32_t iSector = iSectorRow / GPUCA_ROW_COUNT;
31 const uint32_t iRow = iSectorRow % GPUCA_ROW_COUNT;
32 for (uint32_t i = 0; i < clusters->nClusters[iSector][iRow]; i++) {
33 const uint32_t bin = clusters->clusters[iSector][iRow][i].getTime() / param.rec.tpc.occupancyMapTimeBins;
34 map[bin].bin[iSector][iRow]++;
35 }
36}
37
38template <>
39GPUdii() void GPUTPCCreateOccupancyMap::Thread<GPUTPCCreateOccupancyMap::fold>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUTPCClusterOccupancyMapBin* GPUrestrict() map, uint32_t* GPUrestrict() output)
40{
41 GPUParam& GPUrestrict() param = processors.param;
42 const uint32_t bin = iBlock * nThreads + iThread;
43 if (bin >= GPUTPCClusterOccupancyMapBin::getNBins(param)) {
44 return;
45 }
46 int32_t binmin = CAMath::Max<int32_t>(0, bin - param.rec.tpc.occupancyMapTimeBinsAverage);
47 int32_t binmax = CAMath::Min<int32_t>(GPUTPCClusterOccupancyMapBin::getNBins(param), bin + param.rec.tpc.occupancyMapTimeBinsAverage + 1);
48 uint32_t sum = 0;
49 for (int32_t i = binmin; i < binmax; i++) {
50 for (int32_t iSectorRow = 0; iSectorRow < GPUCA_NSECTORS * GPUCA_ROW_COUNT; iSectorRow++) {
51 sum += (&map[i].bin[0][0])[iSectorRow];
52 }
53 }
54 sum /= binmax - binmin;
55 output[bin] = sum;
56}
int32_t i
#define GPUsharedref()
#define GPUrestrict()
GPUdii() void GPUTPCCreateOccupancyMap
#define GPUCA_NSECTORS
#define GPUCA_ROW_COUNT
void output(const std::map< std::string, ChannelStat > &channels)
Definition rawdump.cxx:197
float sum(float s, o2::dcs::DataPointValue v)
Definition dcs-ccdb.cxx:39
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
const o2::tpc::ClusterNativeAccess * clustersNative
std::vector< Cluster > clusters