\doxysection{gko::\+Cpu\+Timer Class Reference}
\hypertarget{classgko_1_1CpuTimer}{}\label{classgko_1_1CpuTimer}\index{gko::CpuTimer@{gko::CpuTimer}}


A timer using std::\+chrono::\+steady\+\_\+clock for timing.  




{\ttfamily \+\#include $<$ginkgo/\+core/\+base/\+timer.\+hpp$>$}



Inheritance diagram for gko::\+Cpu\+Timer:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=160pt]{classgko_1_1CpuTimer__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+Cpu\+Timer:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=160pt]{classgko_1_1CpuTimer__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \doxymbox{\hyperlink{classgko_1_1CpuTimer_af9752e97dcf1d14d068d167d7a8c2137}{record}} (\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&time) override
\begin{DoxyCompactList}\small\item\em Records a time point at the current time. \end{DoxyCompactList}\item 
void \doxymbox{\hyperlink{classgko_1_1CpuTimer_acf1d0af0c06e29c54b6e4b3b88839a63}{wait}} (\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&time) override
\begin{DoxyCompactList}\small\item\em Waits until all kernels in-\/process when recording the time point are finished. \end{DoxyCompactList}\item 
std::\+chrono::\+nanoseconds \doxymbox{\hyperlink{classgko_1_1CpuTimer_a1ea7361ad460b0ce9b4cd66b9de35b15}{difference\+\_\+async}} (const \doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&start, const \doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&\doxymbox{\hyperlink{namespacegko_1_1stop}{stop}}) override
\begin{DoxyCompactList}\small\item\em Computes the difference between the two time points in nanoseconds. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1Timer}{gko::\+\+Timer}}}
\begin{DoxyCompactItemize}
\item 
\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \doxymbox{\hyperlink{classgko_1_1Timer_a36a9fae8d1f1df78829a264e0049addb}{create\+\_\+time\+\_\+point}} ()
\begin{DoxyCompactList}\small\item\em Returns a newly created time point. \end{DoxyCompactList}\item 
std::\+chrono::\+nanoseconds \doxymbox{\hyperlink{classgko_1_1Timer_a096e0525fc320073239e63305b9bcea0}{difference}} (\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&start, \doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&\doxymbox{\hyperlink{namespacegko_1_1stop}{stop}})
\begin{DoxyCompactList}\small\item\em Computes the difference between the two time points in nanoseconds. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Static Public Member Functions inherited from \doxymbox{\hyperlink{classgko_1_1Timer}{gko::\+\+Timer}}}
\begin{DoxyCompactItemize}
\item 
static std::\+unique\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Timer}{Timer}} $>$ \doxymbox{\hyperlink{classgko_1_1Timer_a8e44eae260c1b3ad7a642338c1c5ce1e}{create\+\_\+for\+\_\+executor}} (std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ exec)
\begin{DoxyCompactList}\small\item\em Creates the timer type most suitable for recording accurate timings of kernels on the given executor. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A timer using std::\+chrono::\+steady\+\_\+clock for timing. 

\label{doc-func-members}
\Hypertarget{classgko_1_1CpuTimer_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1CpuTimer_a1ea7361ad460b0ce9b4cd66b9de35b15}\index{gko::CpuTimer@{gko::CpuTimer}!difference\_async@{difference\_async}}
\index{difference\_async@{difference\_async}!gko::CpuTimer@{gko::CpuTimer}}
\doxysubsubsection{\texorpdfstring{difference\_async()}{difference\_async()}}
{\footnotesize\ttfamily \label{classgko_1_1CpuTimer_a1ea7361ad460b0ce9b4cd66b9de35b15} 
std::\+chrono::\+nanoseconds gko::\+\+Cpu\+Timer::\+difference\+\_\+async (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&}]{start}{, }\item[{const \doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&}]{stop}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Computes the difference between the two time points in nanoseconds. 

This asynchronous version does not synchronize itself, so the time points need to have been synchronized with, i.\+e. {\ttfamily timer-\/\texorpdfstring{$>$}{>}wait(stop)} needs to have been called. The version is intended for more advanced users who want to measure the overhead of timing functionality separately.


\begin{DoxyParams}{Parameters}
{\em start} & the first time point (earlier) \\
\hline
{\em end} & the second time point (later)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
the difference between the time points in nanoseconds. 
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Timer_a9f6ea65e99c2e65d67803a7da3f4d8a1}{gko::\+\+Timer}}.

\Hypertarget{classgko_1_1CpuTimer_af9752e97dcf1d14d068d167d7a8c2137}\index{gko::CpuTimer@{gko::CpuTimer}!record@{record}}
\index{record@{record}!gko::CpuTimer@{gko::CpuTimer}}
\doxysubsubsection{\texorpdfstring{record()}{record()}}
{\footnotesize\ttfamily \label{classgko_1_1CpuTimer_af9752e97dcf1d14d068d167d7a8c2137} 
void gko::\+\+Cpu\+Timer::\+record (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&}]{time}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Records a time point at the current time. 



Implements \doxymbox{\hyperlink{classgko_1_1Timer_af60e8cb620d9e87a90c6e799dc97cb76}{gko::\+\+Timer}}.

\Hypertarget{classgko_1_1CpuTimer_acf1d0af0c06e29c54b6e4b3b88839a63}\index{gko::CpuTimer@{gko::CpuTimer}!wait@{wait}}
\index{wait@{wait}!gko::CpuTimer@{gko::CpuTimer}}
\doxysubsubsection{\texorpdfstring{wait()}{wait()}}
{\footnotesize\ttfamily \label{classgko_1_1CpuTimer_acf1d0af0c06e29c54b6e4b3b88839a63} 
void gko::\+\+Cpu\+Timer::\+wait (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{classgko_1_1time__point}{time\+\_\+point}} \&}]{time}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Waits until all kernels in-\/process when recording the time point are finished. 



Implements \doxymbox{\hyperlink{classgko_1_1Timer_a895f02685ba5da78e8cceef4246fd399}{gko::\+\+Timer}}.



The documentation for this class was generated from the following file:\+\begin{DoxyCompactItemize}
\item 
ginkgo/\+core/\+base/\+timer.\+hpp\end{DoxyCompactItemize}
