mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-25 00:40:02 -06:00
Fix segfaults rocalutionSolver
This commit is contained in:
parent
c7fec18a86
commit
5620b08033
@ -52,6 +52,11 @@ rocalutionSolverBackend<block_size>::rocalutionSolverBackend(int verbosity_, int
|
||||
|
||||
template <unsigned int block_size>
|
||||
rocalutionSolverBackend<block_size>::~rocalutionSolverBackend() {
|
||||
// normally, these rocalution variables are destroyed after the destructor automatically,
|
||||
// but sometimes it segfaults, both with test_rocalutionSolver and with an actual case
|
||||
// release both variables here to prevent that segfault
|
||||
roc_prec.release();
|
||||
roc_solver.release();
|
||||
rocalution::stop_rocalution();
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,6 @@ 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
|
||||
|
||||
// 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user