Skip to content

Commit

Permalink
fix batch ell infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Oct 20, 2023
1 parent 0726ab6 commit 59f099d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions core/matrix/batch_ell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ Ell<ValueType, IndexType>* Ell<ValueType, IndexType>::apply(
ptr_param<const MultiVector<ValueType>> b,
ptr_param<MultiVector<ValueType>> 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<const Ell*>(this)->apply(b, x);
return this;
}

Expand All @@ -147,7 +144,10 @@ const Ell<ValueType, IndexType>* Ell<ValueType, IndexType>::apply(
ptr_param<const MultiVector<ValueType>> b,
ptr_param<MultiVector<ValueType>> 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;
}

Expand All @@ -159,13 +159,7 @@ Ell<ValueType, IndexType>* Ell<ValueType, IndexType>::apply(
ptr_param<const MultiVector<ValueType>> beta,
ptr_param<MultiVector<ValueType>> 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<const Ell*>(this)->apply(alpha, b, beta, x);
return this;
}

Expand All @@ -177,7 +171,13 @@ const Ell<ValueType, IndexType>* Ell<ValueType, IndexType>::apply(
ptr_param<const MultiVector<ValueType>> beta,
ptr_param<MultiVector<ValueType>> 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;
}

Expand Down

0 comments on commit 59f099d

Please sign in to comment.