]>
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 | ||
b22af1bf | 12 | #ifdef HLTCA_GPUCODE |
13 | #define HLTCA_GPU_USE_INT short | |
14 | #else | |
15 | #define HLTCA_GPU_USE_INT int | |
31649d4b | 16 | #endif //HLTCA_GPUCODE |
00d07bcd | 17 | |
18 | #include "AliHLTTPCCADef.h" | |
b22af1bf | 19 | #include "AliHLTTPCCAGPUConfig.h" |
20 | #include "AliHLTTPCCATrackParam.h" | |
00d07bcd | 21 | |
22 | /** | |
23 | * @class AliHLTTPCCATrackletConstructor | |
fbb9b71b | 24 | * |
00d07bcd | 25 | */ |
b22af1bf | 26 | class AliHLTTPCCATracker; |
27 | ||
00d07bcd | 28 | class AliHLTTPCCATrackletConstructor |
29 | { | |
fbb9b71b | 30 | public: |
00d07bcd | 31 | |
fbb9b71b | 32 | class AliHLTTPCCASharedMemory |
00d07bcd | 33 | { |
fbb9b71b | 34 | friend class AliHLTTPCCATrackletConstructor; |
35 | public: | |
00d07bcd | 36 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 37 | AliHLTTPCCASharedMemory() |
b22af1bf | 38 | : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletNoDummy(0), fNextTrackletStupidDummy(0), fNextTrackletFirstRun(0), fNTracklets(0), fSliceDone(0) {} |
fbb9b71b | 39 | |
40 | AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ ) | |
b22af1bf | 41 | : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletNoDummy(0), fNextTrackletStupidDummy(0), fNextTrackletFirstRun(0), fNTracklets(0), fSliceDone(0) {} |
fbb9b71b | 42 | AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; } |
31649d4b | 43 | #endif //HLTCA_GPUCODE |
7be9b0d7 | 44 | |
fbb9b71b | 45 | protected: |
b22af1bf | 46 | #ifdef HLTCA_GPU_PREFETCHDATA |
47 | uint4 fData[2][ALIHLTTPCCATRACKLET_CONSTRUCTOR_TEMP_MEM / 4]; // temp memory | |
48 | AliHLTTPCCARow fRow[2]; // row | |
49 | #else | |
50 | AliHLTTPCCARow fRows[HLTCA_ROW_COUNT]; | |
31649d4b | 51 | #endif //HLTCA_GPU_PREFETCHDATA |
b22af1bf | 52 | int fNextTrackletFirst; |
53 | int fNextTrackletCount; | |
54 | int fNextTrackletNoDummy; | |
55 | int fNextTrackletStupidDummy; | |
56 | int fNextTrackletFirstRun; | |
57 | int fNTracklets; | |
58 | int fSliceDone; | |
59 | ||
60 | #ifdef HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE | |
61 | int fMaxSync; | |
31649d4b | 62 | #endif //HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE |
7be9b0d7 | 63 | |
b22af1bf | 64 | int fTrackletStoreCount[2][HLTCA_ROW_COUNT / HLTCA_GPU_SCHED_ROW_STEP + 1]; |
00d07bcd | 65 | }; |
66 | ||
fbb9b71b | 67 | class AliHLTTPCCAThreadMemory |
00d07bcd | 68 | { |
fbb9b71b | 69 | friend class AliHLTTPCCATrackletConstructor; |
70 | public: | |
00d07bcd | 71 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 72 | AliHLTTPCCAThreadMemory() |
b22af1bf | 73 | : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fGo( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {} |
fbb9b71b | 74 | |
75 | AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/ ) | |
b22af1bf | 76 | : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fGo( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {} |
fbb9b71b | 77 | AliHLTTPCCAThreadMemory& operator=( const AliHLTTPCCAThreadMemory& /*dummy*/ ) { return *this; } |
31649d4b | 78 | #endif //!HLTCA_GPUCODE |
7be9b0d7 | 79 | |
fbb9b71b | 80 | protected: |
81 | int fItr; // track index | |
82 | int fFirstRow; // first row index | |
83 | int fLastRow; // last row index | |
84 | int fStartRow; // first row index | |
85 | int fEndRow; // first row index | |
86 | int fCurrIH; // indef of the current hit | |
fbb9b71b | 87 | bool fGo; // do fit/searching flag |
fbb9b71b | 88 | bool fCurrentData; // index of the current memory array |
89 | int fStage; // reco stage | |
90 | int fNHits; // n track hits | |
91 | int fNMissed; // n missed hits during search | |
92 | float fLastY; // Y of the last fitted cluster | |
93 | float fLastZ; // Z of the last fitted cluster | |
00d07bcd | 94 | }; |
95 | ||
b22af1bf | 96 | struct AliHLTTPCCAGPUTempMemory |
97 | { | |
98 | AliHLTTPCCAThreadMemory fThreadMem; | |
99 | AliHLTTPCCATrackParam fParam; | |
100 | }; | |
fbb9b71b | 101 | |
b22af1bf | 102 | GPUd() static void InitTracklet ( AliHLTTPCCATrackParam &tParam ); |
00d07bcd | 103 | |
fbb9b71b | 104 | GPUd() static void ReadData( int iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, int iRow ); |
00d07bcd | 105 | |
fbb9b71b | 106 | GPUd() static void UpdateTracklet |
107 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
108 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, int iRow ); | |
109 | ||
110 | GPUd() static void StoreTracklet | |
111 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
112 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); | |
00d07bcd | 113 | |
b22af1bf | 114 | #ifdef HLTCA_GPUCODE |
115 | GPUd() static void AliHLTTPCCATrackletConstructorNewGPU(AliHLTTPCCATracker *pTracker); | |
116 | GPUd() static int FetchTracklet(AliHLTTPCCATracker &tracker, AliHLTTPCCASharedMemory &sMem, int Reverse, int RowBlock, int &mustInit); | |
117 | GPUd() static void AliHLTTPCCATrackletConstructorInit(int iTracklet, AliHLTTPCCATracker &tracke); | |
118 | GPUd() static void CopyTrackletTempData( AliHLTTPCCAThreadMemory &rMemSrc, AliHLTTPCCAThreadMemory &rMemDst, AliHLTTPCCATrackParam &tParamSrc, AliHLTTPCCATrackParam &tParamDst); | |
119 | #else | |
120 | GPUd() static void AliHLTTPCCATrackletConstructorNewCPU(AliHLTTPCCATracker &tracker); | |
31649d4b | 121 | #endif //HLTCA_GPUCODE |
b22af1bf | 122 | |
fbb9b71b | 123 | GPUd() static bool SAVE() { return 1; } |
4687b8fc | 124 | |
4687b8fc | 125 | #if defined(HLTCA_GPUCODE) |
7be9b0d7 | 126 | //GPUhd() inline int NMemThreads() { return 128; } |
b22af1bf | 127 | #define TRACKLET_CONSTRUCTOR_NMEMTHREDS HLTCA_GPU_TRACKLET_CONSTRUCTOR_NMEMTHREDS |
4687b8fc | 128 | #else |
7be9b0d7 | 129 | //GPUhd() inline int NMemThreads() { return 1; } |
130 | #define TRACKLET_CONSTRUCTOR_NMEMTHREDS 1 | |
31649d4b | 131 | #endif //!HLTCA_GPUCODE |
00d07bcd | 132 | |
133 | }; | |
134 | ||
31649d4b | 135 | #endif //ALIHLTTPCCATRACKLETCONSTRUCTOR_H |