Skip to content

Commit

Permalink
fix Ref also considered as Omp executor
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Koch <[email protected]>
  • Loading branch information
yhmtsai and MarcelKoch committed Nov 27, 2024
1 parent 88854e3 commit 8204f85
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion core/factorization/ic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ std::unique_ptr<Composition<ValueType>> Ic<ValueType, IndexType>::generate(
transpose_idxs.get_const_data(), *forest, factors.get(), false,
tmp));
ic = factors;
} else if (std::dynamic_pointer_cast<const OmpExecutor>(exec)) {
} else if (std::dynamic_pointer_cast<const OmpExecutor>(exec) &&
!std::dynamic_pointer_cast<const ReferenceExecutor>(exec)) {
GKO_INVALID_STATE(
"OmpExecutor does not support sparselib algorithm. Please use "
"syncfree algorithm.");
Expand Down
3 changes: 2 additions & 1 deletion core/factorization/ilu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ std::unique_ptr<Composition<ValueType>> Ilu<ValueType, IndexType>::generate_l_u(
storage.get_const_data(), diag_idxs.get_const_data(), factors.get(),
false, tmp));
ilu = factors;
} else if (std::dynamic_pointer_cast<const OmpExecutor>(exec)) {
} else if (std::dynamic_pointer_cast<const OmpExecutor>(exec) &&
!std::dynamic_pointer_cast<const ReferenceExecutor>(exec)) {
GKO_INVALID_STATE(
"OmpExecutor does not support sparselib algorithm. Please use "
"syncfree algorithm.");
Expand Down
10 changes: 6 additions & 4 deletions test/factorization/ic_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ class Ic : public CommonTestFixture {

TEST_F(Ic, ComputeICBySyncfreeIsEquivalentToRefSorted)
{
auto fact = gko::factorization::Ic<>::build()
.with_skip_sorting(true)
.on(ref)
->generate(mtx);
auto fact =
gko::factorization::Ic<>::build()
.with_skip_sorting(true)
.with_algorithm(gko::factorization::incomplete_algorithm::syncfree)
.on(ref)
->generate(mtx);
auto dfact =
gko::factorization::Ic<>::build()
.with_skip_sorting(true)
Expand Down
10 changes: 6 additions & 4 deletions test/factorization/ilu_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ class Ilu : public CommonTestFixture {

TEST_F(Ilu, ComputeILUBySyncfreeIsEquivalentToRefSorted)
{
auto fact = gko::factorization::Ilu<>::build()
.with_skip_sorting(true)
.on(ref)
->generate(mtx);
auto fact =
gko::factorization::Ilu<>::build()
.with_skip_sorting(true)
.with_algorithm(gko::factorization::incomplete_algorithm::syncfree)
.on(ref)
->generate(mtx);
auto dfact =
gko::factorization::Ilu<>::build()
.with_skip_sorting(true)
Expand Down

0 comments on commit 8204f85

Please sign in to comment.