]>
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 | { |
e26f1a08 | 34 | friend class AliHLTTPCCATrackletConstructor; // friend class |
fbb9b71b | 35 | public: |
00d07bcd | 36 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 37 | AliHLTTPCCASharedMemory() |
29c1026e | 38 | : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletStupidDummy(0), fNextTrackletFirstRun(0), fNTracklets(0) { |
39 | for( int i=0; i<HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1; i++)fStartRows[i] = 0; | |
40 | for( int i=0; i<HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1; i++) fEndRows[i]=0; | |
41 | } | |
fbb9b71b | 42 | |
43 | AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ ) | |
29c1026e | 44 | : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletStupidDummy(0), fNextTrackletFirstRun(0), fNTracklets(0) { |
45 | for( int i=0; i<HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1; i++)fStartRows[i] = 0; | |
46 | for( int i=0; i<HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1; i++) fEndRows[i]=0; | |
47 | } | |
48 | ||
49 | AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; } | |
31649d4b | 50 | #endif //HLTCA_GPUCODE |
7be9b0d7 | 51 | |
fbb9b71b | 52 | protected: |
e26f1a08 | 53 | AliHLTTPCCARow fRows[HLTCA_ROW_COUNT]; // rows |
1e63725a | 54 | int fNextTrackletFirst; //First tracklet to be processed by CUDA block during next iteration |
55 | int fNextTrackletCount; //Number of Tracklets to be processed by CUDA block during next iteration | |
56 | int fNextTrackletStupidDummy; //Shared Dummy variable to access | |
57 | int fNextTrackletFirstRun; //First run for dynamic scheduler? | |
58 | int fNTracklets; // Total number of tracklets | |
b22af1bf | 59 | |
e26f1a08 | 60 | int fStartRows[HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1]; // start rows |
61 | int fEndRows[HLTCA_GPU_THREAD_COUNT / HLTCA_GPU_WARP_SIZE + 1]; // end rows | |
f0bada7f | 62 | |
b22af1bf | 63 | #ifdef HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE |
e26f1a08 | 64 | int fMaxSync; //! to be commented by D.Rohr |
31649d4b | 65 | #endif //HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE |
7be9b0d7 | 66 | |
1e63725a | 67 | int fTrackletStoreCount[2][HLTCA_ROW_COUNT / HLTCA_GPU_SCHED_ROW_STEP + 1];//Number of tracklets to store in tracklet pool for rescheduling |
00d07bcd | 68 | }; |
69 | ||
fbb9b71b | 70 | class AliHLTTPCCAThreadMemory |
00d07bcd | 71 | { |
e26f1a08 | 72 | friend class AliHLTTPCCATrackletConstructor; //! friend class |
fbb9b71b | 73 | public: |
00d07bcd | 74 | #if !defined(HLTCA_GPUCODE) |
fbb9b71b | 75 | AliHLTTPCCAThreadMemory() |
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 | |
78 | AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/ ) | |
b22af1bf | 79 | : 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 | 80 | AliHLTTPCCAThreadMemory& operator=( const AliHLTTPCCAThreadMemory& /*dummy*/ ) { return *this; } |
31649d4b | 81 | #endif //!HLTCA_GPUCODE |
7be9b0d7 | 82 | |
fbb9b71b | 83 | protected: |
84 | int fItr; // track index | |
85 | int fFirstRow; // first row index | |
86 | int fLastRow; // last row index | |
87 | int fStartRow; // first row index | |
88 | int fEndRow; // first row index | |
89 | int fCurrIH; // indef of the current hit | |
fbb9b71b | 90 | bool fGo; // do fit/searching flag |
fbb9b71b | 91 | bool fCurrentData; // index of the current memory array |
92 | int fStage; // reco stage | |
93 | int fNHits; // n track hits | |
94 | int fNMissed; // n missed hits during search | |
95 | float fLastY; // Y of the last fitted cluster | |
96 | float fLastZ; // Z of the last fitted cluster | |
00d07bcd | 97 | }; |
98 | ||
1e63725a | 99 | //Structure to store track parameters and temporary thread variables in global memory when rescheduling |
b22af1bf | 100 | struct AliHLTTPCCAGPUTempMemory |
101 | { | |
e26f1a08 | 102 | AliHLTTPCCAThreadMemory fThreadMem;// thread memory |
103 | AliHLTTPCCATrackParam fParam;// parameters | |
b22af1bf | 104 | }; |
fbb9b71b | 105 | |
b22af1bf | 106 | GPUd() static void InitTracklet ( AliHLTTPCCATrackParam &tParam ); |
00d07bcd | 107 | |
fbb9b71b | 108 | GPUd() static void UpdateTracklet |
109 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
110 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, int iRow ); | |
111 | ||
112 | GPUd() static void StoreTracklet | |
113 | ( int nBlocks, int nThreads, int iBlock, int iThread, | |
114 | AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam ); | |
00d07bcd | 115 | |
b22af1bf | 116 | #ifdef HLTCA_GPUCODE |
f0bada7f | 117 | GPUd() static void AliHLTTPCCATrackletConstructorGPU(AliHLTTPCCATracker *pTracker); |
118 | GPUd() static void AliHLTTPCCATrackletConstructorGPUPP(AliHLTTPCCATracker *pTracker); | |
b22af1bf | 119 | GPUd() static int FetchTracklet(AliHLTTPCCATracker &tracker, AliHLTTPCCASharedMemory &sMem, int Reverse, int RowBlock, int &mustInit); |
120 | GPUd() static void AliHLTTPCCATrackletConstructorInit(int iTracklet, AliHLTTPCCATracker &tracke); | |
121 | GPUd() static void CopyTrackletTempData( AliHLTTPCCAThreadMemory &rMemSrc, AliHLTTPCCAThreadMemory &rMemDst, AliHLTTPCCATrackParam &tParamSrc, AliHLTTPCCATrackParam &tParamDst); | |
122 | #else | |
f0bada7f | 123 | GPUd() static void AliHLTTPCCATrackletConstructorCPU(AliHLTTPCCATracker &tracker); |
31649d4b | 124 | #endif //HLTCA_GPUCODE |
b22af1bf | 125 | |
fbb9b71b | 126 | GPUd() static bool SAVE() { return 1; } |
00d07bcd | 127 | }; |
128 | ||
31649d4b | 129 | #endif //ALIHLTTPCCATRACKLETCONSTRUCTOR_H |