From cee0d212387cede411311ad64089b407dae3c5b9 Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Mon, 2 Dec 2024 12:35:13 +0100 Subject: [PATCH] rename type list --- core/config/dispatch.hpp | 6 +++--- core/config/parse_macro.hpp | 21 +++++++++++---------- core/config/preconditioner_ic_config.cpp | 12 ++++-------- core/config/preconditioner_ilu_config.cpp | 8 ++++---- core/config/preconditioner_isai_config.cpp | 8 ++++---- core/config/schwarz_config.cpp | 6 ++++-- core/config/stop_config.cpp | 6 ++---- 7 files changed, 32 insertions(+), 35 deletions(-) diff --git a/core/config/dispatch.hpp b/core/config/dispatch.hpp index 1c6d0eb12cd..6a604096322 100644 --- a/core/config/dispatch.hpp +++ b/core/config/dispatch.hpp @@ -102,15 +102,15 @@ deferred_factory_parameter dispatch( } } -using value_type_list = +using value_type_list_base = syn::type_list, std::complex>; #if GINKGO_ENABLE_HALF -using value_type_list_with_half = +using value_type_list = syn::type_list, std::complex, std::complex>; #else -using value_type_list_with_half = value_type_list; +using value_type_list = value_type_list_base; #endif // GINKGO_ENABLE_HALF using index_type_list = syn::type_list; diff --git a/core/config/parse_macro.hpp b/core/config/parse_macro.hpp index f40aa8cb9dd..273bc8b1a9f 100644 --- a/core/config/parse_macro.hpp +++ b/core/config/parse_macro.hpp @@ -16,7 +16,8 @@ // for value_type only -#define GKO_PARSE_VALUE_TYPE_BASE_(_type, _configurator, _value_type_list) \ +#define GKO_PARSE_VALUE_TYPE_BASE_(_type, _configurator, \ + _value_type_list_base) \ template <> \ deferred_factory_parameter \ parse( \ @@ -28,22 +29,22 @@ return gko::config::dispatch( \ config, context, updated, \ gko::config::make_type_selector(updated.get_value_typestr(), \ - _value_type_list)); \ + _value_type_list_base)); \ } \ static_assert(true, \ "This assert is used to counter the false positive extra " \ "semi-colon warnings") #define GKO_PARSE_VALUE_TYPE_BASE(_type, _configurator) \ GKO_PARSE_VALUE_TYPE_BASE_(_type, _configurator, \ - gko::config::value_type_list()) + gko::config::value_type_list_base()) #define GKO_PARSE_VALUE_TYPE(_type, _configurator) \ GKO_PARSE_VALUE_TYPE_BASE_(_type, _configurator, \ - gko::config::value_type_list_with_half()) + gko::config::value_type_list()) // for value_type and index_type #define GKO_PARSE_VALUE_AND_INDEX_TYPE_BASE_(_type, _configurator, \ - _value_type_list) \ + _value_type_list_base) \ template <> \ deferred_factory_parameter \ parse( \ @@ -55,7 +56,7 @@ return gko::config::dispatch( \ config, context, updated, \ gko::config::make_type_selector(updated.get_value_typestr(), \ - _value_type_list), \ + _value_type_list_base), \ gko::config::make_type_selector(updated.get_index_typestr(), \ gko::config::index_type_list())); \ } \ @@ -65,11 +66,11 @@ #define GKO_PARSE_VALUE_AND_INDEX_TYPE_BASE(_type, _configurator) \ GKO_PARSE_VALUE_AND_INDEX_TYPE_BASE_(_type, _configurator, \ - gko::config::value_type_list()) + gko::config::value_type_list_base()) -#define GKO_PARSE_VALUE_AND_INDEX_TYPE(_type, _configurator) \ - GKO_PARSE_VALUE_AND_INDEX_TYPE_BASE_( \ - _type, _configurator, gko::config::value_type_list_with_half()) +#define GKO_PARSE_VALUE_AND_INDEX_TYPE(_type, _configurator) \ + GKO_PARSE_VALUE_AND_INDEX_TYPE_BASE_(_type, _configurator, \ + gko::config::value_type_list()) #endif // GKO_CORE_CONFIG_PARSE_MACRO_HPP_ diff --git a/core/config/preconditioner_ic_config.cpp b/core/config/preconditioner_ic_config.cpp index e029b228479..7d4cd3d9ca4 100644 --- a/core/config/preconditioner_ic_config.cpp +++ b/core/config/preconditioner_ic_config.cpp @@ -78,28 +78,24 @@ deferred_factory_parameter parse( return dispatch::Configurator>( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + make_type_selector(updated.get_value_typestr(), value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "solver::Ir") { return dispatch::Configurator>( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + make_type_selector(updated.get_value_typestr(), value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "preconditioner::LowerIsai") { return dispatch::Configurator>( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + make_type_selector(updated.get_value_typestr(), value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "solver::Gmres") { return dispatch::Configurator>( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + make_type_selector(updated.get_value_typestr(), value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else { GKO_INVALID_CONFIG_VALUE("l_solver_type", str); diff --git a/core/config/preconditioner_ilu_config.cpp b/core/config/preconditioner_ilu_config.cpp index 9ed8494ab10..3714d356e71 100644 --- a/core/config/preconditioner_ilu_config.cpp +++ b/core/config/preconditioner_ilu_config.cpp @@ -94,7 +94,7 @@ deferred_factory_parameter parse( ReverseApply::value>::template Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "solver::Ir") { @@ -104,7 +104,7 @@ deferred_factory_parameter parse( ReverseApply::value>::template Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "preconditioner::LowerIsai") { @@ -114,7 +114,7 @@ deferred_factory_parameter parse( ReverseApply::value>::template Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "solver::Gmres") { @@ -124,7 +124,7 @@ deferred_factory_parameter parse( ReverseApply::value>::template Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else { diff --git a/core/config/preconditioner_isai_config.cpp b/core/config/preconditioner_isai_config.cpp index 828721ed74e..8d1b849eea4 100644 --- a/core/config/preconditioner_isai_config.cpp +++ b/core/config/preconditioner_isai_config.cpp @@ -48,7 +48,7 @@ deferred_factory_parameter parse( IsaiHelper::Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "upper") { @@ -57,7 +57,7 @@ deferred_factory_parameter parse( IsaiHelper::Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "general") { @@ -66,7 +66,7 @@ deferred_factory_parameter parse( IsaiHelper::Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else if (str == "spd") { @@ -75,7 +75,7 @@ deferred_factory_parameter parse( IsaiHelper::Configurator>( config, context, updated, make_type_selector(updated.get_value_typestr(), - value_type_list_with_half()), + value_type_list()), make_type_selector(updated.get_index_typestr(), index_type_list())); } else { diff --git a/core/config/schwarz_config.cpp b/core/config/schwarz_config.cpp index 9543b833041..3244d6064e5 100644 --- a/core/config/schwarz_config.cpp +++ b/core/config/schwarz_config.cpp @@ -29,7 +29,8 @@ deferred_factory_parameter parse( gko::LinOpFactory, gko::experimental::distributed::preconditioner::Schwarz>( config, context, updated, - make_type_selector(updated.get_value_typestr(), value_type_list()), + make_type_selector(updated.get_value_typestr(), + value_type_list_base()), make_type_selector(updated.get_index_typestr(), syn::type_list()), make_type_selector(updated.get_global_index_typestr(), @@ -39,7 +40,8 @@ deferred_factory_parameter parse( gko::LinOpFactory, gko::experimental::distributed::preconditioner::Schwarz>( config, context, updated, - make_type_selector(updated.get_value_typestr(), value_type_list()), + make_type_selector(updated.get_value_typestr(), + value_type_list_base()), make_type_selector(updated.get_index_typestr(), syn::type_list()), make_type_selector(updated.get_global_index_typestr(), diff --git a/core/config/stop_config.cpp b/core/config/stop_config.cpp index 2696b471a21..4623eb768fc 100644 --- a/core/config/stop_config.cpp +++ b/core/config/stop_config.cpp @@ -87,8 +87,7 @@ deferred_factory_parameter configure_residual( auto updated = update_type(config, td); return dispatch( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half())); + make_type_selector(updated.get_value_typestr(), value_type_list())); } @@ -120,8 +119,7 @@ deferred_factory_parameter configure_implicit_residual( auto updated = update_type(config, td); return dispatch( config, context, updated, - make_type_selector(updated.get_value_typestr(), - value_type_list_with_half())); + make_type_selector(updated.get_value_typestr(), value_type_list())); }