LCOV - code coverage report
Current view: top level - HLT/TPCLib/tracking-ca - AliHLTTPCCATrackletConstructor.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 8 0.0 %
Date: 2016-06-14 17:26:59 Functions: 0 5 0.0 %

          Line data    Source code
       1             : //-*- Mode: C++ -*-
       2             : // ************************************************************************
       3             : // This file is property of and copyright by the ALICE HLT Project        *
       4             : // ALICE Experiment at CERN, All rights reserved.                         *
       5             : // See cxx source for full Copyright notice                               *
       6             : //                                                                        *
       7             : //*************************************************************************
       8             : 
       9             : #ifndef ALIHLTTPCCATRACKLETCONSTRUCTOR_H
      10             : #define ALIHLTTPCCATRACKLETCONSTRUCTOR_H
      11             : 
      12             : #ifdef HLTCA_GPUCODE
      13             : #define HLTCA_GPU_USE_INT short
      14             : #else
      15             : #define HLTCA_GPU_USE_INT int
      16             : #endif //HLTCA_GPUCODE
      17             : 
      18             : #include "AliHLTTPCCADef.h"
      19             : #include "AliHLTTPCCAGPUConfig.h"
      20             : #include "AliHLTTPCCATrackParam.h"
      21             : 
      22             : /**
      23             : * @class AliHLTTPCCATrackletConstructor
      24             : *
      25             : */
      26             : MEM_CLASS_PRE() class AliHLTTPCCATracker;
      27             : 
      28             : class AliHLTTPCCATrackletConstructor
      29             : {
      30             : public:
      31             : 
      32             :         class  AliHLTTPCCAThreadMemory
      33             :         {
      34             :                 friend class AliHLTTPCCATrackletConstructor; //! friend class
      35             :         public:
      36             : #if !defined(HLTCA_GPUCODE)
      37             :                 AliHLTTPCCAThreadMemory()
      38           0 :                         : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fGo( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 )
      39             : #ifdef HLTCA_GPU_ALTERNATIVE_SCHEDULER
      40           0 :                         , fIRow(0), fIRowEnd(0)
      41             : #endif
      42           0 :                 {}
      43             : 
      44             :                 AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/ )
      45             :                         : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fGo( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 )
      46             : #ifdef HLTCA_GPU_ALTERNATIVE_SCHEDULER
      47             :                         , fIRow(0), fIRowEnd(0)
      48             : #endif
      49             :                 {}
      50             :                 AliHLTTPCCAThreadMemory& operator=( const AliHLTTPCCAThreadMemory& /*dummy*/ ) { return *this; }
      51             : #endif //!HLTCA_GPUCODE
      52             : 
      53             :         protected:
      54             :                 //WARNING: This data is copied element by element in CopyTrackletTempData. Changes to members of this class must be reflected in CopyTrackletTempData!!!
      55             :                 int fItr; // track index
      56             :                 int fFirstRow;  // first row index
      57             :                 int fLastRow; // last row index
      58             :                 int fStartRow;  // first row index
      59             :                 int fEndRow;  // first row index
      60             :                 int fCurrIH; // indef of the current hit
      61             :                 bool fGo; // do fit/searching flag
      62             :                 int fStage; // reco stage
      63             :                 int fNHits; // n track hits
      64             :                 int fNMissed; // n missed hits during search
      65             :                 float fLastY; // Y of the last fitted cluster
      66             :                 float fLastZ; // Z of the last fitted cluster
      67             : #if defined(HLTCA_GPU_ALTERNATIVE_SCHEDULER)
      68             :                 int fIRow; //current row for alt sched
      69             :                 int fIRowEnd; //last row for current alt sched iteration
      70             : #endif
      71             :         };
      72             : 
      73             :         //Structure to store track parameters and temporary thread variables in global memory when rescheduling
      74             :         MEM_CLASS_PRE2() struct AliHLTTPCCAGPUTempMemory
      75             :         {
      76             : #if !defined(HLTCA_GPUCODE)
      77             :                 AliHLTTPCCAGPUTempMemory() : fThreadMem(), fParam() {}
      78             : #endif
      79             :                 AliHLTTPCCAThreadMemory fThreadMem;// thread memory
      80             :                 MEM_LG2(AliHLTTPCCATrackParam) fParam;// parameters
      81             :         };
      82             : 
      83             :         MEM_CLASS_PRE() class AliHLTTPCCASharedMemory
      84             :         {
      85             :                 friend class AliHLTTPCCATrackletConstructor; // friend class
      86             :         public:
      87             : #if !defined(HLTCA_GPUCODE)
      88           0 :                 AliHLTTPCCASharedMemory()
      89           0 :                         : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletFirstRun(0)
      90             : #if defined(HLTCA_GPU_ALTERNATIVE_SCHEDULER) && !defined(HLTCA_GPU_ALTERNATIVE_SCHEDULER_SIMPLE)
      91             :                                 ,fTrackletStorePos(0)
      92             : #endif
      93           0 :                                 , fNTracklets(0) {
      94             : #ifndef HLTCA_GPU_ALTERNATIVE_SCHEDULER
      95             :                                 for( int i=0; i<HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1; i++)fStartRows[i] = 0;
      96             :                                 for( int i=0; i<HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1; i++) fEndRows[i]=0;
      97             : #endif
      98           0 :                 }
      99             : 
     100             :                 AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
     101             :                         : fNextTrackletFirst(0), fNextTrackletCount(0), fNextTrackletFirstRun(0)
     102             : #if defined(HLTCA_GPU_ALTERNATIVE_SCHEDULER) && !defined(HLTCA_GPU_ALTERNATIVE_SCHEDULER_SIMPLE)
     103             :                                 ,fTrackletStorePos(0)
     104             : #endif
     105             :                                 , fNTracklets(0) {
     106             : #ifndef HLTCA_GPU_ALTERNATIVE_SCHEDULER
     107             :                                 for( int i=0; i<HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1; i++)fStartRows[i] = 0;
     108             :                                 for( int i=0; i<HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1; i++) fEndRows[i]=0;
     109             : #endif
     110             :                 }
     111             : 
     112             :                 AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
     113             : #endif //HLTCA_GPUCODE
     114             : 
     115             :         protected:
     116             :                 MEM_LG(AliHLTTPCCARow) fRows[HLTCA_ROW_COUNT]; // rows
     117             :                 int fNextTrackletFirst; //First tracklet to be processed by CUDA block during next iteration
     118             :                 int fNextTrackletCount; //Number of Tracklets to be processed by CUDA block during next iteration
     119             :                 int fNextTrackletFirstRun; //First run for dynamic scheduler?
     120             :                 //Use IFDEF to save GPU shared memory
     121             : #ifdef HLTCA_GPU_ALTERNATIVE_SCHEDULER
     122             : #ifndef HLTCA_GPU_ALTERNATIVE_SCHEDULER_SIMPLE
     123             :                 int fTrackletStorePos; //position in temporary storage
     124             :                 AliHLTTPCCATrackletConstructor::MEM_LG(AliHLTTPCCAGPUTempMemory) swapMemory[HLTCA_GPU_ALTSCHED_MIN_THREADS]; //temporary swap space for scheduling
     125             : #endif
     126             : #elif defined(HLTCA_GPU_RESCHED)
     127             :                 int fNextTrackletStupidDummy; //Shared Dummy variable to access
     128             :                 int fStartRows[HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1]; // start rows
     129             :                 int fEndRows[HLTCA_GPU_THREAD_COUNT_CONSTRUCTOR / HLTCA_GPU_WARP_SIZE + 1]; // end rows
     130             : #endif
     131             :                 int fNTracklets; // Total number of tracklets
     132             : 
     133             : #ifdef HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE
     134             :                 int fMaxSync; //temporary shared variable during profile creation
     135             : #endif //HLTCA_GPU_TRACKLET_CONSTRUCTOR_DO_PROFILE
     136             : 
     137             :                 int fTrackletStoreCount[2][HLTCA_ROW_COUNT / HLTCA_GPU_SCHED_ROW_STEP + 1];//Number of tracklets to store in tracklet pool for rescheduling
     138             :         };
     139             : 
     140             :         MEM_CLASS_PRE2() GPUd() static void InitTracklet( register MEM_LG2(AliHLTTPCCATrackParam) &tParam );
     141             : 
     142             :         MEM_CLASS_PRE2() GPUd() static void UpdateTracklet
     143             :                 ( int nBlocks, int nThreads, int iBlock, int iThread,
     144             :                   MEM_LOCAL(GPUsharedref() AliHLTTPCCASharedMemory) &s, AliHLTTPCCAThreadMemory &r, GPUconstant() MEM_CONSTANT(AliHLTTPCCATracker) &tracker, MEM_LG2(AliHLTTPCCATrackParam) &tParam, int iRow );
     145             : 
     146             :         MEM_CLASS_PRE23() GPUd() static void StoreTracklet
     147             :                 ( int nBlocks, int nThreads, int iBlock, int iThread,
     148             :                   MEM_LOCAL(GPUsharedref() AliHLTTPCCASharedMemory) &s, AliHLTTPCCAThreadMemory &r, GPUconstant() MEM_LG2(AliHLTTPCCATracker) &tracker, MEM_LG3(AliHLTTPCCATrackParam) &tParam );
     149             : 
     150             :         MEM_CLASS_PRE2() GPUd() static bool CheckCov(register MEM_LG2(AliHLTTPCCATrackParam) &tParam);
     151             : 
     152             : #ifdef HLTCA_GPUCODE
     153             :         GPUd() static void AliHLTTPCCATrackletConstructorGPU(GPUconstant() MEM_CONSTANT(AliHLTTPCCATracker) *pTracker, GPUsharedref() AliHLTTPCCATrackletConstructor::MEM_LOCAL(AliHLTTPCCASharedMemory)& sMem);
     154             :         MEM_CLASS_PRE2() GPUd() static void AliHLTTPCCATrackletConstructorGPUPP(MEM_LG2(AliHLTTPCCATracker) *pTracker);
     155             : #ifndef HLTCA_GPU_ALTERNATIVE_SCHEDULER
     156             :         GPUd() static int FetchTracklet(GPUconstant() AliHLTTPCCATracker &tracker, GPUshared() AliHLTTPCCASharedMemory &sMem, int Reverse, int RowBlock, int &mustInit);
     157             :         GPUd() static void AliHLTTPCCATrackletConstructorInit(int iTracklet, AliHLTTPCCATracker &tracke);
     158             : #else
     159             :         GPUd() static int FetchTracklet(GPUconstant() MEM_CONSTANT(AliHLTTPCCATracker) &tracker, GPUsharedref() MEM_LOCAL(AliHLTTPCCASharedMemory) &sMem, AliHLTTPCCAThreadMemory &rMem, MEM_PLAIN(AliHLTTPCCATrackParam) &tParam);
     160             : #endif
     161             :         MEM_TEMPLATE4() GPUd() static void CopyTrackletTempData( MEM_TYPE(AliHLTTPCCAThreadMemory) &rMemSrc, MEM_TYPE2(AliHLTTPCCAThreadMemory) &rMemDst, MEM_TYPE3(AliHLTTPCCATrackParam) &tParamSrc, MEM_TYPE4(AliHLTTPCCATrackParam) &tParamDst);
     162             : #else
     163             :         GPUd() static void AliHLTTPCCATrackletConstructorCPU(AliHLTTPCCATracker &tracker);
     164             :         GPUd() static int AliHLTTPCCATrackletConstructorGlobalTracking(AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam& tParam, int startrow, int increment);
     165             : #endif //HLTCA_GPUCODE
     166             : 
     167           0 :         GPUd() static bool SAVE() { return 1; }
     168             : };
     169             : 
     170             : #endif //ALIHLTTPCCATRACKLETCONSTRUCTOR_H

Generated by: LCOV version 1.11