Skip to content
Snippets Groups Projects
Commit 3e2cff17 authored by Felix Weiglhofer's avatar Felix Weiglhofer
Browse files

algo: Fix issue with freeing buffers in constant memory.

parent edadafc0
No related branches found
No related tags found
1 merge request!1170algo: Various smaller changes.
......@@ -15,6 +15,14 @@ void sts::HitfinderChain::SetParameters(const sts::HitfinderPars& parameters)
AllocateStatic();
}
void sts::HitfinderChain::Finalize()
{
// Explicitly free buffers in constant memory.
// This avoids an issue in xpu with teardown order of static variables when using CPU.
fHitfinder = {};
xpu::set<TheHitfinder>(fHitfinder);
}
void sts::HitfinderChain::operator()(gsl::span<const CbmStsDigi> digis)
{
EnsureParameters();
......
......@@ -43,6 +43,11 @@ namespace cbm::algo::sts
void SetParameters(const sts::HitfinderPars& parameters);
const sts::HitfinderPars& GetParameters() const { return *fPars; }
/**
* Teardown chain.
*/
void Finalize();
void operator()(gsl::span<const CbmStsDigi>);
private:
......
......@@ -106,6 +106,8 @@ void Reco::Run(const fles::Timeslice& ts)
void Reco::Finalize()
{
fStsHitFinder.Finalize();
// Pop timer that was started in Init()
xpu::timings t = xpu::pop_timer();
if (Opts().CollectKernelTimes()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment