5 #ifndef GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_
6 #define GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_
10 #include <type_traits>
12 #include <ginkgo/config.hpp>
18 #include <ginkgo/core/base/polymorphic_object.hpp>
19 #include <ginkgo/core/distributed/base.hpp>
23 namespace experimental {
51 template <
typename ConcreteObject,
typename PolymorphicBase = PolymorphicObject>
58 std::unique_ptr<PolymorphicObject> create_default_impl(
59 std::shared_ptr<const Executor> exec)
const override
61 return std::unique_ptr<ConcreteObject>{
62 new ConcreteObject(exec,
self()->get_communicator())};
67 as<ConvertibleTo<ConcreteObject>>(other)->convert_to(
self());
72 std::unique_ptr<PolymorphicObject> other)
override
74 as<ConvertibleTo<ConcreteObject>>(other.get())->move_to(
self());
80 as<ConvertibleTo<ConcreteObject>>(other)->move_to(
self());
85 std::unique_ptr<PolymorphicObject> other)
override
87 as<ConvertibleTo<ConcreteObject>>(other.get())->move_to(
self());
94 ConcreteObject{
self()->get_executor(),
self()->get_communicator()};
99 GKO_ENABLE_SELF(ConcreteObject);
107 #endif // GINKGO_BUILD_MPI
108 #endif // GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_