From edc0e79d3fb5be8ccefffcb938f45a0ae02dd629 Mon Sep 17 00:00:00 2001 From: Pratik Nayak Date: Tue, 17 Oct 2023 10:11:59 +0200 Subject: [PATCH] Review updates Co-authored-by: Marcel Koch --- core/base/batch_utilities.hpp | 3 +++ core/matrix/batch_ell.cpp | 13 ++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/base/batch_utilities.hpp b/core/base/batch_utilities.hpp index febfd59b636..b4e380a4162 100644 --- a/core/base/batch_utilities.hpp +++ b/core/base/batch_utilities.hpp @@ -151,6 +151,9 @@ template void assert_same_sparsity_in_batched_data( const std::vector>& data) { + if (data.empty()) { + return; + } auto num_nnz = data.at(0).nonzeros.size(); auto base_data = data.at(0); base_data.ensure_row_major_order(); diff --git a/core/matrix/batch_ell.cpp b/core/matrix/batch_ell.cpp index 88863a05dd4..b2987e741d9 100644 --- a/core/matrix/batch_ell.cpp +++ b/core/matrix/batch_ell.cpp @@ -147,10 +147,7 @@ const Ell* Ell::apply( ptr_param> b, ptr_param> x) const { - 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()); + this->apply(b, x); return this; } @@ -180,13 +177,7 @@ const Ell* Ell::apply( ptr_param> beta, ptr_param> x) const { - 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()); + this->apply(alpha, b, beta, x); return this; }