Skip to content

Commit 59ae3e8

Browse files
committed
ITS: rename transition to link
Done with: ``` grep -rl 'Transition' . | xargs sed -i '' 's/Transition/Link/g' grep -rl 'transition' . | xargs sed -i '' 's/transition/link/g' ``` in Detectors/ITSMFT/ITS/tracking Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 94d9198 commit 59ae3e8

10 files changed

Lines changed: 297 additions & 297 deletions

File tree

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TimeFrameGPU : public TimeFrame<NLayers>
3434
using typename TimeFrame<NLayers>::ROFMaskTableN;
3535
using typename TimeFrame<NLayers>::TrackingTopologyN;
3636
using typename TimeFrame<NLayers>::TrackSeedN;
37-
static constexpr int MaxTransitions = TrackingTopologyN::MaxTransitions;
37+
static constexpr int MaxLinks = TrackingTopologyN::MaxLinks;
3838
static constexpr int MaxCells = TrackingTopologyN::MaxCells;
3939
static constexpr int MaxStreams = MaxCells > NLayers ? MaxCells : NLayers;
4040

@@ -157,7 +157,7 @@ class TimeFrameGPU : public TimeFrame<NLayers>
157157
void setDevicePropagator(const o2::base::PropagatorImpl<float>* p) final { this->mPropagatorDevice = p; }
158158

159159
// Host-specific getters
160-
gsl::span<int> getNTracklets() { return {mNTracklets.data(), static_cast<gsl::span<int>::size_type>(this->mTrackingTopologyView.nTransitions)}; }
160+
gsl::span<int> getNTracklets() { return {mNTracklets.data(), static_cast<gsl::span<int>::size_type>(this->mTrackingTopologyView.nLinks)}; }
161161
gsl::span<int> getNCells() { return {mNCells.data(), static_cast<gsl::span<int>::size_type>(this->mTrackingTopologyView.nCells)}; }
162162
auto& getArrayNCells() { return mNCells; }
163163
gsl::span<int> getNNeighbours() { return {mNNeighbours.data(), static_cast<gsl::span<int>::size_type>(this->mTrackingTopologyView.nCells)}; }
@@ -179,7 +179,7 @@ class TimeFrameGPU : public TimeFrame<NLayers>
179179
void allocMem(void**, size_t, bool, int32_t = o2::gpu::GPUMemoryResource::MEMORY_GPU); // Abstract owned and unowned memory allocations on default stream
180180

181181
// Host-available device buffer sizes
182-
std::array<int, MaxTransitions> mNTracklets{};
182+
std::array<int, MaxLinks> mNTracklets{};
183183
std::array<int, MaxCells> mNCells{};
184184
std::array<int, MaxCells> mNNeighbours{};
185185

@@ -205,8 +205,8 @@ class TimeFrameGPU : public TimeFrame<NLayers>
205205
const int** mClustersIndexTablesDeviceArray;
206206
uint8_t** mUsedClustersDeviceArray;
207207
const int** mROFramesClustersDeviceArray;
208-
std::array<Tracklet*, MaxTransitions> mTrackletsDevice{};
209-
std::array<int*, MaxTransitions> mTrackletsLUTDevice{};
208+
std::array<Tracklet*, MaxLinks> mTrackletsDevice{};
209+
std::array<int*, MaxLinks> mTrackletsLUTDevice{};
210210
std::array<int*, MaxCells> mCellsLUTDevice{};
211211
std::array<int*, MaxCells> mNeighboursLUTDevice{};
212212

@@ -258,7 +258,7 @@ inline std::vector<unsigned int> TimeFrameGPU<NLayers>::getClusterSizes()
258258
template <int NLayers>
259259
inline size_t TimeFrameGPU<NLayers>::getNumberOfTracklets() const
260260
{
261-
return std::accumulate(mNTracklets.begin(), mNTracklets.begin() + this->mTrackingTopologyView.nTransitions, 0);
261+
return std::accumulate(mNTracklets.begin(), mNTracklets.begin() + this->mTrackingTopologyView.nLinks, 0);
262262
}
263263

264264
template <int NLayers>

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ExternalAllocator;
4040
template <int NLayers>
4141
void countTrackletsInROFsHandler(const IndexTableUtils<NLayers>* utils,
4242
const typename ROFMaskTable<NLayers>::View& rofMask,
43-
const int transitionId,
43+
const int linkId,
4444
const int fromLayer,
4545
const int toLayer,
4646
const typename ROFOverlapTable<NLayers>::View& rofOverlaps,
@@ -58,20 +58,20 @@ void countTrackletsInROFsHandler(const IndexTableUtils<NLayers>* utils,
5858
const bool selectUPCVertices,
5959
const float NSigmaCut,
6060
const typename TrackingTopology<NLayers>::View topology,
61-
bounded_vector<float>& transitionPhiCuts,
61+
bounded_vector<float>& linkPhiCuts,
6262
const float resolutionPV,
6363
std::array<float, NLayers>& minR,
6464
std::array<float, NLayers>& maxR,
6565
bounded_vector<float>& resolutions,
6666
std::vector<float>& radii,
67-
bounded_vector<float>& transitionMSAngles,
67+
bounded_vector<float>& linkMSAngles,
6868
o2::its::ExternalAllocator* alloc,
6969
gpu::Streams& streams);
7070

7171
template <int NLayers>
7272
void computeTrackletsInROFsHandler(const IndexTableUtils<NLayers>* utils,
7373
const typename ROFMaskTable<NLayers>::View& rofMask,
74-
const int transitionId,
74+
const int linkId,
7575
const int fromLayer,
7676
const int toLayer,
7777
const typename ROFOverlapTable<NLayers>::View& rofOverlaps,
@@ -92,13 +92,13 @@ void computeTrackletsInROFsHandler(const IndexTableUtils<NLayers>* utils,
9292
const bool selectUPCVertices,
9393
const float NSigmaCut,
9494
const typename TrackingTopology<NLayers>::View topology,
95-
bounded_vector<float>& transitionPhiCuts,
95+
bounded_vector<float>& linkPhiCuts,
9696
const float resolutionPV,
9797
std::array<float, NLayers>& minR,
9898
std::array<float, NLayers>& maxR,
9999
bounded_vector<float>& resolutions,
100100
std::vector<float>& radii,
101-
bounded_vector<float>& transitionMSAngles,
101+
bounded_vector<float>& linkMSAngles,
102102
o2::its::ExternalAllocator* alloc,
103103
gpu::Streams& streams);
104104

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TimeFrameGPU.cu

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
380380
void 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

387387
template <int NLayers>
388388
void 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>
491491
void 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

Comments
 (0)