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 if (s.mIRow <= GPUCA_ROW_COUNT - 3) {
30 s.mIRowUp = s.mIRow + 2;
31 s.mIRowDn = s.mIRow - 2;
32 s.mNHits = tracker.Row(s.mIRow).NHits();
33 }
34 }
35 GPUbarrier();
36
37 if (s.mIRow <= GPUCA_ROW_COUNT - 3) {
38#ifdef GPUCA_GPUCODE
39 int32_t Up = s.mIRowUp;
40 int32_t Dn = s.mIRowDn;
41 GPUglobalref() const GPUTPCRow& GPUrestrict() row = tracker.Row(s.mIRow);
42 GPUglobalref() const GPUTPCRow& GPUrestrict() rowUp = tracker.Row(Up);
43 GPUglobalref() const GPUTPCRow& GPUrestrict() rowDn = tracker.Row(Dn);
44#else
45 const GPUTPCRow& GPUrestrict() row = tracker.Row(s.mIRow);
46 const GPUTPCRow& GPUrestrict() rowUp = tracker.Row(s.mIRowUp);
47 const GPUTPCRow& GPUrestrict() rowDn = tracker.Row(s.mIRowDn);
48#endif
49
50 // - look at up link, if it's valid but the down link in the row above doesn't link to us remove
51 // the link
52 // - look at down link, if it's valid but the up link in the row below doesn't link to us remove
53 // the link
54 for (int32_t ih = iThread; ih < s.mNHits; ih += nThreads) {
55 calink up = tracker.HitLinkUpData(row, ih);
56 if (up != CALINK_INVAL) {
57 calink upDn = tracker.HitLinkDownData(rowUp, up);
58 if ((upDn != (calink)ih)) {
59 tracker.SetHitLinkUpData(row, ih, CALINK_INVAL);
60 }
61 }
62 calink dn = tracker.HitLinkDownData(row, ih);
63 if (dn != CALINK_INVAL) {
64 calink dnUp = tracker.HitLinkUpData(rowDn, dn);
65 if (dnUp != (calink)ih) {
66 tracker.SetHitLinkDownData(row, ih, CALINK_INVAL);
67 }
68 }
69 }
70 }
71}
#define GPUsharedref()
#define GPUbarrier()
#define GPUrestrict()
#define GPUglobalref()
#define CALINK_INVAL
Definition GPUTPCDef.h:21
#define GPUCA_ROW_COUNT
GPUdii() void GPUTPCNeighboursCleaner
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
uint32_t calink
Definition GPUTPCDef.h:30
std::vector< int > row