5 #ifndef GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_
6 #define GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_
12 #include <ginkgo/core/base/abstract_factory.hpp>
13 #include <ginkgo/core/base/array.hpp>
14 #include <ginkgo/core/base/executor.hpp>
15 #include <ginkgo/core/base/lin_op.hpp>
16 #include <ginkgo/core/base/polymorphic_object.hpp>
17 #include <ginkgo/core/base/utils.hpp>
34 template <
typename IndexType =
int32>
38 using index_type = IndexType;
42 return permutation_array_;
48 permutation_array_{exec}
53 permutation_array_ = permutation_array;
67 std::shared_ptr<LinOp> system_matrix;
70 : system_matrix{system_matrix}
78 template <
typename IndexType =
int32>
98 template <
typename ConcreteFactory,
typename ConcreteReorderingBase,
99 typename ParametersType,
typename IndexType =
int32,
103 ParametersType, PolymorphicBase>;
124 #define GKO_ENABLE_REORDERING_BASE_FACTORY(_reordering_base, _parameters_name, \
127 const _parameters_name##_type& get_##_parameters_name() const \
129 return _parameters_name##_; \
132 class _factory_name \
133 : public ::gko::reorder::EnableDefaultReorderingBaseFactory< \
134 _factory_name, _reordering_base, _parameters_name##_type, \
136 friend class ::gko::EnablePolymorphicObject< \
137 _factory_name, ::gko::reorder::ReorderingBaseFactory<IndexType>>; \
138 friend class ::gko::enable_parameters_type<_parameters_name##_type, \
140 explicit _factory_name(std::shared_ptr<const ::gko::Executor> exec) \
141 : ::gko::reorder::EnableDefaultReorderingBaseFactory< \
142 _factory_name, _reordering_base, _parameters_name##_type, \
143 IndexType>(std::move(exec)) \
145 explicit _factory_name(std::shared_ptr<const ::gko::Executor> exec, \
146 const _parameters_name##_type& parameters) \
147 : ::gko::reorder::EnableDefaultReorderingBaseFactory< \
148 _factory_name, _reordering_base, _parameters_name##_type, \
149 IndexType>(std::move(exec), parameters) \
152 friend ::gko::reorder::EnableDefaultReorderingBaseFactory< \
153 _factory_name, _reordering_base, _parameters_name##_type, IndexType>; \
156 _parameters_name##_type _parameters_name##_; \
159 static_assert(true, \
160 "This assert is used to counter the false positive extra " \
161 "semi-colon warnings")
168 #endif // GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_