5 #ifndef GKO_PUBLIC_CORE_BASE_DENSE_CACHE_HPP_
6 #define GKO_PUBLIC_CORE_BASE_DENSE_CACHE_HPP_
12 #include <ginkgo/core/base/executor.hpp>
19 template <
typename ValueType>
38 template <
typename ValueType>
40 DenseCache() =
default;
41 ~DenseCache() =
default;
42 DenseCache(
const DenseCache&) {}
43 DenseCache(DenseCache&&) noexcept {}
44 DenseCache& operator=(
const DenseCache&) {
return *
this; }
45 DenseCache& operator=(DenseCache&&) noexcept {
return *
this; }
46 mutable std::unique_ptr<matrix::Dense<ValueType>> vec{};
61 void init_from(
const matrix::Dense<ValueType>* template_vec)
const;
72 void init(std::shared_ptr<const Executor> exec, dim<2> size)
const;
78 matrix::Dense<ValueType>& operator*()
const {
return *vec; }
84 matrix::Dense<ValueType>* operator->()
const {
return vec.get(); }
90 matrix::Dense<ValueType>* get()
const {
return vec.get(); }
98 #endif // GKO_PUBLIC_CORE_BASE_DENSE_CACHE_HPP_