From 8204f854794f649bc4a0cae156bd3c61ac6ec248 Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Wed, 27 Nov 2024 10:32:14 +0100 Subject: [PATCH] fix Ref also considered as Omp executor Co-authored-by: Marcel Koch --- core/factorization/ic.cpp | 3 ++- core/factorization/ilu.cpp | 3 ++- test/factorization/ic_kernels.cpp | 10 ++++++---- test/factorization/ilu_kernels.cpp | 10 ++++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/factorization/ic.cpp b/core/factorization/ic.cpp index 818d0586b64..bf9d5e7bbf4 100644 --- a/core/factorization/ic.cpp +++ b/core/factorization/ic.cpp @@ -160,7 +160,8 @@ std::unique_ptr> Ic::generate( transpose_idxs.get_const_data(), *forest, factors.get(), false, tmp)); ic = factors; - } else if (std::dynamic_pointer_cast(exec)) { + } else if (std::dynamic_pointer_cast(exec) && + !std::dynamic_pointer_cast(exec)) { GKO_INVALID_STATE( "OmpExecutor does not support sparselib algorithm. Please use " "syncfree algorithm."); diff --git a/core/factorization/ilu.cpp b/core/factorization/ilu.cpp index 1ef0afa9ef3..f7703f3d20b 100644 --- a/core/factorization/ilu.cpp +++ b/core/factorization/ilu.cpp @@ -144,7 +144,8 @@ std::unique_ptr> Ilu::generate_l_u( storage.get_const_data(), diag_idxs.get_const_data(), factors.get(), false, tmp)); ilu = factors; - } else if (std::dynamic_pointer_cast(exec)) { + } else if (std::dynamic_pointer_cast(exec) && + !std::dynamic_pointer_cast(exec)) { GKO_INVALID_STATE( "OmpExecutor does not support sparselib algorithm. Please use " "syncfree algorithm."); diff --git a/test/factorization/ic_kernels.cpp b/test/factorization/ic_kernels.cpp index d29bbe543e4..51c73ae3272 100644 --- a/test/factorization/ic_kernels.cpp +++ b/test/factorization/ic_kernels.cpp @@ -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) diff --git a/test/factorization/ilu_kernels.cpp b/test/factorization/ilu_kernels.cpp index c08c59eeb20..6f119d63bac 100644 --- a/test/factorization/ilu_kernels.cpp +++ b/test/factorization/ilu_kernels.cpp @@ -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)