From 62c17a69a48427a10746255f0b06f16131afd079 Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Thu, 24 Apr 2025 17:55:13 +0200 Subject: [PATCH 1/7] allow ValueType in LSolver and USolver --- cmake/generate_ginkgo_hpp.cmake | 1 + core/config/preconditioner_ilu_config.cpp | 118 +++------------ core/preconditioner/ilu.cpp | 121 +++++---------- core/test/config/preconditioner.cpp | 25 ++-- include/ginkgo/core/base/type_traits.hpp | 11 +- include/ginkgo/core/preconditioner/ilu.hpp | 146 +++++++++++-------- include/ginkgo/core/preconditioner/utils.hpp | 34 ++--- reference/test/preconditioner/ilu.cpp | 95 +++++++++++- 8 files changed, 267 insertions(+), 284 deletions(-) diff --git a/cmake/generate_ginkgo_hpp.cmake b/cmake/generate_ginkgo_hpp.cmake index 7121e0cb87d..2d749678779 100644 --- a/cmake/generate_ginkgo_hpp.cmake +++ b/cmake/generate_ginkgo_hpp.cmake @@ -13,6 +13,7 @@ function(ginkgo_generate_ginkgo_hpp) (file MATCHES "^ginkgo/extensions/.*$") OR (file MATCHES "^ginkgo/core/stop/residual_norm_reduction.hpp$") OR (file MATCHES "^ginkgo/core/solver/.*_trs.hpp$") + OR (file MATCHES "^ginkgo/core/preconditioner/utils.hpp$") ) continue() endif() diff --git a/core/config/preconditioner_ilu_config.cpp b/core/config/preconditioner_ilu_config.cpp index 3714d356e71..59ace85151f 100644 --- a/core/config/preconditioner_ilu_config.cpp +++ b/core/config/preconditioner_ilu_config.cpp @@ -1,16 +1,11 @@ -// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors +// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors // // SPDX-License-Identifier: BSD-3-Clause #include #include #include -#include #include -#include -#include -#include -#include #include "core/config/config_helper.hpp" #include "core/config/dispatch.hpp" @@ -22,19 +17,18 @@ namespace gko { namespace config { -// For Ic and Ilu, we use additional ValueType to help Solver type decision -template +template class IluSolverHelper { public: template class Configurator { public: - static typename preconditioner::Ilu::parameters_type parse(const pnode& config, const registry& context, const type_descriptor& td_for_child) { - return preconditioner::Ilu::parse(config, context, td_for_child); } @@ -42,103 +36,35 @@ class IluSolverHelper { }; -template