]>
Commit | Line | Data |
---|---|---|
7be9b0d7 | 1 | // ************************************************************************ |
2 | // This file is property of and copyright by the ALICE HLT Project * | |
3 | // ALICE Experiment at CERN, All rights reserved. * | |
4 | // See cxx source for full Copyright notice * | |
5 | // * | |
6 | //************************************************************************* | |
7 | ||
b22af1bf | 8 | #ifndef ALIHLTTPCCAGPUTRACKER_H |
9 | #define ALIHLTTPCCAGPUTRACKER_H | |
10 | ||
7be9b0d7 | 11 | #include "AliHLTTPCCADef.h" |
12 | #include "AliHLTTPCCATracker.h" | |
b22af1bf | 13 | #include "AliHLTLogging.h" |
14 | ||
15 | class AliHLTTPCCARow; | |
7be9b0d7 | 16 | |
b22af1bf | 17 | class AliHLTTPCCAGPUTracker : AliHLTLogging |
7be9b0d7 | 18 | { |
19 | public: | |
b22af1bf | 20 | AliHLTTPCCAGPUTracker() : |
21 | fGpuTracker(NULL), | |
22 | fGPUMemory(NULL), | |
23 | fHostLockedMemory(NULL), | |
24 | fDebugLevel(0), | |
25 | fOutFile(NULL), | |
26 | fGPUMemSize(0), | |
27 | fpCudaStreams(NULL), | |
28 | fSliceCount(0) | |
29 | {}; | |
30 | ~AliHLTTPCCAGPUTracker() {}; | |
7be9b0d7 | 31 | |
b22af1bf | 32 | int InitGPU(int sliceCount = 1, int forceDeviceID = -1); |
33 | int Reconstruct(AliHLTTPCCASliceOutput* pOutput, AliHLTTPCCAClusterData* pClusterData, int fFirstSlice, int fSliceCount = -1); | |
7be9b0d7 | 34 | int ExitGPU(); |
35 | ||
b22af1bf | 36 | void SetDebugLevel(const int dwLevel, std::ostream* const NewOutFile = NULL); |
37 | int SetGPUTrackerOption(char* OptionName, int OptionValue); | |
38 | ||
39 | unsigned long long int* PerfTimer(int iSlice, unsigned int i) {return(fSlaveTrackers ? fSlaveTrackers[iSlice].PerfTimer(i) : NULL); } | |
40 | ||
41 | int InitializeSliceParam(int iSlice, AliHLTTPCCAParam ¶m); | |
7be9b0d7 | 42 | |
43 | private: | |
b22af1bf | 44 | static void* RowMemory(void* const BaseMemory, int iSlice) { return( ((char*) BaseMemory) + iSlice * sizeof(AliHLTTPCCARow) * (HLTCA_ROW_COUNT + 1) ); } |
45 | static void* CommonMemory(void* const BaseMemory, int iSlice) { return( ((char*) BaseMemory) + HLTCA_GPU_ROWS_MEMORY + iSlice * AliHLTTPCCATracker::CommonMemorySize() ); } | |
46 | static void* SliceDataMemory(void* const BaseMemory, int iSlice) { return( ((char*) BaseMemory) + HLTCA_GPU_ROWS_MEMORY + HLTCA_GPU_COMMON_MEMORY + iSlice * HLTCA_GPU_SLICE_DATA_MEMORY ); } | |
47 | void* GlobalMemory(void* const BaseMemory, int iSlice) const { return( ((char*) BaseMemory) + HLTCA_GPU_ROWS_MEMORY + HLTCA_GPU_COMMON_MEMORY + fSliceCount * (HLTCA_GPU_SLICE_DATA_MEMORY) + iSlice * HLTCA_GPU_GLOBAL_MEMORY ); } | |
48 | void* TracksMemory(void* const BaseMemory, int iSlice) const { return( ((char*) BaseMemory) + HLTCA_GPU_ROWS_MEMORY + HLTCA_GPU_COMMON_MEMORY + fSliceCount * (HLTCA_GPU_SLICE_DATA_MEMORY) + iSlice * HLTCA_GPU_TRACKS_MEMORY ); } | |
49 | void* TrackerMemory(void* const BaseMemory, int iSlice) const { return( ((char*) BaseMemory) + HLTCA_GPU_ROWS_MEMORY + HLTCA_GPU_COMMON_MEMORY + fSliceCount * (HLTCA_GPU_SLICE_DATA_MEMORY + HLTCA_GPU_TRACKS_MEMORY) + iSlice * sizeof(AliHLTTPCCATracker) ); } | |
50 | ||
51 | void DumpRowBlocks(AliHLTTPCCATracker* tracker, int iSlice, bool check = true); | |
52 | ||
53 | AliHLTTPCCATracker *fGpuTracker; | |
54 | void* fGPUMemory; | |
55 | void* fHostLockedMemory; | |
7be9b0d7 | 56 | |
b22af1bf | 57 | int CUDASync(char* state = "UNKNOWN"); |
7be9b0d7 | 58 | template <class T> T* alignPointer(T* ptr, int alignment); |
59 | ||
b22af1bf | 60 | void StandalonePerfTime(int iSlice, int i); |
61 | ||
62 | int fDebugLevel; //Debug Level for GPU Tracker | |
63 | std::ostream* fOutFile; //Debug Output Stream Pointer | |
64 | unsigned long long int fGPUMemSize; //Memory Size to allocate on GPU | |
65 | ||
66 | void* fpCudaStreams; | |
67 | ||
68 | int fSliceCount; | |
69 | ||
70 | static const int fgkNSlices = 36; | |
71 | AliHLTTPCCATracker fSlaveTrackers[fgkNSlices]; | |
7be9b0d7 | 72 | #ifdef HLTCA_GPUCODE |
b22af1bf | 73 | bool CudaFailedMsg(cudaError_t error); |
7be9b0d7 | 74 | #endif |
b22af1bf | 75 | |
7be9b0d7 | 76 | // disable copy |
77 | AliHLTTPCCAGPUTracker( const AliHLTTPCCAGPUTracker& ); | |
78 | AliHLTTPCCAGPUTracker &operator=( const AliHLTTPCCAGPUTracker& ); | |
79 | ||
b22af1bf | 80 | ClassDef( AliHLTTPCCAGPUTracker, 0 ) |
7be9b0d7 | 81 | }; |
b22af1bf | 82 | |
83 | #endif |