5 #ifndef GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_
6 #define GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_
11 #include <ginkgo/core/base/abstract_factory.hpp>
12 #include <ginkgo/core/base/array.hpp>
13 #include <ginkgo/core/base/executor.hpp>
14 #include <ginkgo/core/base/lin_op.hpp>
15 #include <ginkgo/core/base/polymorphic_object.hpp>
16 #include <ginkgo/core/base/utils.hpp>
33 template <
typename IndexType =
int32>
37 using index_type = IndexType;
41 return permutation_array_;
47 permutation_array_{exec}
52 permutation_array_ = permutation_array;
66 std::shared_ptr<LinOp> system_matrix;
69 : system_matrix{system_matrix}
77 template <
typename IndexType =
int32>
97 template <
typename ConcreteFactory,
typename ConcreteReorderingBase,
98 typename ParametersType,
typename IndexType =
int32,
102 ParametersType, PolymorphicBase>;
123 #define GKO_ENABLE_REORDERING_BASE_FACTORY(_reordering_base, _parameters_name, \
126 const _parameters_name##_type& get_##_parameters_name() const \
128 return _parameters_name##_; \
131 class _factory_name \
132 : public ::gko::reorder::EnableDefaultReorderingBaseFactory< \
133 _factory_name, _reordering_base, _parameters_name##_type, \
135 friend class ::gko::EnablePolymorphicObject< \
136 _factory_name, ::gko::reorder::ReorderingBaseFactory<IndexType>>; \
137 friend class ::gko::enable_parameters_type<_parameters_name##_type, \
139 explicit _factory_name(std::shared_ptr<const ::gko::Executor> exec) \
140 : ::gko::reorder::EnableDefaultReorderingBaseFactory< \
141 _factory_name, _reordering_base, _parameters_name##_type, \
142 IndexType>(std::move(exec)) \
144 explicit _factory_name(std::shared_ptr<const ::gko::Executor> exec, \
145 const _parameters_name##_type& parameters) \
146 : ::gko::reorder::EnableDefaultReorderingBaseFactory< \
147 _factory_name, _reordering_base, _parameters_name##_type, \
148 IndexType>(std::move(exec), parameters) \
151 friend ::gko::reorder::EnableDefaultReorderingBaseFactory< \
152 _factory_name, _reordering_base, _parameters_name##_type, IndexType>; \
155 _parameters_name##_type _parameters_name##_; \
158 static_assert(true, \
159 "This assert is used to counter the false positive extra " \
160 "semi-colon warnings")
167 #endif // GKO_PUBLIC_CORE_REORDER_REORDERING_BASE_HPP_