5 #ifndef GKO_PUBLIC_CORE_DISTRIBUTED_VECTOR_CACHE_HPP_
6 #define GKO_PUBLIC_CORE_DISTRIBUTED_VECTOR_CACHE_HPP_
11 #include <ginkgo/config.hpp>
12 #include <ginkgo/core/base/executor.hpp>
13 #include <ginkgo/core/base/mpi.hpp>
14 #include <ginkgo/core/distributed/vector.hpp>
21 namespace experimental {
22 namespace distributed {
35 template <
typename ValueType>
37 VectorCache() =
default;
38 ~VectorCache() =
default;
39 VectorCache(
const VectorCache&) {}
40 VectorCache(VectorCache&&) noexcept {}
41 VectorCache& operator=(
const VectorCache&) {
return *
this; }
42 VectorCache& operator=(VectorCache&&) noexcept {
return *
this; }
43 mutable std::unique_ptr<Vector<ValueType>> vec{};
60 void init_from(
const Vector<ValueType>* template_vec)
const;
74 void init(std::shared_ptr<const Executor> exec,
76 dim<2> local_size)
const;
83 Vector<ValueType>& operator*()
const {
return *vec; }
89 Vector<ValueType>* operator->()
const {
return vec.get(); }
95 Vector<ValueType>* get()
const {
return vec.get(); }
105 #endif // GINKGO_BUILD_MPI
106 #endif // GKO_PUBLIC_CORE_DISTRIBUTED_VECTOR_CACHE_HPP_