@@ -28,7 +28,6 @@ template <int nLayers>
2828void TrackerTraitsGPU<nLayers>::initialiseTimeFrame(const int iteration)
2929{
3030 mTimeFrameGPU ->initialise (iteration, this ->mTrkParams [iteration], nLayers);
31-
3231 // on default stream
3332 mTimeFrameGPU ->loadVertices (iteration);
3433 mTimeFrameGPU ->loadIndexTableUtils (iteration);
@@ -45,6 +44,11 @@ void TrackerTraitsGPU<nLayers>::initialiseTimeFrame(const int iteration)
4544 mTimeFrameGPU ->createTrackletsBuffersArray (iteration);
4645 mTimeFrameGPU ->createCellsBuffersArray (iteration);
4746 mTimeFrameGPU ->createCellsLUTDeviceArray (iteration);
47+ // clear memory from previous iteration
48+ if (iteration > 0 ) { // do nothing in the first iteration
49+ mTimeFrameGPU ->popMemoryStack (iteration - 1 ); // pop previous
50+ }
51+ mTimeFrameGPU ->pushMemoryStack (iteration);
4852}
4953
5054template <int nLayers>
@@ -108,7 +112,7 @@ void TrackerTraitsGPU<nLayers>::computeLayerTracklets(const int iteration, int i
108112 mTimeFrameGPU ->getPositionResolutions (),
109113 this ->mTrkParams [iteration].LayerRadii ,
110114 mTimeFrameGPU ->getMSangles (),
111- mTimeFrameGPU ->getExternalDeviceAllocator (),
115+ mTimeFrameGPU ->getFrameworkAllocator (),
112116 conf.nBlocksLayerTracklets [iteration],
113117 conf.nThreadsLayerTracklets [iteration],
114118 mTimeFrameGPU ->getStreams ());
@@ -146,7 +150,7 @@ void TrackerTraitsGPU<nLayers>::computeLayerTracklets(const int iteration, int i
146150 mTimeFrameGPU ->getPositionResolutions (),
147151 this ->mTrkParams [iteration].LayerRadii ,
148152 mTimeFrameGPU ->getMSangles (),
149- mTimeFrameGPU ->getExternalDeviceAllocator (),
153+ mTimeFrameGPU ->getFrameworkAllocator (),
150154 conf.nBlocksLayerTracklets [iteration],
151155 conf.nThreadsLayerTracklets [iteration],
152156 mTimeFrameGPU ->getStreams ());
@@ -197,7 +201,7 @@ void TrackerTraitsGPU<nLayers>::computeLayerCells(const int iteration)
197201 this ->mTrkParams [iteration].MaxChi2ClusterAttachment ,
198202 this ->mTrkParams [iteration].CellDeltaTanLambdaSigma ,
199203 this ->mTrkParams [iteration].NSigmaCut ,
200- mTimeFrameGPU ->getExternalDeviceAllocator (),
204+ mTimeFrameGPU ->getFrameworkAllocator (),
201205 conf.nBlocksLayerCells [iteration],
202206 conf.nThreadsLayerCells [iteration],
203207 mTimeFrameGPU ->getStreams ());
@@ -253,7 +257,7 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighbours(const int iteration)
253257 currentLayerCellsNum,
254258 nextLayerCellsNum,
255259 1e2 ,
256- mTimeFrameGPU ->getExternalDeviceAllocator (),
260+ mTimeFrameGPU ->getFrameworkAllocator (),
257261 conf.nBlocksFindNeighbours [iteration],
258262 conf.nThreadsFindNeighbours [iteration],
259263 mTimeFrameGPU ->getStream (iLayer));
@@ -281,7 +285,7 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighbours(const int iteration)
281285 mTimeFrameGPU ->getDeviceNeighbours (iLayer),
282286 mTimeFrameGPU ->getArrayNNeighbours ()[iLayer],
283287 mTimeFrameGPU ->getStream (iLayer),
284- mTimeFrameGPU ->getExternalDeviceAllocator ());
288+ mTimeFrameGPU ->getFrameworkAllocator ());
285289 }
286290 mTimeFrameGPU ->syncStreams (false );
287291}
@@ -312,7 +316,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
312316 this ->mTrkParams [0 ].MaxChi2NDF ,
313317 mTimeFrameGPU ->getDevicePropagator (),
314318 this ->mTrkParams [0 ].CorrType ,
315- mTimeFrameGPU ->getExternalDeviceAllocator (),
319+ mTimeFrameGPU ->getFrameworkAllocator (),
316320 conf.nBlocksProcessNeighbours [iteration],
317321 conf.nThreadsProcessNeighbours [iteration]);
318322 }
0 commit comments