5 #ifndef GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_
6 #define GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_
10 #include <type_traits>
13 #include <ginkgo/config.hpp>
19 #include <ginkgo/core/base/polymorphic_object.hpp>
20 #include <ginkgo/core/distributed/base.hpp>
24 namespace experimental {
52 template <
typename ConcreteObject,
typename PolymorphicBase = PolymorphicObject>
59 std::unique_ptr<PolymorphicObject> create_default_impl(
60 std::shared_ptr<const Executor> exec)
const override
62 return std::unique_ptr<ConcreteObject>{
63 new ConcreteObject(exec,
self()->get_communicator())};
68 as<ConvertibleTo<ConcreteObject>>(other)->convert_to(
self());
73 std::unique_ptr<PolymorphicObject> other)
override
75 as<ConvertibleTo<ConcreteObject>>(other.get())->move_to(
self());
81 as<ConvertibleTo<ConcreteObject>>(other)->move_to(
self());
86 std::unique_ptr<PolymorphicObject> other)
override
88 as<ConvertibleTo<ConcreteObject>>(other.get())->move_to(
self());
95 ConcreteObject{
self()->get_executor(),
self()->get_communicator()};
100 GKO_ENABLE_SELF(ConcreteObject);
108 #endif // GINKGO_BUILD_MPI
109 #endif // GKO_PUBLIC_CORE_DISTRIBUTED_POLYMORPHIC_OBJECT_HPP_