@@ -62,23 +62,18 @@ class TimeFrameGPU : public TimeFrame<nLayers>
6262 void createCellsDevice ();
6363 void createCellsLUTDevice ();
6464 void createNeighboursIndexTablesDevice ();
65- void createNeighboursDevice (const unsigned int layer, const unsigned int nNeighbours);
66- void createNeighboursDevice (const unsigned int layer, std::vector<std::pair<int , int >>& neighbours);
65+ void createNeighboursDevice (const unsigned int layer);
6766 void createNeighboursLUTDevice (const int , const unsigned int );
68- void createNeighboursDeviceArray ();
6967 void createTrackITSExtDevice (bounded_vector<CellSeed>&);
7068 void downloadTrackITSExtDevice (bounded_vector<CellSeed>&);
7169 void downloadCellsNeighboursDevice (std::vector<bounded_vector<std::pair<int , int >>>&, const int );
7270 void downloadNeighboursLUTDevice (bounded_vector<int >&, const int );
7371 void downloadCellsDevice ();
7472 void downloadCellsLUTDevice ();
75- void unregisterRest ();
76- template <Task task>
77- auto & getStream (const size_t stream)
78- {
79- return mGpuStreams [stream];
80- }
73+ auto & getStream (const size_t stream) { return mGpuStreams [stream]; }
8174 auto & getStreams () { return mGpuStreams ; }
75+ void syncStream (const size_t stream);
76+ void syncStreams ();
8277 virtual void wipe () final ;
8378
8479 // / interface
@@ -99,7 +94,7 @@ class TimeFrameGPU : public TimeFrame<nLayers>
9994 gpuPair<int , int >* getDeviceNeighbourPairs (const int layer) { return mNeighbourPairsDevice [layer]; }
10095 std::array<int *, nLayers - 2 >& getDeviceNeighboursAll () { return mNeighboursDevice ; }
10196 int * getDeviceNeighbours (const int layer) { return mNeighboursDevice [layer]; }
102- int ** getDeviceNeighboursArray () { return mNeighboursDeviceArray ; }
97+ int ** getDeviceNeighboursArray () { return mNeighboursDevice . data () ; }
10398 TrackingFrameInfo* getDeviceTrackingFrameInfo (const int );
10499 const TrackingFrameInfo** getDeviceArrayTrackingFrameInfo () const { return mTrackingFrameInfoDeviceArray ; }
105100 const Cluster** getDeviceArrayClusters () const { return mClustersDeviceArray ; }
@@ -108,11 +103,11 @@ class TimeFrameGPU : public TimeFrame<nLayers>
108103 std::vector<unsigned int > getClusterSizes ();
109104 const unsigned char ** getDeviceArrayUsedClusters () const { return mUsedClustersDeviceArray ; }
110105 const int ** getDeviceROframeClusters () const { return mROFrameClustersDeviceArray ; }
111- Tracklet** getDeviceArrayTracklets () { return mTrackletsDeviceArray ; }
106+ Tracklet** getDeviceArrayTracklets () { return mTrackletsDevice . data () ; }
112107 int ** getDeviceArrayTrackletsLUT () const { return mTrackletsLUTDeviceArray ; }
113108 int ** getDeviceArrayCellsLUT () const { return mCellsLUTDeviceArray ; }
114109 int ** getDeviceArrayNeighboursCellLUT () const { return mNeighboursCellLUTDeviceArray ; }
115- CellSeed** getDeviceArrayCells () const { return mCellsDeviceArray ; }
110+ CellSeed** getDeviceArrayCells () { return mCellsDevice . data () ; }
116111 CellSeed* getDeviceTrackSeeds () { return mTrackSeedsDevice ; }
117112 o2::track::TrackParCovF** getDeviceArrayTrackSeeds () { return mCellSeedsDeviceArray ; }
118113 float ** getDeviceArrayTrackSeedsChi2 () { return mCellSeedsChi2DeviceArray ; }
@@ -140,7 +135,8 @@ class TimeFrameGPU : public TimeFrame<nLayers>
140135 int getNumberOfNeighbours () const final ;
141136
142137 private:
143- void allocMemAsync (void **, size_t , Stream&, bool ); // Abstract owned and unowned memory allocations
138+ void allocMemAsync (void **, size_t , Stream&, bool ); // Abstract owned and unowned memory allocations on specific stream
139+ void allocMem (void **, size_t , bool ); // Abstract owned and unowned memory allocations on default stream
144140 bool mHostRegistered = false ;
145141 TimeFrameGPUParameters mGpuParams ;
146142
@@ -167,7 +163,6 @@ class TimeFrameGPU : public TimeFrame<nLayers>
167163 const unsigned char ** mUsedClustersDeviceArray ;
168164 const int ** mROFrameClustersDeviceArray ;
169165 std::array<Tracklet*, nLayers - 1 > mTrackletsDevice ;
170- Tracklet** mTrackletsDeviceArray ;
171166 std::array<int *, nLayers - 1 > mTrackletsLUTDevice ;
172167 std::array<int *, nLayers - 2 > mCellsLUTDevice ;
173168 std::array<int *, nLayers - 3 > mNeighboursLUTDevice ;
@@ -179,7 +174,6 @@ class TimeFrameGPU : public TimeFrame<nLayers>
179174 std::array<CellSeed*, nLayers - 2 > mCellsDevice ;
180175 std::array<int *, nLayers - 2 > mNeighboursIndexTablesDevice ;
181176 CellSeed* mTrackSeedsDevice ;
182- CellSeed** mCellsDeviceArray ;
183177 std::array<o2::track::TrackParCovF*, nLayers - 2 > mCellSeedsDevice ;
184178 o2::track::TrackParCovF** mCellSeedsDeviceArray ;
185179 std::array<float *, nLayers - 2 > mCellSeedsChi2Device ;
@@ -189,14 +183,11 @@ class TimeFrameGPU : public TimeFrame<nLayers>
189183 TrackITSExt* mTrackITSExtDevice ;
190184 std::array<gpuPair<int , int >*, nLayers - 2 > mNeighbourPairsDevice ;
191185 std::array<int *, nLayers - 2 > mNeighboursDevice ;
192- int ** mNeighboursDeviceArray ;
193186 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice ;
194187 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray ;
195188
196189 // State
197190 Streams mGpuStreams ;
198- size_t mAvailMemGB ;
199- bool mFirstInit = true ;
200191
201192 // Temporary buffer for storing output tracks from GPU tracking
202193 bounded_vector<TrackITSExt> mTrackITSExt ;
0 commit comments