From 59f099d6590af112130289bfadc50bc72cc84e70 Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Thu, 19 Oct 2023 11:16:28 +0200 Subject: [PATCH] fix batch ell infinite loop --- core/matrix/batch_ell.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/matrix/batch_ell.cpp b/core/matrix/batch_ell.cpp index b2987e741d9..19b2dcae5c3 100644 --- a/core/matrix/batch_ell.cpp +++ b/core/matrix/batch_ell.cpp @@ -134,10 +134,7 @@ Ell* Ell::apply( ptr_param> b, ptr_param> x) { - this->validate_application_parameters(b.get(), x.get()); - auto exec = this->get_executor(); - this->apply_impl(make_temporary_clone(exec, b).get(), - make_temporary_clone(exec, x).get()); + static_cast(this)->apply(b, x); return this; } @@ -147,7 +144,10 @@ const Ell* Ell::apply( ptr_param> b, ptr_param> x) const { - this->apply(b, x); + this->validate_application_parameters(b.get(), x.get()); + auto exec = this->get_executor(); + this->apply_impl(make_temporary_clone(exec, b).get(), + make_temporary_clone(exec, x).get()); return this; } @@ -159,13 +159,7 @@ Ell* Ell::apply( ptr_param> beta, ptr_param> x) { - this->validate_application_parameters(alpha.get(), b.get(), beta.get(), - x.get()); - auto exec = this->get_executor(); - this->apply_impl(make_temporary_clone(exec, alpha).get(), - make_temporary_clone(exec, b).get(), - make_temporary_clone(exec, beta).get(), - make_temporary_clone(exec, x).get()); + static_cast(this)->apply(alpha, b, beta, x); return this; } @@ -177,7 +171,13 @@ const Ell* Ell::apply( ptr_param> beta, ptr_param> x) const { - this->apply(alpha, b, beta, x); + this->validate_application_parameters(alpha.get(), b.get(), beta.get(), + x.get()); + auto exec = this->get_executor(); + this->apply_impl(make_temporary_clone(exec, alpha).get(), + make_temporary_clone(exec, b).get(), + make_temporary_clone(exec, beta).get(), + make_temporary_clone(exec, x).get()); return this; }