From a80b2226170bd8a395b4e9adc02aaf8c162b7b1e Mon Sep 17 00:00:00 2001 From: Fritz Goebel Date: Thu, 29 Oct 2020 13:22:54 +0100 Subject: [PATCH] Use temporary clone in conversions with given result --- core/matrix/dense.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/matrix/dense.cpp b/core/matrix/dense.cpp index 2cb02fb4361..cb350c31628 100644 --- a/core/matrix/dense.cpp +++ b/core/matrix/dense.cpp @@ -819,7 +819,8 @@ void Dense::make_complex(Dense> *result) const GKO_ASSERT_EQUAL_DIMENSIONS(this, result); - exec->run(dense::make_make_complex(this, result)); + exec->run(dense::make_make_complex( + this, make_temporary_clone(exec, result).get())); } @@ -844,7 +845,8 @@ void Dense::get_real(Dense> *result) const GKO_ASSERT_EQUAL_DIMENSIONS(this, result); - exec->run(dense::make_get_real(this, result)); + exec->run( + dense::make_get_real(this, make_temporary_clone(exec, result).get())); } @@ -869,7 +871,8 @@ void Dense::get_imag(Dense> *result) const GKO_ASSERT_EQUAL_DIMENSIONS(this, result); - exec->run(dense::make_get_imag(this, result)); + exec->run( + dense::make_get_imag(this, make_temporary_clone(exec, result).get())); }