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>
21namespace experimental {
35template <
typename ValueType>
38 VectorCache() =
default;
39 ~VectorCache() =
default;
40 VectorCache(
const VectorCache&) {}
41 VectorCache(VectorCache&&) noexcept {}
42 VectorCache& operator=(
const VectorCache&) {
return *
this; }
43 VectorCache& operator=(VectorCache&&) noexcept {
return *
this; }
44 mutable std::unique_ptr<Vector<ValueType>> vec{};
61 void init_from(
const Vector<ValueType>* template_vec)
const;
75 void init(std::shared_ptr<const Executor> exec,
76 gko::experimental::mpi::communicator comm, dim<2> global_size,
77 dim<2> local_size)
const;
84 Vector<ValueType>& operator*()
const {
return *vec; }
90 Vector<ValueType>* operator->()
const {
return vec.get(); }
96 Vector<ValueType>* get()
const {
return vec.get(); }
101class GenericVectorCacheAccessor;
114class GenericVectorCache {
116 friend class GenericVectorCacheAccessor;
118 GenericVectorCache() =
default;
119 ~GenericVectorCache() =
default;
120 GenericVectorCache(
const GenericVectorCache&);
121 GenericVectorCache(GenericVectorCache&&) noexcept;
122 GenericVectorCache& operator=(const GenericVectorCache&);
123 GenericVectorCache& operator=(GenericVectorCache&&) noexcept;
140 template <typename ValueType>
141 std::shared_ptr<Vector<ValueType>> get(
142 std::shared_ptr<const Executor> exec,
143 gko::experimental::mpi::communicator comm, dim<2> global_size,
144 dim<2> local_size) const;
147 mutable
array<
char> workspace;
The distributed namespace.
Definition polymorphic_object.hpp:19
The Ginkgo namespace.
Definition abstract_factory.hpp:20
@ array
The matrix should be written as dense matrix in column-major order.
Definition mtx_io.hpp:96