\hypertarget{classnntrainer_1_1CachePool}{}\doxysection{nntrainer\+::Cache\+Pool Class Reference}
\label{classnntrainer_1_1CachePool}\index{nntrainer::CachePool@{nntrainer::CachePool}}


Cache memory with fixed size utilizing swap device.  




{\ttfamily \#include $<$cache\+\_\+pool.\+h$>$}



Inheritance diagram for nntrainer\+::Cache\+Pool\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=208pt]{classnntrainer_1_1CachePool__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for nntrainer\+::Cache\+Pool\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=208pt]{classnntrainer_1_1CachePool__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
using \mbox{\hyperlink{classnntrainer_1_1CachePool_a21be505889e279e09ef6276cd5933a0d}{Cache\+Elems}} = std\+::map$<$ unsigned int, std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{classnntrainer_1_1CacheElem}{Cache\+Elem}} $>$ $>$
\item 
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a64c8c5c985d010aa6b3f04776d941ac1}\label{classnntrainer_1_1CachePool_a64c8c5c985d010aa6b3f04776d941ac1}} 
using {\bfseries Cache\+Elems\+Iter} = Cache\+Elems\+::iterator
\item 
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a3c6dae08deabbf92c91868a3091b257a}\label{classnntrainer_1_1CachePool_a3c6dae08deabbf92c91868a3091b257a}} 
using {\bfseries Exec\+Ids} = std\+::vector$<$ unsigned int $>$
\item 
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a740bf6a4b9254e6dcb17554fda25e439}\label{classnntrainer_1_1CachePool_a740bf6a4b9254e6dcb17554fda25e439}} 
using {\bfseries Exec\+Ids\+Iter} = Exec\+Ids\+::iterator
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1CachePool_a65f45b72f2f7ea7b061193bc8d0510f8}{Cache\+Pool}} (const std\+::string \&name)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} default constructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1CachePool_a10ebb76b625500c5de832ac6aa4b1ade}{Cache\+Pool}} (const std\+::string \&path, const std\+::string \&name)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} constructor with cache path. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{classnntrainer_1_1CachePool_aacfd2701d3337dd174106794a7526257}{$\sim$\+Cache\+Pool}} ()
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1MemoryPool}{Memory\+Pool}} destructor. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_ae61d8105bd4b11faa90d70af70938e9f}{allocate}} ()
\begin{DoxyCompactList}\small\item\em Do the allocation of cache. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a8bd8a7c31e17ce54e7e0c7052eda1e13}{deallocate}} ()
\begin{DoxyCompactList}\small\item\em Free all the allocated cache. \end{DoxyCompactList}\item 
virtual unsigned int \mbox{\hyperlink{classnntrainer_1_1CachePool_a6550cd7f9c4b50070c767e6c9274f850}{request\+Memory}} (size\+\_\+t bytes, unsigned int start\+\_\+time, unsigned int end\+\_\+time, std\+::vector$<$ unsigned int $>$ exec\+\_\+order=std\+::vector$<$ unsigned int $>$(), \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}} lifespan=\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622daa9e0b1de0ff7353f28b66401c4d303bc}{Tensor\+Lifespan\+::\+M\+A\+X\+\_\+\+L\+I\+F\+E\+S\+P\+AN}})
\begin{DoxyCompactList}\small\item\em Request Memory from memory pool. \end{DoxyCompactList}\item 
virtual std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{classnntrainer_1_1MemoryData}{Memory\+Data}}$<$ float $>$ $>$ \mbox{\hyperlink{classnntrainer_1_1CachePool_aa41c9c406113ffca67aa242dd3ae5135}{get\+Memory}} (unsigned int id)
\begin{DoxyCompactList}\small\item\em Get the allocated cache. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classnntrainer_1_1CachePool_a24fc60236178323100b2d49011594281}{is\+Allocated}} () const
\begin{DoxyCompactList}\small\item\em Is the cache pool allocated. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a16a987996acec45b4f84e369d3647868}{flush}} ()
\begin{DoxyCompactList}\small\item\em Flush cache data to device. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a3ce5b8e520c00801c5b58b7bc90d985d}{flush\+Except}} (unsigned int order)
\begin{DoxyCompactList}\small\item\em Flush cache data to device except given order. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_aa0af8224f75188addeb7067fbf9faaa1}{flush\+Except}} (std\+::vector$<$ unsigned int $>$ order)
\begin{DoxyCompactList}\small\item\em Flush cache data to device except given order. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a231a548288691114fb2dde11dc0cb4f2}{clear}} ()
\begin{DoxyCompactList}\small\item\em Clear the memory pool. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a6685c3d3ed45e361c80c0280d98c27e6}{load\+Exec}} (unsigned int order)
\begin{DoxyCompactList}\small\item\em Load cache data by execution order. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_aa481c1c733646606b5de6560e91f0a44}{init\+Cache\+Elem\+Iter}} (Cache\+Elems\+Iter \&iter)
\begin{DoxyCompactList}\small\item\em Load cache data by execution order. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classnntrainer_1_1CachePool_aec8812fe495ab737c4688fdc51c1f96f}{is\+Last\+Cache\+Elem\+Iter}} (const Cache\+Elems\+Iter \&iter)
\begin{DoxyCompactList}\small\item\em Check iterator is last element. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_ab62044e86274cad2a516c053d9878b80}{init\+Exec\+Ids\+Iter}} (unsigned int order, Exec\+Ids\+Iter \&iter)
\begin{DoxyCompactList}\small\item\em Load cache data by execution order. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classnntrainer_1_1CachePool_a8949dae0e7aabbe9cc3bc992fdce569f}{is\+Last\+Exec\+Ids\+Iter}} (unsigned int order, const Exec\+Ids\+Iter \&iter)
\begin{DoxyCompactList}\small\item\em Check iterator is last element. \end{DoxyCompactList}\item 
virtual bool \mbox{\hyperlink{classnntrainer_1_1CachePool_a0cf16f01c512d7bb820e63bea4f671ec}{load\+Exec\+Once}} (unsigned int order, Exec\+Ids\+Iter \&iter)
\begin{DoxyCompactList}\small\item\em Load cache data by execution order. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a79494d2cda9d835b21b239b60fa8689e}{unload\+Exec}} (unsigned int order)
\begin{DoxyCompactList}\small\item\em Unload cache data by execution order. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1CachePool_ac347172ddc70e64cd46eb21581d7962b}\label{classnntrainer_1_1CachePool_ac347172ddc70e64cd46eb21581d7962b}} 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_ac347172ddc70e64cd46eb21581d7962b}{load\+Actives}} ()
\begin{DoxyCompactList}\small\item\em Load active cache data. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1CachePool_abb362e21f4e602694d551e46dc178677}\label{classnntrainer_1_1CachePool_abb362e21f4e602694d551e46dc178677}} 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_abb362e21f4e602694d551e46dc178677}{unload\+Actives}} ()
\begin{DoxyCompactList}\small\item\em Unload active cache data. \end{DoxyCompactList}\item 
virtual std\+::string \mbox{\hyperlink{classnntrainer_1_1CachePool_a53cc95423f7eb54361f4b4f343a7619d}{get\+Name}} ()
\begin{DoxyCompactList}\small\item\em Get name. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a4abf98128f9e27c7ac65692d17cd75be}{validate}} (unsigned int id)
\begin{DoxyCompactList}\small\item\em validate cache element \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CachePool_a36dda6d8c99264afffdd179a8697dac0}{invalidate}} (unsigned int id)
\begin{DoxyCompactList}\small\item\em invalidate cache element \end{DoxyCompactList}\item 
std\+::vector$<$ \mbox{\hyperlink{namespacenntrainer_aa82a5a0874fed058056879c555555d78}{Cache\+Policy}} $>$ \& \mbox{\hyperlink{classnntrainer_1_1CachePool_a20f44712e89a03f846bc11cebf966591}{get\+Cache\+Policy}} ()
\begin{DoxyCompactList}\small\item\em Get cache policies. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Cache memory with fixed size utilizing swap device. 

Definition at line 31 of file cache\+\_\+pool.\+h.



\doxysubsection{Member Typedef Documentation}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a21be505889e279e09ef6276cd5933a0d}\label{classnntrainer_1_1CachePool_a21be505889e279e09ef6276cd5933a0d}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!CacheElems@{CacheElems}}
\index{CacheElems@{CacheElems}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{CacheElems}{CacheElems}}
{\footnotesize\ttfamily using \mbox{\hyperlink{classnntrainer_1_1CachePool_a21be505889e279e09ef6276cd5933a0d}{nntrainer\+::\+Cache\+Pool\+::\+Cache\+Elems}} =  std\+::map$<$unsigned int, std\+::shared\+\_\+ptr$<$\mbox{\hyperlink{classnntrainer_1_1CacheElem}{Cache\+Elem}}$>$ $>$}

cache id, cache elem 

Definition at line 35 of file cache\+\_\+pool.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a65f45b72f2f7ea7b061193bc8d0510f8}\label{classnntrainer_1_1CachePool_a65f45b72f2f7ea7b061193bc8d0510f8}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!CachePool@{CachePool}}
\index{CachePool@{CachePool}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{CachePool()}{CachePool()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily nntrainer\+::\+Cache\+Pool\+::\+Cache\+Pool (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



\mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} default constructor. 


\begin{DoxyParams}{Parameters}
{\em name} & name of the cache pool \\
\hline
\end{DoxyParams}


Definition at line 94 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a10ebb76b625500c5de832ac6aa4b1ade}\label{classnntrainer_1_1CachePool_a10ebb76b625500c5de832ac6aa4b1ade}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!CachePool@{CachePool}}
\index{CachePool@{CachePool}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{CachePool()}{CachePool()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily nntrainer\+::\+Cache\+Pool\+::\+Cache\+Pool (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{path,  }\item[{const std\+::string \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



\mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} constructor with cache path. 



Definition at line 99 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_aacfd2701d3337dd174106794a7526257}\label{classnntrainer_1_1CachePool_aacfd2701d3337dd174106794a7526257}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!````~CachePool@{$\sim$CachePool}}
\index{````~CachePool@{$\sim$CachePool}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{$\sim$CachePool()}{~CachePool()}}
{\footnotesize\ttfamily nntrainer\+::\+Cache\+Pool\+::$\sim$\+Cache\+Pool (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



\mbox{\hyperlink{classnntrainer_1_1MemoryPool}{Memory\+Pool}} destructor. 



Definition at line 109 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_aacfd2701d3337dd174106794a7526257_cgraph}
\end{center}
\end{figure}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_ae61d8105bd4b11faa90d70af70938e9f}\label{classnntrainer_1_1CachePool_ae61d8105bd4b11faa90d70af70938e9f}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!allocate@{allocate}}
\index{allocate@{allocate}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{allocate()}{allocate()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::allocate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Do the allocation of cache. 



Reimplemented from \mbox{\hyperlink{classnntrainer_1_1MemoryPool_aed676f545b43586c8677eba8bca1db5d}{nntrainer\+::\+Memory\+Pool}}.



Definition at line 117 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a231a548288691114fb2dde11dc0cb4f2}\label{classnntrainer_1_1CachePool_a231a548288691114fb2dde11dc0cb4f2}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!clear@{clear}}
\index{clear@{clear}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{clear()}{clear()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::clear (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Clear the memory pool. 



Reimplemented from \mbox{\hyperlink{classnntrainer_1_1MemoryPool_acc48284c1b407129f2b90d4b8f4bafab}{nntrainer\+::\+Memory\+Pool}}.



Definition at line 257 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a231a548288691114fb2dde11dc0cb4f2_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a8bd8a7c31e17ce54e7e0c7052eda1e13}\label{classnntrainer_1_1CachePool_a8bd8a7c31e17ce54e7e0c7052eda1e13}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!deallocate@{deallocate}}
\index{deallocate@{deallocate}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{deallocate()}{deallocate()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::deallocate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Free all the allocated cache. 



Reimplemented from \mbox{\hyperlink{classnntrainer_1_1MemoryPool_a3b4875203c72f40ed7c9c2138199d14b}{nntrainer\+::\+Memory\+Pool}}.



Definition at line 129 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a8bd8a7c31e17ce54e7e0c7052eda1e13_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a8bd8a7c31e17ce54e7e0c7052eda1e13_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a16a987996acec45b4f84e369d3647868}\label{classnntrainer_1_1CachePool_a16a987996acec45b4f84e369d3647868}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!flush@{flush}}
\index{flush@{flush}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{flush()}{flush()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::flush (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Flush cache data to device. 

\begin{DoxyNote}{Note}
it must be called only when epoch ends. 
\end{DoxyNote}


Definition at line 198 of file cache\+\_\+pool.\+cpp.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a16a987996acec45b4f84e369d3647868_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_aa0af8224f75188addeb7067fbf9faaa1}\label{classnntrainer_1_1CachePool_aa0af8224f75188addeb7067fbf9faaa1}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!flushExcept@{flushExcept}}
\index{flushExcept@{flushExcept}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{flushExcept()}{flushExcept()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::flush\+Except (\begin{DoxyParamCaption}\item[{std\+::vector$<$ unsigned int $>$}]{order }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Flush cache data to device except given order. 


\begin{DoxyParams}{Parameters}
{\em order} & except execution order \\
\hline
\end{DoxyParams}
We assumes that flush\+Except will be called in front of each execution order, and the order is incremental. So, we can conclude that, if the order passes by the max order of the cache element, it was L\+A\+ST access of the element.

Definition at line 232 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_aa0af8224f75188addeb7067fbf9faaa1_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a3ce5b8e520c00801c5b58b7bc90d985d}\label{classnntrainer_1_1CachePool_a3ce5b8e520c00801c5b58b7bc90d985d}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!flushExcept@{flushExcept}}
\index{flushExcept@{flushExcept}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{flushExcept()}{flushExcept()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::flush\+Except (\begin{DoxyParamCaption}\item[{unsigned int}]{order }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Flush cache data to device except given order. 


\begin{DoxyParams}{Parameters}
{\em order} & except execution order \\
\hline
\end{DoxyParams}
We assumes that flush\+Except will be called in front of each execution order, and the order is incremental. So, we can conclude that, if the order passes by the max order of the cache element, it was L\+A\+ST access of the element.

Definition at line 208 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a3ce5b8e520c00801c5b58b7bc90d985d_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a20f44712e89a03f846bc11cebf966591}\label{classnntrainer_1_1CachePool_a20f44712e89a03f846bc11cebf966591}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!getCachePolicy@{getCachePolicy}}
\index{getCachePolicy@{getCachePolicy}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{getCachePolicy()}{getCachePolicy()}}
{\footnotesize\ttfamily std\+::vector$<$\mbox{\hyperlink{namespacenntrainer_aa82a5a0874fed058056879c555555d78}{Cache\+Policy}}$>$\& nntrainer\+::\+Cache\+Pool\+::get\+Cache\+Policy (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [protected]}}



Get cache policies. 

\begin{DoxyReturn}{Returns}
Cache polices 
\end{DoxyReturn}


Definition at line 211 of file cache\+\_\+pool.\+h.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_aa41c9c406113ffca67aa242dd3ae5135}\label{classnntrainer_1_1CachePool_aa41c9c406113ffca67aa242dd3ae5135}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!getMemory@{getMemory}}
\index{getMemory@{getMemory}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{getMemory()}{getMemory()}}
{\footnotesize\ttfamily std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{classnntrainer_1_1MemoryData}{Memory\+Data}}$<$ float $>$ $>$ nntrainer\+::\+Cache\+Pool\+::get\+Memory (\begin{DoxyParamCaption}\item[{unsigned int}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Get the allocated cache. 


\begin{DoxyParams}{Parameters}
{\em id} & The token received from the request\+Memory\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The pointer of the cache
\end{DoxyReturn}
This function will throw if called before allocation. 

Reimplemented from \mbox{\hyperlink{classnntrainer_1_1MemoryPool_ae8b04f1e5733228356efb3ff22420f42}{nntrainer\+::\+Memory\+Pool}}.



Definition at line 171 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a53cc95423f7eb54361f4b4f343a7619d}\label{classnntrainer_1_1CachePool_a53cc95423f7eb54361f4b4f343a7619d}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!getName@{getName}}
\index{getName@{getName}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{getName()}{getName()}}
{\footnotesize\ttfamily virtual std\+::string nntrainer\+::\+Cache\+Pool\+::get\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Get name. 

\begin{DoxyReturn}{Returns}
cache pool name 
\end{DoxyReturn}


Definition at line 189 of file cache\+\_\+pool.\+h.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_aa481c1c733646606b5de6560e91f0a44}\label{classnntrainer_1_1CachePool_aa481c1c733646606b5de6560e91f0a44}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!initCacheElemIter@{initCacheElemIter}}
\index{initCacheElemIter@{initCacheElemIter}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{initCacheElemIter()}{initCacheElemIter()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::init\+Cache\+Elem\+Iter (\begin{DoxyParamCaption}\item[{Cache\+Elems\+Iter \&}]{iter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data by execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 271 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_ab62044e86274cad2a516c053d9878b80}\label{classnntrainer_1_1CachePool_ab62044e86274cad2a516c053d9878b80}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!initExecIdsIter@{initExecIdsIter}}
\index{initExecIdsIter@{initExecIdsIter}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{initExecIdsIter()}{initExecIdsIter()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::init\+Exec\+Ids\+Iter (\begin{DoxyParamCaption}\item[{unsigned int}]{order,  }\item[{Exec\+Ids\+Iter \&}]{iter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data by execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 279 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a36dda6d8c99264afffdd179a8697dac0}\label{classnntrainer_1_1CachePool_a36dda6d8c99264afffdd179a8697dac0}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!invalidate@{invalidate}}
\index{invalidate@{invalidate}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{invalidate()}{invalidate()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::invalidate (\begin{DoxyParamCaption}\item[{unsigned int}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}



invalidate cache element 


\begin{DoxyParams}{Parameters}
{\em cache} & element id \\
\hline
\end{DoxyParams}


Definition at line 147 of file cache\+\_\+pool.\+cpp.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a36dda6d8c99264afffdd179a8697dac0_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a24fc60236178323100b2d49011594281}\label{classnntrainer_1_1CachePool_a24fc60236178323100b2d49011594281}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!isAllocated@{isAllocated}}
\index{isAllocated@{isAllocated}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{isAllocated()}{isAllocated()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Cache\+Pool\+::is\+Allocated (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [virtual]}}



Is the cache pool allocated. 

\begin{DoxyReturn}{Returns}
true if the memory is allocated, else false 
\end{DoxyReturn}


Reimplemented from \mbox{\hyperlink{classnntrainer_1_1MemoryPool_a02b04bf079aae50660bb1bc15397a3dc}{nntrainer\+::\+Memory\+Pool}}.



Definition at line 264 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_aec8812fe495ab737c4688fdc51c1f96f}\label{classnntrainer_1_1CachePool_aec8812fe495ab737c4688fdc51c1f96f}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!isLastCacheElemIter@{isLastCacheElemIter}}
\index{isLastCacheElemIter@{isLastCacheElemIter}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{isLastCacheElemIter()}{isLastCacheElemIter()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Cache\+Pool\+::is\+Last\+Cache\+Elem\+Iter (\begin{DoxyParamCaption}\item[{const Cache\+Elems\+Iter \&}]{iter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Check iterator is last element. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 275 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a8949dae0e7aabbe9cc3bc992fdce569f}\label{classnntrainer_1_1CachePool_a8949dae0e7aabbe9cc3bc992fdce569f}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!isLastExecIdsIter@{isLastExecIdsIter}}
\index{isLastExecIdsIter@{isLastExecIdsIter}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{isLastExecIdsIter()}{isLastExecIdsIter()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Cache\+Pool\+::is\+Last\+Exec\+Ids\+Iter (\begin{DoxyParamCaption}\item[{unsigned int}]{order,  }\item[{const Exec\+Ids\+Iter \&}]{iter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Check iterator is last element. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 283 of file cache\+\_\+pool.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CachePool_a6685c3d3ed45e361c80c0280d98c27e6}\label{classnntrainer_1_1CachePool_a6685c3d3ed45e361c80c0280d98c27e6}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!loadExec@{loadExec}}
\index{loadExec@{loadExec}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{loadExec()}{loadExec()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::load\+Exec (\begin{DoxyParamCaption}\item[{unsigned int}]{order }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data by execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 266 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a6685c3d3ed45e361c80c0280d98c27e6_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a0cf16f01c512d7bb820e63bea4f671ec}\label{classnntrainer_1_1CachePool_a0cf16f01c512d7bb820e63bea4f671ec}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!loadExecOnce@{loadExecOnce}}
\index{loadExecOnce@{loadExecOnce}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{loadExecOnce()}{loadExecOnce()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Cache\+Pool\+::load\+Exec\+Once (\begin{DoxyParamCaption}\item[{unsigned int}]{order,  }\item[{Exec\+Ids\+Iter \&}]{iter }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data by execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 287 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a0cf16f01c512d7bb820e63bea4f671ec_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a6550cd7f9c4b50070c767e6c9274f850}\label{classnntrainer_1_1CachePool_a6550cd7f9c4b50070c767e6c9274f850}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!requestMemory@{requestMemory}}
\index{requestMemory@{requestMemory}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{requestMemory()}{requestMemory()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Cache\+Pool\+::request\+Memory (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{bytes,  }\item[{unsigned int}]{start\+\_\+time,  }\item[{unsigned int}]{end\+\_\+time,  }\item[{std\+::vector$<$ unsigned int $>$}]{exec\+\_\+order = {\ttfamily std\+:\+:vector$<$unsigned~int$>$()},  }\item[{\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}}}]{lifespan = {\ttfamily \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622daa9e0b1de0ff7353f28b66401c4d303bc}{Tensor\+Lifespan\+::\+M\+A\+X\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Request Memory from memory pool. 

\begin{DoxyNote}{Note}
start\+\_\+time is inclusive, but end\+\_\+time is exclusive 
\end{DoxyNote}


Definition at line 154 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a6550cd7f9c4b50070c767e6c9274f850_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a79494d2cda9d835b21b239b60fa8689e}\label{classnntrainer_1_1CachePool_a79494d2cda9d835b21b239b60fa8689e}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!unloadExec@{unloadExec}}
\index{unloadExec@{unloadExec}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{unloadExec()}{unloadExec()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::unload\+Exec (\begin{DoxyParamCaption}\item[{unsigned int}]{order }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Unload cache data by execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
\end{DoxyParams}


Definition at line 297 of file cache\+\_\+pool.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a79494d2cda9d835b21b239b60fa8689e_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1CachePool_a4abf98128f9e27c7ac65692d17cd75be}\label{classnntrainer_1_1CachePool_a4abf98128f9e27c7ac65692d17cd75be}} 
\index{nntrainer::CachePool@{nntrainer::CachePool}!validate@{validate}}
\index{validate@{validate}!nntrainer::CachePool@{nntrainer::CachePool}}
\doxysubsubsection{\texorpdfstring{validate()}{validate()}}
{\footnotesize\ttfamily void nntrainer\+::\+Cache\+Pool\+::validate (\begin{DoxyParamCaption}\item[{unsigned int}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}, {\ttfamily [virtual]}}



validate cache element 


\begin{DoxyParams}{Parameters}
{\em cache} & element id \\
\hline
\end{DoxyParams}


Definition at line 140 of file cache\+\_\+pool.\+cpp.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1CachePool_a4abf98128f9e27c7ac65692d17cd75be_icgraph}
\end{center}
\end{figure}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
tensor/\mbox{\hyperlink{cache__pool_8h}{cache\+\_\+pool.\+h}}\item 
tensor/\mbox{\hyperlink{cache__pool_8cpp}{cache\+\_\+pool.\+cpp}}\end{DoxyCompactItemize}
