From 797e80d7a775d3930f43a927a894447274dac94c Mon Sep 17 00:00:00 2001 From: "Yu-Hsiang M. Tsai" Date: Tue, 28 Nov 2023 01:04:12 +0100 Subject: [PATCH] use deferred factory and update format --- core/config/solver_config.cpp | 385 +++------------------- core/config/solver_config.hpp | 48 +-- core/solver/bicg.cpp | 12 + core/solver/bicgstab.cpp | 13 + core/solver/cb_gmres.cpp | 35 ++ core/solver/cg.cpp | 31 +- core/solver/cgs.cpp | 12 + core/solver/direct.cpp | 17 + core/solver/fcg.cpp | 12 + core/solver/gcr.cpp | 13 + core/solver/gmres.cpp | 14 + core/solver/idr.cpp | 16 + core/solver/ir.cpp | 20 ++ core/solver/lower_trs.cpp | 26 ++ core/solver/upper_trs.cpp | 26 ++ core/test/config/solver.cpp | 179 +++++----- include/ginkgo/core/solver/bicg.hpp | 6 + include/ginkgo/core/solver/bicgstab.hpp | 6 + include/ginkgo/core/solver/cb_gmres.hpp | 6 + include/ginkgo/core/solver/cgs.hpp | 6 + include/ginkgo/core/solver/direct.hpp | 6 + include/ginkgo/core/solver/fcg.hpp | 6 + include/ginkgo/core/solver/gcr.hpp | 6 + include/ginkgo/core/solver/gmres.hpp | 6 + include/ginkgo/core/solver/idr.hpp | 6 + include/ginkgo/core/solver/ir.hpp | 6 + include/ginkgo/core/solver/triangular.hpp | 10 + 27 files changed, 433 insertions(+), 496 deletions(-) diff --git a/core/config/solver_config.cpp b/core/config/solver_config.cpp index b0a451ebb4a..86c7efc0933 100644 --- a/core/config/solver_config.cpp +++ b/core/config/solver_config.cpp @@ -1,34 +1,6 @@ -/************************************************************* -Copyright (c) 2017-2023, the Ginkgo authors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*************************************************************/ +// SPDX-FileCopyrightText: 2017-2023 The Ginkgo authors +// +// SPDX-License-Identifier: BSD-3-Clause #include #include @@ -55,338 +27,65 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace gko { namespace config { - -// It can also be directly in solver (or in proteced part) if we also allow -// the executor as input there. -template