Skip to content
Open
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 @@ -159,9 +159,9 @@ class TrackParametrization
GPUd() void set(value_t x, value_t alpha, const params_t& par, int charge = 1, const PID pid = PID::Pion);
GPUd() void set(value_t x, value_t alpha, const value_t* par, int charge = 1, const PID pid = PID::Pion);
GPUd() const value_t* getParams() const;
GPUd() value_t getParam(int i) const;
GPUd() value_t getX() const;
GPUd() value_t getAlpha() const;
GPUhd() value_t getParam(int i) const;
GPUhd() value_t getX() const;
GPUhd() value_t getAlpha() const;
GPUd() value_t getY() const;
GPUd() value_t getZ() const;
GPUd() value_t getSnp() const;
Expand Down Expand Up @@ -330,21 +330,21 @@ GPUdi() auto TrackParametrization<value_T>::getParams() const -> const value_t*

//____________________________________________________________
template <typename value_T>
GPUdi() auto TrackParametrization<value_T>::getParam(int i) const -> value_t
GPUhdi() auto TrackParametrization<value_T>::getParam(int i) const -> value_t
{
return mP[i];
}

//____________________________________________________________
template <typename value_T>
GPUdi() auto TrackParametrization<value_T>::getX() const -> value_t
GPUhdi() auto TrackParametrization<value_T>::getX() const -> value_t
{
return mX;
}

//____________________________________________________________
template <typename value_T>
GPUdi() auto TrackParametrization<value_T>::getAlpha() const -> value_t
GPUhdi() auto TrackParametrization<value_T>::getAlpha() const -> value_t
{
return mAlpha;
}
Expand Down
30 changes: 14 additions & 16 deletions Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ class TimeFrameGPU : public TimeFrame<NLayers>
int* getDeviceLineDensity() { return mLineDensityDevice; }
gpu::LineWindow* getDeviceLineWin() { return mLineWinDevice; }
uint8_t* getDeviceLineIsPeak() { return mLineIsPeakDevice; }
int* getDeviceLineDensityFine() { return mLineDensityFineDevice; }
gpu::LineWindow* getDeviceLineWinFine() { return mLineWinFineDevice; }
uint8_t* getDeviceLineIsPeakFine() { return mLineIsPeakFineDevice; }
gpu::LineWindow* getDeviceLineWinPeak() { return mLineWinPeakDevice; }
float* getDeviceLineHalfWidth() { return mLineHalfWidthDevice; }
gpu::LineWindow* getDeviceLineWinSeed() { return mLineWinSeedDevice; }
int* getDevicePeakScan() { return mPeakScanDevice; }
int* getDevicePeakLineIdx() { return mPeakLineIdxDevice; }
int* getDevicePeakOffsets() { return mPeakOffsetsDevice; }
Expand Down Expand Up @@ -197,7 +197,6 @@ class TimeFrameGPU : public TimeFrame<NLayers>
int** getDeviceArrayNeighboursCellLUT() const { return mNeighboursCellLUTDeviceArray; }
CellSeed** getDeviceArrayCells() { return mCellsDeviceArray; }
TrackSeedN* getDeviceTrackSeeds() { return mTrackSeedsDevice; }
int* getDeviceTrackSeedIndices() { return mTrackSeedIndicesDevice; }
int* getDeviceTrackCounter() { return mTrackCounterDevice; }
auto getNTrackSeeds() const { return mNTracks; }

Expand Down Expand Up @@ -300,7 +299,6 @@ class TimeFrameGPU : public TimeFrame<NLayers>
std::array<CellSeed*, MaxCells> mCellsDevice{};
CellSeed** mCellsDeviceArray{nullptr};
TrackSeedN* mTrackSeedsDevice{nullptr};
int* mTrackSeedIndicesDevice{nullptr}; ///< which seed each emitted track was fitted from
int* mTrackCounterDevice{nullptr};
unsigned int mNTracks{0};

Expand All @@ -325,17 +323,17 @@ class TimeFrameGPU : public TimeFrame<NLayers>
float* mLineZsSortedDevice{nullptr};
o2::its::TimeEstBC* mLineTimesSortedDevice{nullptr};
int* mLinesSortedIdx{nullptr};
int* mLineRofSortedDevice{nullptr}; // per (sorted) line's ROF
int* mRofLineOffsetsDevice{nullptr}; // CSR offsets into the (rof,z)-sorted lines, size nRofs+1
int* mLineDensityDevice{nullptr}; // per (sorted) line: count of time-compatible neighbours in its z-window
gpu::LineWindow* mLineWinDevice{nullptr}; // per (sorted) line: [lo,hi) bounds of its z-window (sorted coords)
uint8_t* mLineIsPeakDevice{nullptr}; // per (sorted) line: 1 if it is a local density peak (vertex candidate)
int* mLineDensityFineDevice{nullptr};
gpu::LineWindow* mLineWinFineDevice{nullptr};
uint8_t* mLineIsPeakFineDevice{nullptr};
int* mPeakScanDevice{nullptr}; // per (sorted) line: number of peaks strictly before it
int* mPeakLineIdxDevice{nullptr}; // per peak slot: the sorted line index it came from
int* mPeakOffsetsDevice{nullptr}; // CSR offsets into the compacted peaks
int* mLineRofSortedDevice{nullptr}; // per (sorted) line's ROF
int* mRofLineOffsetsDevice{nullptr}; // CSR offsets into the (rof,z)-sorted lines, size nRofs+1
int* mLineDensityDevice{nullptr}; // per (sorted) line: count of time-compatible neighbours in its own z window (+-h)
gpu::LineWindow* mLineWinDevice{nullptr}; // per (sorted) line: [lo,hi) bounds of +-zWindow, where members are collected (sorted coords)
uint8_t* mLineIsPeakDevice{nullptr}; // per (sorted) line: 1 if it is a local density peak (vertex candidate)
gpu::LineWindow* mLineWinPeakDevice{nullptr}; // per (sorted) line: [lo,hi) bounds of its own z window +-h (peak search)
float* mLineHalfWidthDevice{nullptr}; // per (sorted) line: h
gpu::LineWindow* mLineWinSeedDevice{nullptr}; // per (sorted) line: [lo,hi) bounds of the seed-fit window +-2h
int* mPeakScanDevice{nullptr}; // per (sorted) line: number of peaks strictly before it
int* mPeakLineIdxDevice{nullptr}; // per peak slot: the sorted line index it came from
int* mPeakOffsetsDevice{nullptr}; // CSR offsets into the compacted peaks
VertexCand* mVertexCandsDevice{nullptr};
int mNLinesCapacity{0}; // = nCells the line buffers were sized for
bounded_vector<o2::its::Line> mLinesHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ struct TrackingKernels {
const int** ROFClusters,
o2::its::TrackITSExt* tracks,
int* trackIndices,
int* trackSeedIndices,
int* outputCounter,
const int trackCapacity,
TrackExtensionHypothesis<NLayers>* activeHypotheses,
Expand Down Expand Up @@ -234,9 +233,14 @@ struct TrackingKernels {
static void scanDensityHandler(const int nLines,
const gpu::LineProjSoA sortedSoa,
const int* rofOffsets,
int* density,
gpu::LineWindow* win,
gpu::LineWindow* winPeak,
int* density,
float* halfWidth,
gpu::LineWindow* winSeed,
const float zWindow,
const float alpha,
const float hMin,
gpu::Stream& stream);

static void findPeaksHandler(const int nLines,
Expand All @@ -245,11 +249,8 @@ struct TrackingKernels {
const int* rofOffsets,
const int* density,
const gpu::LineWindow* win,
const float* halfWidth,
uint8_t* isPeak,
const int* densityFine,
const gpu::LineWindow* winFine,
const int fineMinDensity,
uint8_t* isPeakFine,
int* peakScan,
int* peakLineIdx,
int* peakOffsets,
Expand All @@ -259,6 +260,7 @@ struct TrackingKernels {
static void fitPeaksHandler(const int* nPeaksDevice,
const int* peakLineIdx,
const gpu::LineWindow* win,
const gpu::LineWindow* seedWin,
const gpu::LineProjSoA sortedSoa,
const o2::its::Line* lines,
const float* lineChi2,
Expand All @@ -270,8 +272,6 @@ struct TrackingKernels {
const int minContributors,
const float beamX,
const float beamY,
const uint8_t* isPeakFine,
const float fineMaxDrift,
gpu::VertexCand* cands,
gpu::Stream& stream);

Expand Down
7 changes: 3 additions & 4 deletions Detectors/ITSMFT/ITS/tracking/GPU/cuda/TimeFrameGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ void TimeFrameGPU<NLayers>::createLinesDevice(const int nCells)
mLineDensityDevice = allocDeviceAsync<int>(nCells, mGpuStreams[0], kStack);
mLineWinDevice = allocDeviceAsync<gpu::LineWindow>(nCells, mGpuStreams[0], kStack);
mLineIsPeakDevice = allocDeviceAsync<uint8_t>(nCells, mGpuStreams[0], kStack);
mLineDensityFineDevice = allocDeviceAsync<int>(nCells, mGpuStreams[0], kStack);
mLineWinFineDevice = allocDeviceAsync<gpu::LineWindow>(nCells, mGpuStreams[0], kStack);
mLineIsPeakFineDevice = allocDeviceAsync<uint8_t>(nCells, mGpuStreams[0], kStack);
mLineWinPeakDevice = allocDeviceAsync<gpu::LineWindow>(nCells, mGpuStreams[0], kStack);
mLineHalfWidthDevice = allocDeviceAsync<float>(nCells, mGpuStreams[0], kStack);
mLineWinSeedDevice = allocDeviceAsync<gpu::LineWindow>(nCells, mGpuStreams[0], kStack);
mPeakScanDevice = allocDeviceAsync<int>((nCells + 1), mGpuStreams[0], kStack);
mPeakLineIdxDevice = allocDeviceAsync<int>(nCells, mGpuStreams[0], kStack);
mPeakOffsetsDevice = allocDeviceAsync<int>((this->getNrof(1) + 1), mGpuStreams[0], kStack);
Expand Down Expand Up @@ -706,7 +706,6 @@ void TimeFrameGPU<NLayers>::createTrackITSExtDevice(const size_t capacity)
}
GPULog("gpu-allocation: reserving {} track indices, for {:.2f} MB.", capacity, capacity * sizeof(int) / constants::MB);
mTrackIndicesDevice = allocDevice<int>(capacity, o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK);
mTrackSeedIndicesDevice = allocDevice<int>(capacity, o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK);
mTrackCounterDevice = allocDevice<int>(1, o2::gpu::GPUMemoryResource::MEMORY_GPU | o2::gpu::GPUMemoryResource::MEMORY_STACK);
}

Expand Down
35 changes: 12 additions & 23 deletions Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackerTraitsGPU.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -289,37 +289,28 @@ void TrackerTraitsGPU<NLayers>::computeVertexCandidates(const int iteration)

const auto& tp = this->mTrkParams[iteration];
const float zWindow = 0.5f * tp.VtxClusterCut;
// every line gets its own z window, sized by the density of time-compatible lines around it
TrackingKernels<NLayers>::scanDensityHandler(static_cast<int>(nLines),
mTimeFrameGPU->getLineProjSortedSoA(),
mTimeFrameGPU->getDeviceRofLineOffsets(),
mTimeFrameGPU->getDeviceLineDensity(),
mTimeFrameGPU->getDeviceLineWin(),
mTimeFrameGPU->getDeviceLineWinPeak(),
mTimeFrameGPU->getDeviceLineDensity(),
mTimeFrameGPU->getDeviceLineHalfWidth(),
mTimeFrameGPU->getDeviceLineWinSeed(),
zWindow,
tp.VtxAdaptiveZWindowAlpha,
std::min(tp.VtxAdaptiveZWindowMin, zWindow),
mTimeFrameGPU->getStream(0));

const float fineZWindow = tp.VtxFineZWindow;
const bool doFine = fineZWindow > 0.f && fineZWindow < zWindow;
if (doFine) {
TrackingKernels<NLayers>::scanDensityHandler(static_cast<int>(nLines),
mTimeFrameGPU->getLineProjSortedSoA(),
mTimeFrameGPU->getDeviceRofLineOffsets(),
mTimeFrameGPU->getDeviceLineDensityFine(),
mTimeFrameGPU->getDeviceLineWinFine(),
fineZWindow,
mTimeFrameGPU->getStream(0));
}

TrackingKernels<NLayers>::findPeaksHandler(nLines,
mTimeFrameGPU->getNrof(1),
mTimeFrameGPU->getLineProjSortedSoA(),
mTimeFrameGPU->getDeviceRofLineOffsets(),
mTimeFrameGPU->getDeviceLineDensity(),
mTimeFrameGPU->getDeviceLineWin(),
mTimeFrameGPU->getDeviceLineWinPeak(),
mTimeFrameGPU->getDeviceLineHalfWidth(),
mTimeFrameGPU->getDeviceLineIsPeak(),
doFine ? mTimeFrameGPU->getDeviceLineDensityFine() : nullptr,
doFine ? mTimeFrameGPU->getDeviceLineWinFine() : nullptr,
tp.VtxFineMinDensity,
doFine ? mTimeFrameGPU->getDeviceLineIsPeakFine() : nullptr,
mTimeFrameGPU->getDevicePeakScan(),
mTimeFrameGPU->getDevicePeakLineIdx(),
mTimeFrameGPU->getDevicePeakOffsets(),
Expand All @@ -329,7 +320,8 @@ void TrackerTraitsGPU<NLayers>::computeVertexCandidates(const int iteration)
const float goodLinePtCut = std::abs(mTimeFrameGPU->getBz()) > 0.01f ? tp.VtxGoodLinePtCut : -1.f;
TrackingKernels<NLayers>::fitPeaksHandler(mTimeFrameGPU->getDeviceNPeaks(),
mTimeFrameGPU->getDevicePeakLineIdx(),
mTimeFrameGPU->getDeviceLineWin(),
mTimeFrameGPU->getDeviceLineWin(), // members from +-zWindow
mTimeFrameGPU->getDeviceLineWinSeed(),
mTimeFrameGPU->getLineProjSortedSoA(),
mTimeFrameGPU->getDeviceLines(),
mTimeFrameGPU->getDeviceLineChi2(),
Expand All @@ -341,8 +333,6 @@ void TrackerTraitsGPU<NLayers>::computeVertexCandidates(const int iteration)
tp.VtxClusterContributorsCut,
mTimeFrameGPU->getBeamX(),
mTimeFrameGPU->getBeamY(),
doFine ? mTimeFrameGPU->getDeviceLineIsPeakFine() : nullptr,
tp.VtxFineMaxDrift,
mTimeFrameGPU->getDeviceVertexCands(),
mTimeFrameGPU->getStream(0));

Expand Down Expand Up @@ -448,7 +438,7 @@ void TrackerTraitsGPU<NLayers>::computeVertices(const int iteration)
double rofLoad = 0.;
if (goodSig > 0.f) { // compute the number of contributors in this ROF
for (int p = peakOffsets[rofId]; p < peakOffsets[rofId + 1]; ++p) {
if (cands[p].ok && !cands[p].fine) {
if (cands[p].ok) {
rofLoad += cands[p].size;
}
}
Expand Down Expand Up @@ -703,7 +693,6 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
mTimeFrameGPU->getDeviceROFrameClusters(),
mTimeFrameGPU->getDeviceTrackITSExt(),
mTimeFrameGPU->getDeviceTrackIndices(),
mTimeFrameGPU->getDeviceTrackSeedIndices(),
mTimeFrameGPU->getDeviceTrackCounter(),
capacity,
extendTracks ? mTimeFrameGPU->getDeviceActiveTrackExtensionHypotheses() : nullptr,
Expand Down
Loading
Loading