@@ -205,9 +205,6 @@ void TrackerTraitsGPU<nLayers>::computeCellsHybrid(const int iteration)
205205 conf.nBlocks ,
206206 conf.nThreads );
207207 }
208- // Needed for processNeighbours() which is still on CPU.
209- mTimeFrameGPU ->downloadCellsDevice ();
210- mTimeFrameGPU ->downloadCellsLUTDevice ();
211208}
212209
213210template <int nLayers>
@@ -221,11 +218,11 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
221218 mTimeFrameGPU ->getCellsNeighboursLUT ()[iLayer].clear ();
222219 mTimeFrameGPU ->getCellsNeighboursLUT ()[iLayer].resize (nextLayerCellsNum, 0 );
223220
224- if (mTimeFrameGPU ->getCells ()[iLayer + 1 ].empty () ||
225- mTimeFrameGPU ->getCellsLookupTable ()[iLayer].empty ()) {
226- mTimeFrameGPU ->getCellsNeighbours ()[iLayer].clear ();
227- continue ;
228- }
221+ // if (mTimeFrameGPU->getCells()[iLayer + 1].empty() ||
222+ // mTimeFrameGPU->getCellsLookupTable()[iLayer].empty()) {
223+ // mTimeFrameGPU->getCellsNeighbours()[iLayer].clear();
224+ // continue;
225+ // }
229226
230227 mTimeFrameGPU ->createNeighboursLUTDevice (iLayer, nextLayerCellsNum);
231228 countCellNeighboursHandler (mTimeFrameGPU ->getDeviceArrayCells (),
@@ -267,7 +264,6 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
267264 cellsNeighboursLayer[iLayer].size ());
268265 }
269266 mTimeFrameGPU ->createNeighboursDeviceArray ();
270- mTimeFrameGPU ->downloadCellsDevice ();
271267 mTimeFrameGPU ->unregisterRest ();
272268};
273269
@@ -289,55 +285,21 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
289285 startLevel,
290286 mTimeFrameGPU ->getDeviceArrayCells (),
291287 mTimeFrameGPU ->getDeviceCells ()[startLayer],
292- mTimeFrameGPU ->getNCells ()[startLayer] ,
288+ mTimeFrameGPU ->getArrayNCells () ,
293289 mTimeFrameGPU ->getDeviceArrayUsedClusters (),
294- mTimeFrameGPU ->getDeviceNeighbours (startLayer - 1 ),
290+ mTimeFrameGPU ->getDeviceNeighboursAll ( ),
295291 mTimeFrameGPU ->getDeviceNeighboursLUTs (),
296292 mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (),
293+ trackSeeds,
297294 mBz ,
298- mTrkParams [0 ].MaxChi2ClusterAttachment , // float maxChi2ClusterAttachment
295+ mTrkParams [0 ].MaxChi2ClusterAttachment ,
296+ mTrkParams [0 ].MaxChi2NDF ,
299297 mTimeFrameGPU ->getDevicePropagator (),
300298 mCorrType ,
301- lastCellId, // temporary host vector
302- lastCellSeed, // temporary host vector
303- updatedCellId, // temporary host vectors
304- updatedCellSeed, // temporary host vectors
305299 conf.nBlocks ,
306300 conf.nThreads );
307-
308- // int level = startLevel;
309- // for (int iLayer{startLayer - 1}; iLayer > 0 && level > 2; --iLayer) {
310- // lastCellSeed.swap(updatedCellSeed);
311- // lastCellId.swap(updatedCellId);
312- // std::vector<CellSeed>().swap(updatedCellSeed); /// tame the memory peaks
313- // updatedCellId.clear();
314- // processNeighboursHandler<nLayers>(iLayer,
315- // --level,
316- // mTimeFrameGPU->getDeviceArrayCells(),
317- // mTimeFrameGPU->getDeviceCells()[iLayer],
318- // mTimeFrameGPU->getNCells()[iLayer],
319- // mTimeFrameGPU->getDeviceArrayUsedClusters(),
320- // mTimeFrameGPU->getDeviceNeighbours(iLayer - 1),
321- // mTimeFrameGPU->getDeviceNeighboursLUTs(),
322- // mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(),
323- // mBz,
324- // mTrkParams[0].MaxChi2ClusterAttachment, // float maxChi2ClusterAttachment
325- // mTimeFrameGPU->getDevicePropagator(),
326- // mCorrType,
327- // lastCellId, // temporary host vector
328- // lastCellSeed, // temporary host vector
329- // updatedCellId, // temporary host vectors
330- // updatedCellSeed, // temporary host vectors
331- // conf.nBlocks,
332- // conf.nThreads);
333- // }
334- for (auto & seed : updatedCellSeed) {
335- if (seed.getQ2Pt () > 1 .e3 || seed.getChi2 () > mTrkParams [0 ].MaxChi2NDF * ((startLevel + 2 ) * 2 - 5 )) {
336- continue ;
337- }
338- trackSeeds.push_back (seed);
339- }
340301 }
302+ // fixme: I don't want to move tracks back and forth, but I need a way to use a thrust::allocator that is aware of our managed memory.
341303 if (!trackSeeds.size ()) {
342304 LOGP (info, " No track seeds found, skipping track finding" );
343305 continue ;
@@ -362,9 +324,6 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
362324 mTimeFrameGPU ->downloadTrackITSExtDevice (trackSeeds);
363325
364326 auto & tracks = mTimeFrameGPU ->getTrackITSExt ();
365- std::sort (tracks.begin (), tracks.end (), [](const TrackITSExt& a, const TrackITSExt& b) {
366- return a.getChi2 () < b.getChi2 ();
367- });
368327
369328 for (auto & track : tracks) {
370329 if (!track.getChi2 ()) {
0 commit comments