\doxysection{vector\+\_\+cache.\+hpp}
\hypertarget{vector__cache_8hpp_source}{}\label{vector__cache_8hpp_source}\index{ginkgo/core/distributed/vector\_cache.hpp@{ginkgo/core/distributed/vector\_cache.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2025\ The\ Ginkgo\ authors}}
\DoxyCodeLine{00002\ \textcolor{comment}{//}}
\DoxyCodeLine{00003\ \textcolor{comment}{//\ SPDX-\/License-\/Identifier:\ BSD-\/3-\/Clause}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#ifndef\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_VECTOR\_CACHE\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_VECTOR\_CACHE\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/config.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/mpi.hpp>}}
\DoxyCodeLine{00014\ \textcolor{preprocessor}{\#include\ <ginkgo/core/distributed/vector.hpp>}}
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \textcolor{preprocessor}{\#if\ GINKGO\_BUILD\_MPI}}
\DoxyCodeLine{00018\ }
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00021\ \textcolor{keyword}{namespace\ }experimental\ \{}
\DoxyCodeLine{00022\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1experimental_1_1distributed}{distributed}}\ \{}
\DoxyCodeLine{00023\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00035\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00036\ \textcolor{keyword}{class\ }VectorCache\ \{}
\DoxyCodeLine{00037\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00038\ \ \ \ \ VectorCache()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00039\ \ \ \ \ \string~VectorCache()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00040\ \ \ \ \ VectorCache(\textcolor{keyword}{const}\ VectorCache\&)\ \{\}}
\DoxyCodeLine{00041\ \ \ \ \ VectorCache(VectorCache\&\&)\ noexcept\ \{\}}
\DoxyCodeLine{00042\ \ \ \ \ VectorCache\&\ operator=(\textcolor{keyword}{const}\ VectorCache\&)\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00043\ \ \ \ \ VectorCache\&\ operator=(VectorCache\&\&)\ noexcept\ \{\ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};\ \}}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keyword}{mutable}\ std::unique\_ptr<Vector<ValueType>>\ vec\{\};}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{void}\ init\_from(\textcolor{keyword}{const}\ Vector<ValueType>*\ template\_vec)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keywordtype}{void}\ init(std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::experimental::mpi::communicator\ comm,\ dim<2>\ global\_size,}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ dim<2>\ local\_size)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00084\ \ \ \ \ Vector<ValueType>\&\ operator*()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ *vec;\ \}}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00090\ \ \ \ \ Vector<ValueType>*\ operator-\/>()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ vec.get();\ \}}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00096\ \ \ \ \ Vector<ValueType>*\ get()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ vec.get();\ \}}
\DoxyCodeLine{00097\ \};}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ }
\DoxyCodeLine{00100\ \textcolor{comment}{//\ helper\ to\ access\ private\ member\ for\ testing}}
\DoxyCodeLine{00101\ \textcolor{keyword}{class\ }GenericVectorCacheAccessor;}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00114\ \textcolor{keyword}{class\ }GenericVectorCache\ \{}
\DoxyCodeLine{00115\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00116\ \ \ \ \ \textcolor{keyword}{friend}\ \textcolor{keyword}{class\ }GenericVectorCacheAccessor;}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00118\ \ \ \ \ GenericVectorCache()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00119\ \ \ \ \ \string~GenericVectorCache()\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{00120\ \ \ \ \ GenericVectorCache(\textcolor{keyword}{const}\ GenericVectorCache\&);}
\DoxyCodeLine{00121\ \ \ \ \ GenericVectorCache(GenericVectorCache\&\&)\ noexcept;}
\DoxyCodeLine{00122\ \ \ \ \ GenericVectorCache\&\ operator=(const\ GenericVectorCache\&);}
\DoxyCodeLine{00123\ \ \ \ \ GenericVectorCache\&\ operator=(GenericVectorCache\&\&)\ noexcept;}
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00140\ \ \ \ \ template\ <typename\ ValueType>}
\DoxyCodeLine{00141\ \ \ \ \ std::shared\_ptr<Vector<ValueType>>\ get(}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ std::shared\_ptr<const\ Executor>\ exec,}
\DoxyCodeLine{00143\ \ \ \ \ \ \ \ \ gko::experimental::mpi::communicator\ comm,\ dim<2>\ global\_size,}
\DoxyCodeLine{00144\ \ \ \ \ \ \ \ \ dim<2>\ local\_size)\ const;}
\DoxyCodeLine{00145\ }
\DoxyCodeLine{00146\ private:}
\DoxyCodeLine{00147\ \ \ \ \ mutable\ \doxymbox{\hyperlink{namespacegko_ae749a5ea11a93c1bcc9158d9a6e9fb68af1f713c9e000f5d3f280adbd124df4f5}{array}}<\textcolor{keywordtype}{char}>\ workspace;}
\DoxyCodeLine{00148\ \};}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00151\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00152\ \}\ \ \textcolor{comment}{//\ namespace\ distributed}}
\DoxyCodeLine{00153\ \}\ \ \textcolor{comment}{//\ namespace\ experimental}}
\DoxyCodeLine{00154\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00157\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GINKGO\_BUILD\_MPI}}
\DoxyCodeLine{00158\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_DISTRIBUTED\_VECTOR\_CACHE\_HPP\_}}

\end{DoxyCode}
