@@ -335,25 +335,25 @@ void TimeFrameGPU<NLayers>::loadTrackingTopologies()
335335 GPUTimer timer (" initialising device views of TrackingTopology" );
336336 const auto & hostTopologies = this ->getTrackerTopologies ();
337337 mDeviceTrackerTopologyViews .resize (hostTopologies.size ());
338- using LayerTransition = typename TrackingTopologyN::LayerTransition ;
338+ using LayerLink = typename TrackingTopologyN::LayerLink ;
339339 using CellTopology = typename TrackingTopologyN::CellTopology;
340340 using Range = typename TrackingTopologyN::Range;
341341 using Id = typename TrackingTopologyN::Id;
342342 for (size_t iteration = 0 ; iteration < hostTopologies.size (); ++iteration) {
343343 const auto & topology = hostTopologies[iteration];
344- LayerTransition* dTransitions {nullptr };
344+ LayerLink* dLinks {nullptr };
345345 CellTopology* dCells{nullptr };
346- Range* dCellsByFirstTransitionIndex {nullptr };
347- Id* dCellsByFirstTransition {nullptr };
348- allocMem (reinterpret_cast <void **>(&dTransitions ), topology.getNTransitions () * sizeof (LayerTransition ), this ->hasFrameworkAllocator ());
346+ Range* dCellsByFirstLinkIndex {nullptr };
347+ Id* dCellsByFirstLink {nullptr };
348+ allocMem (reinterpret_cast <void **>(&dLinks ), topology.getNLinks () * sizeof (LayerLink ), this ->hasFrameworkAllocator ());
349349 allocMem (reinterpret_cast <void **>(&dCells), topology.getNCells () * sizeof (CellTopology), this ->hasFrameworkAllocator ());
350- allocMem (reinterpret_cast <void **>(&dCellsByFirstTransitionIndex ), topology.getNTransitions () * sizeof (Range), this ->hasFrameworkAllocator ());
351- allocMem (reinterpret_cast <void **>(&dCellsByFirstTransition ), topology.getNCellsByFirstTransition () * sizeof (Id), this ->hasFrameworkAllocator ());
352- GPUChkErrS (cudaMemcpy (dTransitions , topology.getTransitions ().data (), topology.getNTransitions () * sizeof (LayerTransition ), cudaMemcpyHostToDevice));
350+ allocMem (reinterpret_cast <void **>(&dCellsByFirstLinkIndex ), topology.getNLinks () * sizeof (Range), this ->hasFrameworkAllocator ());
351+ allocMem (reinterpret_cast <void **>(&dCellsByFirstLink ), topology.getNCellsByFirstLink () * sizeof (Id), this ->hasFrameworkAllocator ());
352+ GPUChkErrS (cudaMemcpy (dLinks , topology.getLinks ().data (), topology.getNLinks () * sizeof (LayerLink ), cudaMemcpyHostToDevice));
353353 GPUChkErrS (cudaMemcpy (dCells, topology.getCells ().data (), topology.getNCells () * sizeof (CellTopology), cudaMemcpyHostToDevice));
354- GPUChkErrS (cudaMemcpy (dCellsByFirstTransitionIndex , topology.getCellsByFirstTransitionIndex ().data (), topology.getNTransitions () * sizeof (Range), cudaMemcpyHostToDevice));
355- GPUChkErrS (cudaMemcpy (dCellsByFirstTransition , topology.getCellsByFirstTransition ().data (), topology.getNCellsByFirstTransition () * sizeof (Id), cudaMemcpyHostToDevice));
356- mDeviceTrackerTopologyViews [iteration] = topology.getDeviceView (dTransitions , dCells, dCellsByFirstTransitionIndex, dCellsByFirstTransition );
354+ GPUChkErrS (cudaMemcpy (dCellsByFirstLinkIndex , topology.getCellsByFirstLinkIndex ().data (), topology.getNLinks () * sizeof (Range), cudaMemcpyHostToDevice));
355+ GPUChkErrS (cudaMemcpy (dCellsByFirstLink , topology.getCellsByFirstLink ().data (), topology.getNCellsByFirstLink () * sizeof (Id), cudaMemcpyHostToDevice));
356+ mDeviceTrackerTopologyViews [iteration] = topology.getDeviceView (dLinks , dCells, dCellsByFirstLinkIndex, dCellsByFirstLink );
357357 }
358358 if (!mDeviceTrackerTopologyViews .empty ()) {
359359 mDeviceTrackingTopologyView = mDeviceTrackerTopologyViews .front ();
@@ -380,15 +380,15 @@ template <int NLayers>
380380void TimeFrameGPU<NLayers>::createTrackletsLUTDeviceArray()
381381{
382382 {
383- allocMem (reinterpret_cast <void **>(&mTrackletsLUTDeviceArray ), MaxTransitions * sizeof (int *), this ->hasFrameworkAllocator ());
383+ allocMem (reinterpret_cast <void **>(&mTrackletsLUTDeviceArray ), MaxLinks * sizeof (int *), this ->hasFrameworkAllocator ());
384384 }
385385}
386386
387387template <int NLayers>
388388void TimeFrameGPU<NLayers>::createTrackletsLUTDevice(bool allocate, const int layer)
389389{
390390 GPUTimer timer (mGpuStreams [layer], " creating tracklets LUTs" , layer);
391- const int fromLayer = this ->mTrackingTopologyView .getTransition (layer).fromLayer ;
391+ const int fromLayer = this ->mTrackingTopologyView .getLink (layer).fromLayer ;
392392 const int ncls = this ->mClusters [fromLayer].size () + 1 ;
393393 if (allocate || mTrackletsLUTDevice [layer] == nullptr ) {
394394 GPULog (" gpu-allocation: creating tracklets LUT for {} elements on layer {}, for {:.2f} MB." , ncls, layer, ncls * sizeof (int ) / constants::MB );
@@ -403,7 +403,7 @@ void TimeFrameGPU<NLayers>::createTrackletsBuffersArray()
403403{
404404 {
405405 GPUTimer timer (" creating tracklet buffers array" );
406- allocMem (reinterpret_cast <void **>(&mTrackletsDeviceArray ), MaxTransitions * sizeof (Tracklet*), this ->hasFrameworkAllocator ());
406+ allocMem (reinterpret_cast <void **>(&mTrackletsDeviceArray ), MaxLinks * sizeof (Tracklet*), this ->hasFrameworkAllocator ());
407407 }
408408}
409409
@@ -412,7 +412,7 @@ void TimeFrameGPU<NLayers>::createTrackletsBuffers(const int layer)
412412{
413413 GPUTimer timer (mGpuStreams [layer], " creating tracklet buffers" , layer);
414414 mNTracklets [layer] = 0 ;
415- const int fromLayer = this ->mTrackingTopologyView .getTransition (layer).fromLayer ;
415+ const int fromLayer = this ->mTrackingTopologyView .getLink (layer).fromLayer ;
416416 GPUChkErrS (cudaMemcpyAsync (&mNTracklets [layer], mTrackletsLUTDevice [layer] + this ->mClusters [fromLayer].size (), sizeof (int ), cudaMemcpyDeviceToHost, mGpuStreams [layer].get ()));
417417 mGpuStreams [layer].sync (); // ensure number of tracklets is correct
418418 GPULog (" gpu-transfer: creating tracklets buffer for {} elements on layer {}, for {:.2f} MB." , mNTracklets [layer], layer, mNTracklets [layer] * sizeof (Tracklet) / constants::MB );
@@ -491,10 +491,10 @@ template <int NLayers>
491491void TimeFrameGPU<NLayers>::createCellsLUTDevice(const int layer)
492492{
493493 GPUTimer timer (mGpuStreams [layer], " creating cells LUTs" , layer);
494- const int firstTransition = this ->mTrackingTopologyView .getCell (layer).firstTransition ;
495- GPULog (" gpu-transfer: creating cell LUT for {} elements on layer {}, for {:.2f} MB." , mNTracklets [firstTransition ] + 1 , layer, (mNTracklets [firstTransition ] + 1 ) * sizeof (int ) / constants::MB );
496- allocMemAsync (reinterpret_cast <void **>(&mCellsLUTDevice [layer]), (mNTracklets [firstTransition ] + 1 ) * sizeof (int ), mGpuStreams [layer], this ->hasFrameworkAllocator (), (o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK ));
497- GPUChkErrS (cudaMemsetAsync (mCellsLUTDevice [layer], 0 , (mNTracklets [firstTransition ] + 1 ) * sizeof (int ), mGpuStreams [layer].get ()));
494+ const int firstLink = this ->mTrackingTopologyView .getCell (layer).firstLink ;
495+ GPULog (" gpu-transfer: creating cell LUT for {} elements on layer {}, for {:.2f} MB." , mNTracklets [firstLink ] + 1 , layer, (mNTracklets [firstLink ] + 1 ) * sizeof (int ) / constants::MB );
496+ allocMemAsync (reinterpret_cast <void **>(&mCellsLUTDevice [layer]), (mNTracklets [firstLink ] + 1 ) * sizeof (int ), mGpuStreams [layer], this ->hasFrameworkAllocator (), (o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK ));
497+ GPUChkErrS (cudaMemsetAsync (mCellsLUTDevice [layer], 0 , (mNTracklets [firstLink ] + 1 ) * sizeof (int ), mGpuStreams [layer].get ()));
498498 GPUChkErrS (cudaMemcpyAsync (&mCellsLUTDeviceArray [layer], &mCellsLUTDevice [layer], sizeof (int *), cudaMemcpyHostToDevice, mGpuStreams [layer].get ()));
499499}
500500
@@ -515,8 +515,8 @@ void TimeFrameGPU<NLayers>::createCellsBuffers(const int layer)
515515{
516516 GPUTimer timer (mGpuStreams [layer], " creating cells buffers" );
517517 mNCells [layer] = 0 ;
518- const int firstTransition = this ->mTrackingTopologyView .getCell (layer).firstTransition ;
519- GPUChkErrS (cudaMemcpyAsync (&mNCells [layer], mCellsLUTDevice [layer] + mNTracklets [firstTransition ], sizeof (int ), cudaMemcpyDeviceToHost, mGpuStreams [layer].get ()));
518+ const int firstLink = this ->mTrackingTopologyView .getCell (layer).firstLink ;
519+ GPUChkErrS (cudaMemcpyAsync (&mNCells [layer], mCellsLUTDevice [layer] + mNTracklets [firstLink ], sizeof (int ), cudaMemcpyDeviceToHost, mGpuStreams [layer].get ()));
520520 mGpuStreams [layer].sync (); // ensure number of cells is correct
521521 GPULog (" gpu-transfer: creating cell buffer for {} elements on layer {}, for {:.2f} MB." , mNCells [layer], layer, mNCells [layer] * sizeof (CellSeed) / constants::MB );
522522 allocMemAsync (reinterpret_cast <void **>(&mCellsDevice [layer]), mNCells [layer] * sizeof (CellSeed), mGpuStreams [layer], this ->hasFrameworkAllocator (), (o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK ));
0 commit comments