Project
Loading...
Searching...
No Matches
GPUTPCConvertKernel.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
15#include "GPUTPCConvertKernel.h"
16#include "GPUConstantMem.h"
17#include "TPCFastTransform.h"
18#include "GPUTPCClusterData.h"
19#include "GPUO2DataTypes.h"
20#include "GPUTPCConvertImpl.h"
21
22using namespace o2::gpu;
23
24template <>
25GPUdii() void GPUTPCConvertKernel::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors)
26{
27 const int32_t iSector = iBlock / GPUCA_ROW_COUNT;
28 const int32_t iRow = iBlock % GPUCA_ROW_COUNT;
29 GPUTPCConvert& GPUrestrict() convert = processors.tpcConverter;
30 const o2::tpc::ClusterNativeAccess* GPUrestrict() native = processors.ioPtrs.clustersNative;
31 GPUTPCClusterData* GPUrestrict() clusters = convert.mMemory -> clusters[iSector];
32 const int32_t idOffset = native->clusterOffset[iSector][iRow];
33 const int32_t indexOffset = native->clusterOffset[iSector][iRow] - native->clusterOffset[iSector][0];
34
35 for (uint32_t k = get_local_id(0); k < native->nClusters[iSector][iRow]; k += get_local_size(0)) {
36 const auto& GPUrestrict() clin = native -> clusters[iSector][iRow][k];
37 float x, y, z;
38 GPUTPCConvertImpl::convert(processors, iSector, iRow, clin.getPad(), clin.getTime(), x, y, z);
39 auto& GPUrestrict() clout = clusters[indexOffset + k];
40 clout.x = x;
41 clout.y = y;
42 clout.z = z;
43 clout.row = iRow;
44 clout.amp = clin.qTot;
45 clout.flags = clin.getFlags();
46 clout.id = idOffset + k;
47#ifdef GPUCA_TPC_RAW_PROPAGATE_PAD_ROW_TIME
48 clout.pad = clin.getPad();
49 clout.time = clin.getTime();
50#endif
51 }
52}
#define get_local_size(dim)
#define get_local_id(dim)
#define GPUsharedref()
#define GPUrestrict()
GPUdii() void GPUTPCConvertKernel
#define GPUCA_ROW_COUNT
Definition of TPCFastTransform class.
GLint GLenum GLint x
Definition glcorearb.h:403
GLint y
Definition glcorearb.h:270
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
unsigned int nClusters[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
unsigned int clusterOffset[constants::MAXSECTOR][constants::MAXGLOBALPADROW]
std::vector< uint64_t > convert(gsl::span< const uint64_t > page)
std::vector< Cluster > clusters