Skip to content

Commit 6726cd4

Browse files
committed
fix2
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 378cc24 commit 6726cd4

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class TimeFrameGPU final : public TimeFrame<NLayers>
157157
private:
158158
void allocMemAsync(void**, size_t, Stream&, bool, int32_t = o2::gpu::GPUMemoryResource::MEMORY_GPU); // Abstract owned and unowned memory allocations on specific stream
159159
void allocMem(void**, size_t, bool, int32_t = o2::gpu::GPUMemoryResource::MEMORY_GPU); // Abstract owned and unowned memory allocations on default stream
160+
void releaseTrackingParametersDevice();
160161

161162
// Host-available device buffer sizes
162163
std::array<int, MaxTransitions> mNTracklets{};

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,25 @@ void TimeFrameGPU<NLayers>::loadTrackingParametersDevice(const TrackingParameter
8080
GPUChkErrS(cudaMemcpy(mLayerxX0Device, trkParam.LayerxX0.data(), trkParam.LayerxX0.size() * sizeof(float), cudaMemcpyHostToDevice));
8181
}
8282

83+
template <int NLayers>
84+
void TimeFrameGPU<NLayers>::releaseTrackingParametersDevice()
85+
{
86+
if (!this->hasFrameworkAllocator()) {
87+
if (mLayerRadiiDevice != nullptr) {
88+
GPUChkErrS(cudaFree(mLayerRadiiDevice));
89+
}
90+
if (mMinPtsDevice != nullptr) {
91+
GPUChkErrS(cudaFree(mMinPtsDevice));
92+
}
93+
if (mLayerxX0Device != nullptr) {
94+
GPUChkErrS(cudaFree(mLayerxX0Device));
95+
}
96+
}
97+
mLayerRadiiDevice = nullptr;
98+
mMinPtsDevice = nullptr;
99+
mLayerxX0Device = nullptr;
100+
}
101+
83102
template <int NLayers>
84103
void TimeFrameGPU<NLayers>::createUnsortedClustersDeviceArray(const int maxLayers)
85104
{
@@ -679,6 +698,7 @@ template <int NLayers>
679698
void TimeFrameGPU<NLayers>::wipe()
680699
{
681700
unregisterHostMemory(0);
701+
releaseTrackingParametersDevice();
682702
o2::its::TimeFrame<NLayers>::wipe();
683703
}
684704

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackerTraitsGPU.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,6 @@ void TrackerTraitsGPU<NLayers>::findRoads(const int iteration)
387387
auto& tracks = mTimeFrameGPU->getTrackITSExt();
388388
this->acceptTracks(iteration, tracks, firstClusters, sharedFirstClusters);
389389
mTimeFrameGPU->loadUsedClustersDevice();
390-
// The next road-building level reads the updated used-cluster mask on the default stream.
391-
mTimeFrameGPU->syncStreams(false);
392390
}
393391
this->markTracks(iteration, sharedFirstClusters);
394392
// wipe the artefact memory

0 commit comments

Comments
 (0)