Skip to content

Commit

Permalink
change the naming scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed May 11, 2024
1 parent 6325def commit 3a34e38
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
7 changes: 4 additions & 3 deletions core/config/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ configuration_map generate_config_map()
{"preconditioner::Ilu", parse<LinOpFactoryType::Ilu>},
{"preconditioner::Isai", parse<LinOpFactoryType::Isai>},
{"preconditioner::Jacobi", parse<LinOpFactoryType::Jacobi>},
{"Multigrid", parse<LinOpFactoryType::Multigrid>},
{"Pgm", parse<LinOpFactoryType::Pgm>},
{"FixedCoarsening", parse<LinOpFactoryType::FixedCoarsening>}};
{"solver::Multigrid", parse<LinOpFactoryType::Multigrid>},
{"multigrid::Pgm", parse<LinOpFactoryType::Pgm>},
{"multigrid::FixedCoarsening",
parse<LinOpFactoryType::FixedCoarsening>}};
}


Expand Down
31 changes: 17 additions & 14 deletions core/test/config/multigrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ struct MultigridLevelConfigTest {

static void change_template(pnode::map_type& config_map)
{
config_map["ValueType"] = pnode{"float"};
config_map["IndexType"] = pnode{"int64"};
config_map["value_type"] = pnode{"float32"};
config_map["index_type"] = pnode{"int64"};
}
};


struct Pgm : MultigridLevelConfigTest<gko::multigrid::Pgm<float, gko::int64>,
gko::multigrid::Pgm<double, int>> {
static pnode::map_type setup_base() { return {{"Type", pnode{"Pgm"}}}; }
static pnode::map_type setup_base()
{
return {{"type", pnode{"multigrid::Pgm"}}};
}

template <typename ParamType>
static void set(pnode::map_type& config_map, ParamType& param, registry reg,
Expand Down Expand Up @@ -77,7 +80,7 @@ struct FixedCoarsening : MultigridLevelConfigTest<
gko::multigrid::FixedCoarsening<double, int>> {
static pnode::map_type setup_base()
{
return {{"Type", pnode{"FixedCoarsening"}}};
return {{"type", pnode{"multigrid::FixedCoarsening"}}};
}

template <typename ParamType>
Expand Down Expand Up @@ -109,7 +112,7 @@ class MultigridLevel : public ::testing::Test {
using Config = T;

MultigridLevel()
: exec(gko::ReferenceExecutor::create()), td("double", "int"), reg()
: exec(gko::ReferenceExecutor::create()), td("float64", "int32"), reg()
{}

std::shared_ptr<const gko::Executor> exec;
Expand Down Expand Up @@ -173,7 +176,7 @@ using DummyStop = gko::stop::Iteration;
struct MultigridConfig {
static pnode::map_type setup_base()
{
return {{"Type", pnode{"Multigrid"}}};
return {{"type", pnode{"solver::Multigrid"}}};
}

template <bool from_reg, typename ParamType>
Expand Down Expand Up @@ -231,24 +234,24 @@ struct MultigridConfig {
reg, "coarsest_solver"));
} else {
config_map["criteria"] =
pnode{pnode::map_type{{"Type", pnode{"Iteration"}}}};
pnode{pnode::map_type{{"type", pnode{"stop::Iteration"}}}};
param.with_criteria(DummyStop::build().on(exec));
config_map["mg_level"] = pnode{std::vector<pnode>{
pnode{pnode::map_type{{"Type", pnode{"Pgm"}}}},
pnode{pnode::map_type{{"Type", pnode{"Pgm"}}}}}};
pnode{pnode::map_type{{"type", pnode{"multigrid::Pgm"}}}},
pnode{pnode::map_type{{"type", pnode{"multigrid::Pgm"}}}}}};
param.with_mg_level(DummyMgLevel::build().on(exec),
DummyMgLevel::build().on(exec));
config_map["pre_smoother"] =
pnode{pnode::map_type{{"Type", pnode{"Ir"}}}};
pnode{pnode::map_type{{"type", pnode{"solver::Ir"}}}};
param.with_pre_smoother(DummySmoother::build().on(exec));
config_map["post_smoother"] =
pnode{pnode::map_type{{"Type", pnode{"Ir"}}}};
pnode{pnode::map_type{{"type", pnode{"solver::Ir"}}}};
param.with_post_smoother(DummySmoother::build().on(exec));
config_map["mid_smoother"] =
pnode{pnode::map_type{{"Type", pnode{"Ir"}}}};
pnode{pnode::map_type{{"type", pnode{"solver::Ir"}}}};
param.with_mid_smoother(DummySmoother::build().on(exec));
config_map["coarsest_solver"] =
pnode{pnode::map_type{{"Type", pnode{"Ir"}}}};
pnode{pnode::map_type{{"type", pnode{"solver::Ir"}}}};
param.with_coarsest_solver(DummySmoother::build().on(exec));
}
config_map["level_selector"] = pnode{"first_for_top"};
Expand Down Expand Up @@ -341,7 +344,7 @@ class MultigridT : public ::testing::Test {

MultigridT()
: exec(gko::ReferenceExecutor::create()),
td("double", "int"),
td("float64", "int32"),
mg_level_0(DummyMgLevel::build().on(exec)),
mg_level_1(DummyMgLevel::build().on(exec)),
criterion_factory(DummyStop::build().on(exec)),
Expand Down

0 comments on commit 3a34e38

Please sign in to comment.