Skip to content

Commit

Permalink
WIP: update the test
Browse files Browse the repository at this point in the history
note: when disable mixed precision, some of them can not reach double criterion
  • Loading branch information
yhmtsai authored and tcojean committed Apr 20, 2022
1 parent 4a8005d commit 3bf1057
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions reference/test/solver/multigrid_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ class Multigrid : public ::testing::Test {
using CoarseNext = gko::multigrid::AmgxPgm<gko::next_precision<value_type>>;
using Smoother = gko::preconditioner::Jacobi<value_type>;
using CoarsestSolver = gko::solver::Cg<value_type>;
using CoarsestNextSolver = gko::solver::Cg<gko::next_precision<value_type>>;
using DummyRPFactory = DummyMultigridLevelWithFactory<value_type>;
using DummyFactory = DummyLinOpWithFactory<value_type>;
Multigrid()
Expand Down Expand Up @@ -300,6 +301,14 @@ class Multigrid : public ::testing::Test {
.with_reduction_factor(r<value_type>::value)
.on(exec))
.on(exec)),
coarsestnext_factory(
CoarsestNextSolver::build()
.with_criteria(
gko::stop::Iteration::build().with_max_iters(4u).on(exec),
gko::stop::Time::build()
.with_time_limit(std::chrono::seconds(6))
.on(exec))
.on(exec)),
rp_factory(DummyRPFactory::build().on(exec)),
lo_factory(DummyFactory::build().on(exec)),
b(gko::initialize<Mtx>({I<value_type>({1, 0}), I<value_type>({0, 2}),
Expand Down Expand Up @@ -372,13 +381,13 @@ class Multigrid : public ::testing::Test {
Solver::build()
.with_pre_smoother(smoother_factory)
.with_smoother_relax(1.0)
.with_coarsest_solver(coarsest_factory)
.with_coarsest_solver(coarsestnext_factory)
.with_max_levels(2u)
.with_post_uses_pre(true)
.with_mid_case(gko::solver::multigrid::mid_smooth_type::both)
.with_mg_level(coarse_factory, coarsenext_factory)
.with_criteria(
gko::stop::Iteration::build().with_max_iters(100u).on(exec),
gko::stop::Iteration::build().with_max_iters(200u).on(exec),
gko::stop::Time::build()
.with_time_limit(std::chrono::seconds(100))
.on(exec),
Expand Down Expand Up @@ -466,6 +475,7 @@ class Multigrid : public ::testing::Test {
std::shared_ptr<typename CoarseNext::Factory> coarsenext_factory;
std::shared_ptr<typename Smoother::Factory> smoother_factory;
std::shared_ptr<typename CoarsestSolver::Factory> coarsest_factory;
std::shared_ptr<typename CoarsestNextSolver::Factory> coarsestnext_factory;
std::shared_ptr<typename DummyRPFactory::Factory> rp_factory;
std::shared_ptr<typename DummyFactory::Factory> lo_factory;
std::shared_ptr<Mtx> b;
Expand Down

0 comments on commit 3bf1057

Please sign in to comment.