Commit ba2402b8 authored by Gregor Olenik's avatar Gregor Olenik
Browse files

Fix execution if sysMatrix is not stored

if sysMatrix is not stored and thus the gkomatrix_ptr==NULL the system
matrix is recreated
parent c836294b
......@@ -320,7 +320,19 @@ public:
// gko::lend(b));
auto b_clone = gko::clone(b);
auto gkomatrix = gkomatrix_ptr->get_ptr();
std::shared_ptr<mtx> gkomatrix{};
if (gkomatrix_ptr == NULL) {
gkomatrix = gko::share(
mtx::create(device_exec, gko::dim<2>(nCells(), nCells()),
nElems(), &values_[0]),
nElems(), &col_idxs_[0]),
nElems(), &row_idxs_[0])));
} else {
gkomatrix = gkomatrix_ptr->get_ptr();
solverPerf.initialResidual() = compute_residual(
gko::lend(gkomatrix), gko::lend(x), gko::lend(b_clone));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment