Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c07403f0 authored by hhakim's avatar hhakim
Browse files

Fix a memory leak (affecting both GPU2 and Cpu impls) into palm4msa 2020.

parent 0e58cc5f
Branches
Tags
No related merge requests found
......@@ -124,8 +124,6 @@ int main(int argc, char* argv[])
cout << "norm2_threshold: "<< norm2_threshold << endl;
cout << "norm2_max_iter:" << norm2_max_iter << endl;
vector<StoppingCriterion<Real<FPP>>> sc = {30,30};
// sc.push_back(30);
// sc.push_back(30);
auto th = Faust::hierarchical(whtmat_gpu, sc, fac_cons, res_cons, lambda, isUpdateWayR2L,
isFactSideLeft, use_csr, packing_RL,
/* compute_2norm_on_array*/ false,
......@@ -142,6 +140,8 @@ int main(int argc, char* argv[])
cout << th->normFro() << endl;
FPP2 relativeError = Faust::fabs(faustProduct.norm()/whtmat_gpu.norm());
th->display();
delete th;
std::cout<<std::endl;
std::cout<<"**************** RELATIVE ERROR BETWEEN FAUST AND DATA MATRIX **************** "<<std::endl;
std::cout<<" "<<relativeError<<std::endl<<std::endl;
......
......@@ -221,5 +221,13 @@ void Faust::palm4msa2(const Faust::MatDense<FPP,DEVICE>& A,
i++;
}
S.update_total_nnz();
// free the latest pR and pL TransformHelpers
for(int i=0;i<nfacts;i++)
{
if(pL[i] != nullptr)
delete pL[i];
if(pR[i] != nullptr)
delete pR[i];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment