Remove unnecessary release()

This commit is contained in:
Tong Dong Qiu 2022-11-02 17:01:52 +01:00
parent 3055c0e921
commit 5dea01b9dc
2 changed files with 2 additions and 6 deletions

View File

@ -51,11 +51,6 @@ rocalutionSolverBackend<block_size>::rocalutionSolverBackend(int verbosity_, int
template <unsigned int block_size>
rocalutionSolverBackend<block_size>::~rocalutionSolverBackend() {
rocalution::stop_rocalution();
// these should be automatically release when rocalutionSolverBackend is destroyed
// however, without these, the test_rocalutionSolver segfaults
roc_solver.release();
roc_prec.release();
}

View File

@ -60,8 +60,9 @@ private:
int *tmp_colindices; // store matrix on host, this pointer is given to and freed by rocalution
double *tmp_nnzvalues; // store matrix on host, this pointer is given to and freed by rocalution
std::unique_ptr<rocalution::BiCGStab<rocalution::LocalMatrix<double>, rocalution::LocalVector<double>, double> > roc_solver;
// must be declared in this order, to prevent a segfault during the test
std::unique_ptr<rocalution::ILU<rocalution::LocalMatrix<double>, rocalution::LocalVector<double>, double> > roc_prec;
std::unique_ptr<rocalution::BiCGStab<rocalution::LocalMatrix<double>, rocalution::LocalVector<double>, double> > roc_solver;
/// Initialize sizes and allocate memory
/// \param[in] matrix matrix A