@@ -322,29 +322,52 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
322322 LOGP (debug, " No track seeds found, skipping track finding" );
323323 continue ;
324324 }
325- mTimeFrameGPU ->createTrackITSExtDevice (trackSeeds);
326325 mTimeFrameGPU ->loadTrackSeedsDevice (trackSeeds);
327326
328- trackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (), // CellSeed*
329- mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (), // TrackingFrameInfo**
330- mTimeFrameGPU ->getDeviceArrayUnsortedClusters (), // Cluster**
331- mTimeFrameGPU ->getDeviceTrackITSExt (), // o2::its::TrackITSExt*
332- this ->mTrkParams [iteration].LayerRadii , // const std::vector<float>&
333- this ->mTrkParams [iteration].MinPt , // const std::vector<float>&
334- trackSeeds.size (), // const size_t nSeeds
335- this ->mBz , // const float Bz
336- startLevel, // const int startLevel,
337- this ->mTrkParams [0 ].MaxChi2ClusterAttachment , // float maxChi2ClusterAttachment
338- this ->mTrkParams [0 ].MaxChi2NDF , // float maxChi2NDF
339- this ->mTrkParams [0 ].RepeatRefitOut ,
340- this ->mTrkParams [0 ].ReseedIfShorter ,
341- this ->mTrkParams [0 ].ShiftRefToCluster ,
342- mTimeFrameGPU ->getDevicePropagator (), // const o2::base::Propagator* propagator
343- this ->mTrkParams [0 ].CorrType , // o2::base::PropagatorImpl<float>::MatCorrType
344- conf.nBlocksTracksSeeds [iteration],
345- conf.nThreadsTracksSeeds [iteration]);
346-
347- mTimeFrameGPU ->downloadTrackITSExtDevice (trackSeeds);
327+ // Since TrackITSExt is an enourmous class it is better to first count how many
328+ // successfull fits we do and only then allocate
329+ countTrackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (),
330+ mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (),
331+ mTimeFrameGPU ->getDeviceArrayUnsortedClusters (),
332+ mTimeFrameGPU ->getDeviceTrackSeedsLUT (),
333+ this ->mTrkParams [iteration].LayerRadii ,
334+ this ->mTrkParams [iteration].MinPt ,
335+ trackSeeds.size (),
336+ this ->mBz ,
337+ startLevel,
338+ this ->mTrkParams [0 ].MaxChi2ClusterAttachment ,
339+ this ->mTrkParams [0 ].MaxChi2NDF ,
340+ this ->mTrkParams [0 ].RepeatRefitOut ,
341+ this ->mTrkParams [0 ].ReseedIfShorter ,
342+ this ->mTrkParams [0 ].ShiftRefToCluster ,
343+ mTimeFrameGPU ->getDevicePropagator (),
344+ this ->mTrkParams [0 ].CorrType ,
345+ mTimeFrameGPU ->getFrameworkAllocator (),
346+ conf.nBlocksTracksSeeds [iteration],
347+ conf.nThreadsTracksSeeds [iteration]);
348+ mTimeFrameGPU ->createTrackITSExtDevice (trackSeeds.size ());
349+ computeTrackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (),
350+ mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (),
351+ mTimeFrameGPU ->getDeviceArrayUnsortedClusters (),
352+ mTimeFrameGPU ->getDeviceTrackITSExt (),
353+ mTimeFrameGPU ->getDeviceTrackSeedsLUT (),
354+ this ->mTrkParams [iteration].LayerRadii ,
355+ this ->mTrkParams [iteration].MinPt ,
356+ trackSeeds.size (),
357+ mTimeFrameGPU ->getNTrackSeeds (),
358+ this ->mBz ,
359+ startLevel,
360+ this ->mTrkParams [0 ].MaxChi2ClusterAttachment ,
361+ this ->mTrkParams [0 ].MaxChi2NDF ,
362+ this ->mTrkParams [0 ].RepeatRefitOut ,
363+ this ->mTrkParams [0 ].ReseedIfShorter ,
364+ this ->mTrkParams [0 ].ShiftRefToCluster ,
365+ mTimeFrameGPU ->getDevicePropagator (),
366+ this ->mTrkParams [0 ].CorrType ,
367+ mTimeFrameGPU ->getFrameworkAllocator (),
368+ conf.nBlocksTracksSeeds [iteration],
369+ conf.nThreadsTracksSeeds [iteration]);
370+ mTimeFrameGPU ->downloadTrackITSExtDevice ();
348371
349372 auto & tracks = mTimeFrameGPU ->getTrackITSExt ();
350373
0 commit comments