]>
Commit | Line | Data |
---|---|---|
00d07bcd | 1 | //-*- Mode: C++ -*- |
ce565086 | 2 | // ************************************************************************ |
fbb9b71b | 3 | // This file is property of and copyright by the ALICE HLT Project * |
ce565086 | 4 | // ALICE Experiment at CERN, All rights reserved. * |
5 | // See cxx source for full Copyright notice * | |
6 | // * | |
7 | //************************************************************************* | |
00d07bcd | 8 | |
9 | #ifndef ALIHLTTPCCATRACKLETCONSTRUCTOR_H | |
10 | #define ALIHLTTPCCATRACKLETCONSTRUCTOR_H | |
11 | ||
12 | ||
13 | #include "AliHLTTPCCADef.h" | |
14 | ||
15 | /** | |
16 | * @class AliHLTTPCCATrackletConstructor | |
fbb9b71b | 17 | * |
00d07bcd | 18 | */ |
19 | class AliHLTTPCCATrackletConstructor | |
20 | { | |
fbb9b71b | 21 | public: |
00d07bcd | 22 | |
fbb9b71b | 23 | class AliHLTTPCCASharedMemory |
00d07bcd | 24 | { |
fbb9b71b | 25 | friend class AliHLTTPCCATrackletConstructor; |
26 | public: | |
00d07bcd | 27 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 28 | AliHLTTPCCASharedMemory() |
29 | : fItr0( 0 ), fItr1( 0 ), fNRows( 0 ), fUsedHits( 0 ), fMinStartRow( 0 ), fMaxStartRow( 0 ) {} | |
30 | ||
31 | AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ ) | |
32 | : fItr0( 0 ), fItr1( 0 ), fNRows( 0 ), fUsedHits( 0 ), fMinStartRow( 0 ), fMaxStartRow( 0 ) {} | |
33 | AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; } | |
00d07bcd | 34 | #endif |
fbb9b71b | 35 | protected: |
36 | uint4 fData[2][( 5000+5000+5000 )/4]; // temp memory | |
37 | int fItr0; // start track index | |
38 | int fItr1; // end track index | |
39 | int fNRows; // n rows | |
40 | int *fUsedHits; // array of used hits | |
41 | int fMinStartRow; // min start row | |
42 | int fMinStartRow32[32]; // min start row for each thread in warp | |
43 | int fMaxStartRow; // max start row | |
44 | int fMaxStartRow32[32];// max start row for each thread in warp | |
00d07bcd | 45 | }; |
46 | ||
fbb9b71b | 47 | class AliHLTTPCCAThreadMemory |
00d07bcd | 48 | { |
fbb9b71b | 49 | friend class AliHLTTPCCATrackletConstructor; |
50 | public: | |
00d07bcd | 51 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 52 | AliHLTTPCCAThreadMemory() |
53 | : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fIsMemThread( 0 ), fGo( 0 ), fSave( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {} | |
54 | ||
55 | AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/ ) | |
56 | : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fIsMemThread( 0 ), fGo( 0 ), fSave( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {} | |
57 | AliHLTTPCCAThreadMemory& operator=( const AliHLTTPCCAThreadMemory& /*dummy*/ ) { return *this; } | |
00d07bcd | 58 | #endif |
fbb9b71b | 59 | protected: |
60 | int fItr; // track index | |
61 | int fFirstRow; // first row index | |
62 | int fLastRow; // last row index | |
63 | int fStartRow; // first row index | |
64 | int fEndRow; // first row index | |
65 | int fCurrIH; // indef of the current hit | |
66 | bool fIsMemThread; // is the thread used for memory taken | |
67 | bool fGo; // do fit/searching flag | |
68 | bool fSave; // save flag | |
69 | bool fCurrentData; // index of the current memory array | |
70 | int fStage; // reco stage | |
71 | int fNHits; // n track hits | |
72 | int fNMissed; // n missed hits during search | |
73 | float fLastY; // Y of the last fitted cluster | |
74 | float fLastZ; // Z of the last fitted cluster | |
00d07bcd | 75 | }; |
76 | ||
fbb9b71b | 77 | GPUd() static int NThreadSyncPoints() { return 4 + 159*2 + 1 + 1; } |
78 | ||
79 | GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread, | |
80 | int iSync, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, | |
81 | AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); | |
00d07bcd | 82 | |
fbb9b71b | 83 | GPUd() static void Step0 |
84 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
4687b8fc | 85 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); |
fbb9b71b | 86 | GPUd() static void Step1 |
87 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
4687b8fc | 88 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); |
fbb9b71b | 89 | GPUd() static void Step2 |
90 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
4687b8fc | 91 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); |
00d07bcd | 92 | |
fbb9b71b | 93 | GPUd() static void ReadData( int iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, int iRow ); |
00d07bcd | 94 | |
fbb9b71b | 95 | GPUd() static void UpdateTracklet |
96 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
97 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, int iRow ); | |
98 | ||
99 | GPUd() static void StoreTracklet | |
100 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
101 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); | |
00d07bcd | 102 | |
fbb9b71b | 103 | GPUd() static bool SAVE() { return 1; } |
4687b8fc | 104 | |
4687b8fc | 105 | #if defined(HLTCA_GPUCODE) |
fbb9b71b | 106 | GPUhd() static int NMemThreads() { return 128; } |
4687b8fc | 107 | #else |
fbb9b71b | 108 | GPUhd() static int NMemThreads() { return 1; } |
4687b8fc | 109 | #endif |
00d07bcd | 110 | |
111 | }; | |
112 | ||
113 | ||
114 | #endif |