Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DefaultGPUAllocator : public ExternalAllocator
};

template <int nLayers = 7>
class TimeFrameGPU : public TimeFrame
class TimeFrameGPU : public TimeFrame<nLayers>
{
public:
TimeFrameGPU();
Expand Down Expand Up @@ -205,14 +205,14 @@ class TimeFrameGPU : public TimeFrame
template <int nLayers>
inline int TimeFrameGPU<nLayers>::getNClustersInRofSpan(const int rofIdstart, const int rofSpanSize, const int layerId) const
{
return static_cast<int>(mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < mROFramesClusters.size() ? rofIdstart + rofSpanSize : mROFramesClusters.size() - 1] - mROFramesClusters[layerId][rofIdstart]);
return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
}

template <int nLayers>
inline std::vector<unsigned int> TimeFrameGPU<nLayers>::getClusterSizes()
{
std::vector<unsigned int> sizes(mUnsortedClusters.size());
std::transform(mUnsortedClusters.begin(), mUnsortedClusters.end(), sizes.begin(),
std::vector<unsigned int> sizes(this->mUnsortedClusters.size());
std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(), sizes.begin(),
[](const auto& v) { return static_cast<unsigned int>(v.size()); });
return sizes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
#include "ITStracking/TrackerTraits.h"
#include "ITStrackingGPU/TimeFrameGPU.h"

namespace o2
{
namespace its
namespace o2::its
{

template <int nLayers = 7>
class TrackerTraitsGPU final : public TrackerTraits
class TrackerTraitsGPU final : public TrackerTraits<nLayers>
{
public:
TrackerTraitsGPU() = default;
~TrackerTraitsGPU() override = default;

void adoptTimeFrame(TimeFrame* tf) final;
void adoptTimeFrame(TimeFrame<nLayers>* tf) final;
void initialiseTimeFrame(const int iteration) final;

void computeLayerTracklets(const int iteration, int, int) final;
Expand All @@ -54,13 +52,6 @@ class TrackerTraitsGPU final : public TrackerTraits
gpu::TimeFrameGPU<7>* mTimeFrameGPU;
};

template <int nLayers>
inline void TrackerTraitsGPU<nLayers>::adoptTimeFrame(TimeFrame* tf)
{
mTimeFrameGPU = static_cast<gpu::TimeFrameGPU<nLayers>*>(tf);
mTimeFrame = static_cast<TimeFrame*>(tf);
}
} // namespace its
} // namespace o2
} // namespace o2::its

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void countTrackletsInROFsHandler(const IndexTableUtils* utils,
const float NSigmaCut,
std::vector<float>& phiCuts,
const float resolutionPV,
std::vector<float>& minR,
std::vector<float>& maxR,
std::array<float, nLayers>& minR,
std::array<float, nLayers>& maxR,
std::vector<float>& resolutions,
std::vector<float>& radii,
std::vector<float>& mulScatAng,
Expand Down Expand Up @@ -106,8 +106,8 @@ void computeTrackletsInROFsHandler(const IndexTableUtils* utils,
const float NSigmaCut,
std::vector<float>& phiCuts,
const float resolutionPV,
std::vector<float>& minR,
std::vector<float>& maxR,
std::array<float, nLayers>& minR,
std::array<float, nLayers>& maxR,
std::vector<float>& resolutions,
std::vector<float>& radii,
std::vector<float>& mulScatAng,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,30 @@ class ROframe;

using constants::its2::InversePhiBinSize;

class VertexerTraitsGPU : public VertexerTraits
class VertexerTraitsGPU final : public VertexerTraits
{
public:
VertexerTraitsGPU();
~VertexerTraitsGPU() = default;
void initialise(const TrackingParameters&, const int iteration = 0) override;
void adoptTimeFrame(TimeFrame*) override;
void computeTracklets(const int iteration = 0) override;
void computeTrackletMatching(const int iteration = 0) override;
void computeVertices(const int iteration = 0) override;
void updateVertexingParameters(const std::vector<VertexingParameters>&, const TimeFrameGPUParameters&) override;

// Hybrid
void initialiseHybrid(const TrackingParameters& pars, const int iteration = 0) override { VertexerTraits::initialise(pars, iteration); }
void computeTrackletsHybrid(const int iteration = 0) override { VertexerTraits::computeTracklets(iteration); }
void computeTrackletMatchingHybrid(const int iteration = 0) override { VertexerTraits::computeTrackletMatching(iteration); }
void computeVerticesHybrid(const int iteration = 0) override { VertexerTraits::computeVertices(iteration); }
void adoptTimeFrameHybrid(TimeFrame* tf) override { VertexerTraits::adoptTimeFrame(tf); }

void initialise(const TrackingParameters&, const int iteration = 0) final;
void adoptTimeFrame(TimeFrame<7>*) noexcept final;
void computeTracklets(const int iteration = 0) final;
void computeTrackletMatching(const int iteration = 0) final;
void computeVertices(const int iteration = 0) final;
void updateVertexingParameters(const std::vector<VertexingParameters>&, const TimeFrameGPUParameters&) final;
void computeVerticesHist();

bool isGPU() const noexcept final { return true; }
const char* getName() const noexcept final { return "GPU"; }

protected:
IndexTableUtils* mDeviceIndexTableUtils;
gpu::TimeFrameGPU<7>* mTimeFrameGPU;
TimeFrameGPUParameters mTfGPUParams;
};

inline void VertexerTraitsGPU::adoptTimeFrame(TimeFrame* tf)
inline void VertexerTraitsGPU::adoptTimeFrame(TimeFrame<7>* tf) noexcept
{
mTimeFrameGPU = static_cast<gpu::TimeFrameGPU<7>*>(tf);
mTimeFrame = static_cast<TimeFrame*>(tf);
mTimeFrame = static_cast<TimeFrame<7>*>(tf);
}

} // namespace its
Expand Down
Loading