\hypertarget{classnntrainer_1_1CacheLoader}{}\doxysection{nntrainer\+::Cache\+Loader Class Reference}
\label{classnntrainer_1_1CacheLoader}\index{nntrainer::CacheLoader@{nntrainer::CacheLoader}}


Cache loader from swap device.  




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

\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1CacheLoader_aa395f6072eeadaaf45fd5ebe2a24d065}{Cache\+Loader}} (std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} $>$ cache\+\_\+pool)
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1CacheLoader}{Cache\+Loader}} default constructor. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{classnntrainer_1_1CacheLoader_a646898b37f4966ac379bd3a95f05aab0}{$\sim$\+Cache\+Loader}} ()
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1CacheLoader}{Cache\+Loader}} destructor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classnntrainer_1_1CacheLoader_a883f76504666df255108e51bb256b889}\label{classnntrainer_1_1CacheLoader_a883f76504666df255108e51bb256b889}} 
virtual void \mbox{\hyperlink{classnntrainer_1_1CacheLoader_a883f76504666df255108e51bb256b889}{init}} ()
\begin{DoxyCompactList}\small\item\em initialize loader \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CacheLoader_a0b8d8fbf5f25fa147513e0712ea20888}{finish}} ()
\begin{DoxyCompactList}\small\item\em finish loader \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classnntrainer_1_1CacheLoader_aab16402edffed3e4f04baa8cf23ca24e}{load}} (unsigned int order)
\begin{DoxyCompactList}\small\item\em Load cache data with execution order. \end{DoxyCompactList}\item 
virtual int \mbox{\hyperlink{classnntrainer_1_1CacheLoader_a41b63b66df57220458a4db9750da8af0}{load\+Async}} (unsigned int order, \mbox{\hyperlink{classnntrainer_1_1TaskExecutor_ac4b54a439c1c6d9358fb31d7aba8abc1}{Task\+Executor\+::\+Complete\+Callback}} callback)
\begin{DoxyCompactList}\small\item\em Load cache data asynchronously with execution order. \end{DoxyCompactList}\item 
virtual int \mbox{\hyperlink{classnntrainer_1_1CacheLoader_a793943be3cd325bf8fd753e339760edd}{load\+Async}} (unsigned int order, \mbox{\hyperlink{classnntrainer_1_1TaskExecutor_ac4b54a439c1c6d9358fb31d7aba8abc1}{Task\+Executor\+::\+Complete\+Callback}} callback, long timeout\+\_\+ms)
\begin{DoxyCompactList}\small\item\em Load cache data asynchronously with execution order. \end{DoxyCompactList}\item 
virtual int \mbox{\hyperlink{classnntrainer_1_1CacheLoader_aea2a6206e0158df149f8e9ca42e31f72}{cancel\+Async}} (int id)
\begin{DoxyCompactList}\small\item\em Cancel async task. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Cache loader from swap device. 

Definition at line 32 of file cache\+\_\+loader.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1CacheLoader_aa395f6072eeadaaf45fd5ebe2a24d065}\label{classnntrainer_1_1CacheLoader_aa395f6072eeadaaf45fd5ebe2a24d065}} 
\index{nntrainer::CacheLoader@{nntrainer::CacheLoader}!CacheLoader@{CacheLoader}}
\index{CacheLoader@{CacheLoader}!nntrainer::CacheLoader@{nntrainer::CacheLoader}}
\doxysubsubsection{\texorpdfstring{CacheLoader()}{CacheLoader()}}
{\footnotesize\ttfamily nntrainer\+::\+Cache\+Loader\+::\+Cache\+Loader (\begin{DoxyParamCaption}\item[{std\+::shared\+\_\+ptr$<$ \mbox{\hyperlink{classnntrainer_1_1CachePool}{Cache\+Pool}} $>$}]{cache\+\_\+pool }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



\mbox{\hyperlink{classnntrainer_1_1CacheLoader}{Cache\+Loader}} default constructor. 



Definition at line 28 of file cache\+\_\+loader.\+cpp.

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



\mbox{\hyperlink{classnntrainer_1_1CacheLoader}{Cache\+Loader}} destructor. 



Definition at line 32 of file cache\+\_\+loader.\+cpp.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1CacheLoader_aea2a6206e0158df149f8e9ca42e31f72}\label{classnntrainer_1_1CacheLoader_aea2a6206e0158df149f8e9ca42e31f72}} 
\index{nntrainer::CacheLoader@{nntrainer::CacheLoader}!cancelAsync@{cancelAsync}}
\index{cancelAsync@{cancelAsync}!nntrainer::CacheLoader@{nntrainer::CacheLoader}}
\doxysubsubsection{\texorpdfstring{cancelAsync()}{cancelAsync()}}
{\footnotesize\ttfamily int nntrainer\+::\+Cache\+Loader\+::cancel\+Async (\begin{DoxyParamCaption}\item[{int}]{id }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Cancel async task. 


\begin{DoxyParams}{Parameters}
{\em id} & task id \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, otherwise negative error 
\end{DoxyReturn}


Definition at line 80 of file cache\+\_\+loader.\+cpp.

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



finish loader 



Definition at line 44 of file cache\+\_\+loader.\+cpp.

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



Load cache data with execution order. 


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


Definition at line 49 of file cache\+\_\+loader.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CacheLoader_a41b63b66df57220458a4db9750da8af0}\label{classnntrainer_1_1CacheLoader_a41b63b66df57220458a4db9750da8af0}} 
\index{nntrainer::CacheLoader@{nntrainer::CacheLoader}!loadAsync@{loadAsync}}
\index{loadAsync@{loadAsync}!nntrainer::CacheLoader@{nntrainer::CacheLoader}}
\doxysubsubsection{\texorpdfstring{loadAsync()}{loadAsync()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily int nntrainer\+::\+Cache\+Loader\+::load\+Async (\begin{DoxyParamCaption}\item[{unsigned int}]{order,  }\item[{\mbox{\hyperlink{classnntrainer_1_1TaskExecutor_ac4b54a439c1c6d9358fb31d7aba8abc1}{Task\+Executor\+::\+Complete\+Callback}}}]{callback }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data asynchronously with execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
{\em complete} & complete callback \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
async task id 
\end{DoxyReturn}


Definition at line 51 of file cache\+\_\+loader.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1CacheLoader_a793943be3cd325bf8fd753e339760edd}\label{classnntrainer_1_1CacheLoader_a793943be3cd325bf8fd753e339760edd}} 
\index{nntrainer::CacheLoader@{nntrainer::CacheLoader}!loadAsync@{loadAsync}}
\index{loadAsync@{loadAsync}!nntrainer::CacheLoader@{nntrainer::CacheLoader}}
\doxysubsubsection{\texorpdfstring{loadAsync()}{loadAsync()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily int nntrainer\+::\+Cache\+Loader\+::load\+Async (\begin{DoxyParamCaption}\item[{unsigned int}]{order,  }\item[{\mbox{\hyperlink{classnntrainer_1_1TaskExecutor_ac4b54a439c1c6d9358fb31d7aba8abc1}{Task\+Executor\+::\+Complete\+Callback}}}]{callback,  }\item[{long}]{timeout\+\_\+ms }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



Load cache data asynchronously with execution order. 


\begin{DoxyParams}{Parameters}
{\em order} & execution order \\
\hline
{\em complete} & complete callback \\
\hline
{\em timeout} & timeout time in ms \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
async task id 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
timeout\+\_\+ms does not work now. 
\end{DoxyNote}


Definition at line 56 of file cache\+\_\+loader.\+cpp.

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


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