Project
Loading...
Searching...
No Matches
GPUTPCNeighboursCleaner.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
16#include "GPUTPCTracker.h"
17#include "GPUCommonMath.h"
18using namespace o2::gpu;
19
20template <>
21GPUdii() void GPUTPCNeighboursCleaner::Thread<0>(int32_t /*nBlocks*/, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker)
22{
23 // *
24 // * kill link to the neighbour if the neighbour is not pointed to the cluster
25 // *
26
27 if (iThread == 0) {
28 s.mIRow = iBlock + 2;
29 s.mIRowUp = s.mIRow + 2;
30 s.mIRowDn = s.mIRow - 2;
31 s.mNHits = tracker.Row(s.mIRow).NHits();
32 }
33 GPUbarrier();
34
35#ifdef GPUCA_GPUCODE
36 int32_t Up = s.mIRowUp;
37 int32_t Dn = s.mIRowDn;
38 GPUglobalref() const GPUTPCRow& GPUrestrict() row = tracker.Row(s.mIRow);
39 GPUglobalref() const GPUTPCRow& GPUrestrict() rowUp = tracker.Row(Up);
40 GPUglobalref() const GPUTPCRow& GPUrestrict() rowDn = tracker.Row(Dn);
41#else
42 const GPUTPCRow& GPUrestrict() row = tracker.Row(s.mIRow);
43 const GPUTPCRow& GPUrestrict() rowUp = tracker.Row(s.mIRowUp);
44 const GPUTPCRow& GPUrestrict() rowDn = tracker.Row(s.mIRowDn);
45#endif
46
47 // - look at up link, if it's valid but the down link in the row above doesn't link to us remove
48 // the link
49 // - look at down link, if it's valid but the up link in the row below doesn't link to us remove
50 // the link
51 for (uint32_t ih = iThread; ih < s.mNHits; ih += nThreads) {
52 calink up = tracker.HitLinkUpData(row, ih);
53 if (up != CALINK_INVAL) {
54 calink upDn = tracker.HitLinkDownData(rowUp, up);
55 if ((upDn != (calink)ih)) {
56 tracker.SetHitLinkUpData(row, ih, CALINK_INVAL);
57 }
58 }
59 calink dn = tracker.HitLinkDownData(row, ih);
60 if (dn != CALINK_INVAL) {
61 calink dnUp = tracker.HitLinkUpData(rowDn, dn);
62 if (dnUp != (calink)ih) {
63 tracker.SetHitLinkDownData(row, ih, CALINK_INVAL);
64 }
65 }
66 }
67}
#define GPUsharedref()
#define GPUbarrier()
#define GPUrestrict()
#define GPUglobalref()
#define CALINK_INVAL
Definition GPUTPCDef.h:21
GPUdii() void GPUTPCNeighboursCleaner
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
uint32_t calink
Definition GPUTPCDef.h:26
std::vector< int > row