11#include <ginkgo/ginkgo.hpp>
12#include <ginkgo/extensions/kokkos.hpp>
13#include <ginkgo/extensions/config/json_config.hpp>
23namespace NeoN::la::ginkgo
26std::shared_ptr<gko::Executor> getGkoExecutor(Executor exec);
28gko::config::pnode parse(
const Dictionary& dict);
30class GinkgoSolver :
public SolverFactory::template
Register<GinkgoSolver>
37 GinkgoSolver(Executor exec,
const Dictionary& solverConfig)
38 : Base(exec), gkoExec_(getGkoExecutor(exec)), config_(parse(solverConfig)),
39 factory_(gko::config::parse(
40 config_, gko::config::registry(), gko::config::make_type_descriptor<
scalar>()
45 static std::string
name() {
return "Ginkgo"; }
47 static std::string doc() {
return "TBD"; }
49 static std::string schema() {
return "none"; }
52 solve(
const LinearSystem<scalar, localIdx>& sys, Vector<scalar>& x)
const final;
54 virtual SolverStats
solve(
const LinearSystem<Vec3, localIdx>& sys, Vector<Vec3>& x)
const final;
57 virtual std::unique_ptr<SolverFactory> clone() const final
65 std::shared_ptr<const gko::Executor> gkoExec_;
66 gko::config::pnode config_;
67 std::shared_ptr<const gko::LinOpFactory> factory_;
A template class for registering derived classes with a base class.
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
la::SolverStats solve(Expression< typename VectorType::ElementType > &exp, VectorType &solution, scalar t, scalar dt, const Dictionary &fvSchemes, const Dictionary &fvSolution, std::vector< PostAssemblyBase< typename VectorType::ElementType > > p={})
const std::string & name(const NeoN::Document &doc)
Retrieves the name of a Document.