\doxysection{gko::\+Omp\+Executor Class Reference}
\hypertarget{classgko_1_1OmpExecutor}{}\label{classgko_1_1OmpExecutor}\index{gko::OmpExecutor@{gko::OmpExecutor}}


This is the \doxylink{classgko_1_1Executor}{Executor} subclass which represents the Open\+MP device (typically CPU).  




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



Inheritance diagram for gko::\+Omp\+Executor:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1OmpExecutor__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for gko::\+Omp\+Executor:\+
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classgko_1_1OmpExecutor__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
std::\+shared\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a9db279007ed52b4e116c918e370f6474}{get\+\_\+master}} () noexcept override
\begin{DoxyCompactList}\small\item\em Returns the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}. \end{DoxyCompactList}\item 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a3b8664fadbd3799fdc44b85056ef94b1}{get\+\_\+master}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Returns the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}.    \end{DoxyCompactList}\item 
void \doxymbox{\hyperlink{classgko_1_1OmpExecutor_ad4e421dcc3d1e5c7e396167a122e57ae}{synchronize}} () const override
\begin{DoxyCompactList}\small\item\em Synchronize the operations launched on the executor with its master. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1OmpExecutor_a108b87a31623e2e444aedf88646c1ad5}\label{classgko_1_1OmpExecutor_a108b87a31623e2e444aedf88646c1ad5} 
int {\bfseries get\+\_\+num\+\_\+cores} () const
\item 
\Hypertarget{classgko_1_1OmpExecutor_a1975f274c81327d1efb67792c8c1f113}\label{classgko_1_1OmpExecutor_a1975f274c81327d1efb67792c8c1f113} 
int {\bfseries get\+\_\+num\+\_\+threads\+\_\+per\+\_\+core} () const
\item 
\doxymbox{\hyperlink{classgko_1_1scoped__device__id__guard}{scoped\+\_\+device\+\_\+id\+\_\+guard}} \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a47f17ed64144ec29bdc1ede8ac89d4ef}{get\+\_\+scoped\+\_\+device\+\_\+id\+\_\+guard}} () const override
\item 
std::\+string \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a157fbc623333a1658f8a3915e7b2da2d}{get\+\_\+description}} () const override
\item 
virtual void \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a4fdbf8100b039d3858634bf9c502f5d7}{run}} (const \doxymbox{\hyperlink{classgko_1_1Operation}{Operation}} \&op) const=0
\begin{DoxyCompactList}\small\item\em Runs the specified \doxylink{classgko_1_1Operation}{Operation} using this \doxylink{classgko_1_1Executor}{Executor}. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Closure\+Omp, typename Closure\+Cuda, typename Closure\+Hip, typename Closure\+Dpcpp$>$ }\\void \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a294787f033b02fd013af087d02a4ae1b}{run}} (const Closure\+Omp \&op\+\_\+omp, const Closure\+Cuda \&op\+\_\+cuda, const Closure\+Hip \&op\+\_\+hip, const Closure\+Dpcpp \&op\+\_\+dpcpp) const
\begin{DoxyCompactList}\small\item\em Runs one of the passed in functors, depending on the \doxylink{classgko_1_1Executor}{Executor} type. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Closure\+Reference, typename Closure\+Omp, typename Closure\+Cuda, typename Closure\+Hip, typename Closure\+Dpcpp$>$ }\\void \doxymbox{\hyperlink{classgko_1_1OmpExecutor_abe906f109824da54447e504ff88aa97f}{run}} (std::\+string name, const Closure\+Reference \&op\+\_\+ref, const Closure\+Omp \&op\+\_\+omp, const Closure\+Cuda \&op\+\_\+cuda, const Closure\+Hip \&op\+\_\+hip, const Closure\+Dpcpp \&op\+\_\+dpcpp) const
\begin{DoxyCompactList}\small\item\em Runs one of the passed in functors, depending on the \doxylink{classgko_1_1Executor}{Executor} type. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classgko_1_1OmpExecutor_af977cb680e0427ca4eb71eb7b1266211}\label{classgko_1_1OmpExecutor_af977cb680e0427ca4eb71eb7b1266211} 
static std::\+shared\+\_\+ptr$<$ Omp\+Executor $>$ {\bfseries create} (std::\+shared\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1CpuAllocatorBase}{Cpu\+Allocator\+Base}} $>$ \doxymbox{\hyperlink{classgko_1_1Executor_a99e1d008646298b06ce10979253de1ec}{alloc}}=std::\+make\+\_\+shared$<$ \doxymbox{\hyperlink{classgko_1_1CpuAllocator}{Cpu\+Allocator}} $>$())
\begin{DoxyCompactList}\small\item\em Creates a new \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor}. \end{DoxyCompactList}\item 
\Hypertarget{classgko_1_1OmpExecutor_afaa5c81d9bc507cee76b035bde4dedf9}\label{classgko_1_1OmpExecutor_afaa5c81d9bc507cee76b035bde4dedf9} 
static int {\bfseries get\+\_\+num\+\_\+omp\+\_\+threads} ()
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This is the \doxylink{classgko_1_1Executor}{Executor} subclass which represents the Open\+MP device (typically CPU). 

\label{doc-func-members}
\Hypertarget{classgko_1_1OmpExecutor_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classgko_1_1OmpExecutor_a157fbc623333a1658f8a3915e7b2da2d}\index{gko::OmpExecutor@{gko::OmpExecutor}!get\_description@{get\_description}}
\index{get\_description@{get\_description}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{get\_description()}{get\_description()}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a157fbc623333a1658f8a3915e7b2da2d} 
std::\+string gko::\+\+Omp\+Executor::\+get\+\_\+description (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}

\begin{DoxyReturn}{Returns}
a textual representation of the executor and its device. 
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Executor_a9b25713dfacc7914b69115f815e616b0}{gko::\+\+Executor}}.



Reimplemented in \doxymbox{\hyperlink{classgko_1_1ReferenceExecutor_a84e5353b33e9d648476aed0e76999358}{gko::\+\+Reference\+Executor}}.



References \doxymbox{\hyperlink{classgko_1_1Executor_a99e1d008646298b06ce10979253de1ec}{gko::\+\+Executor::\+alloc()}}, and \doxymbox{\hyperlink{classgko_1_1machine__topology_a78ca968f9890a1e3d6758136ead05982}{gko::\+machine\+\_\+topology::\+get\+\_\+instance()}}.

\Hypertarget{classgko_1_1OmpExecutor_a3b8664fadbd3799fdc44b85056ef94b1}\index{gko::OmpExecutor@{gko::OmpExecutor}!get\_master@{get\_master}}
\index{get\_master@{get\_master}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{get\_master()}{get\_master()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a3b8664fadbd3799fdc44b85056ef94b1} 
std::\+shared\+\_\+ptr$<$ const \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ gko::\+\+Omp\+Executor::\+get\+\_\+master (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Returns the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}.    

\begin{DoxyReturn}{Returns}
the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}.    
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Executor_a30d5407c37711d49184914026d815708}{gko::\+\+Executor}}.



References \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a9db279007ed52b4e116c918e370f6474}{get\+\_\+master()}}.

\Hypertarget{classgko_1_1OmpExecutor_a9db279007ed52b4e116c918e370f6474}\index{gko::OmpExecutor@{gko::OmpExecutor}!get\_master@{get\_master}}
\index{get\_master@{get\_master}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{get\_master()}{get\_master()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a9db279007ed52b4e116c918e370f6474} 
std::\+shared\+\_\+ptr$<$ \doxymbox{\hyperlink{classgko_1_1Executor}{Executor}} $>$ gko::\+\+Omp\+Executor::\+get\+\_\+master (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Returns the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}. 

\begin{DoxyReturn}{Returns}
the master \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} of this \doxylink{classgko_1_1Executor}{Executor}. 
\end{DoxyReturn}


Implements \doxymbox{\hyperlink{classgko_1_1Executor_aa23172c7579fe4a9a41af8eba62ed54f}{gko::\+\+Executor}}.



Referenced by \doxymbox{\hyperlink{classgko_1_1OmpExecutor_a3b8664fadbd3799fdc44b85056ef94b1}{get\+\_\+master()}}.

\Hypertarget{classgko_1_1OmpExecutor_a47f17ed64144ec29bdc1ede8ac89d4ef}\index{gko::OmpExecutor@{gko::OmpExecutor}!get\_scoped\_device\_id\_guard@{get\_scoped\_device\_id\_guard}}
\index{get\_scoped\_device\_id\_guard@{get\_scoped\_device\_id\_guard}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{get\_scoped\_device\_id\_guard()}{get\_scoped\_device\_id\_guard()}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a47f17ed64144ec29bdc1ede8ac89d4ef} 
\doxymbox{\hyperlink{classgko_1_1scoped__device__id__guard}{scoped\+\_\+device\+\_\+id\+\_\+guard}} gko::\+\+Omp\+Executor::\+get\+\_\+scoped\+\_\+device\+\_\+id\+\_\+guard (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Implements \doxymbox{\hyperlink{classgko_1_1Executor}{gko::\+\+Executor}}.

\Hypertarget{classgko_1_1OmpExecutor_a294787f033b02fd013af087d02a4ae1b}\index{gko::OmpExecutor@{gko::OmpExecutor}!run@{run}}
\index{run@{run}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{run()}{run()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a294787f033b02fd013af087d02a4ae1b} 
template$<$typename Closure\+Omp, typename Closure\+Cuda, typename Closure\+Hip, typename Closure\+Dpcpp$>$ \\
void \doxymbox{\hyperlink{classgko_1_1Executor_a1de8e2668b76e66690acf5eef9e8324d}{gko::\+\+Executor::\+run}} (\begin{DoxyParamCaption}\item[{const Closure\+Omp \&}]{op\+\_\+omp}{, }\item[{const Closure\+Cuda \&}]{op\+\_\+cuda}{, }\item[{const Closure\+Hip \&}]{op\+\_\+hip}{, }\item[{const Closure\+Dpcpp \&}]{op\+\_\+dpcpp}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Runs one of the passed in functors, depending on the \doxylink{classgko_1_1Executor}{Executor} type. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Closure\+Omp} & type of op\+\_\+omp \\
\hline
{\em Closure\+Cuda} & type of op\+\_\+cuda \\
\hline
{\em Closure\+Hip} & type of op\+\_\+hip \\
\hline
{\em Closure\+Dpcpp} & type of op\+\_\+dpcpp\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em op\+\_\+omp} & functor to run in case of a \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} or \doxylink{classgko_1_1ReferenceExecutor}{Reference\+Executor} \\
\hline
{\em op\+\_\+cuda} & functor to run in case of a \doxylink{classgko_1_1CudaExecutor}{Cuda\+Executor} \\
\hline
{\em op\+\_\+hip} & functor to run in case of a \doxylink{classgko_1_1HipExecutor}{Hip\+Executor} \\
\hline
{\em op\+\_\+dpcpp} & functor to run in case of a \doxylink{classgko_1_1DpcppExecutor}{Dpcpp\+Executor} \\
\hline
\end{DoxyParams}
\Hypertarget{classgko_1_1OmpExecutor_a4fdbf8100b039d3858634bf9c502f5d7}\index{gko::OmpExecutor@{gko::OmpExecutor}!run@{run}}
\index{run@{run}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{run()}{run()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_a4fdbf8100b039d3858634bf9c502f5d7} 
virtual void \doxymbox{\hyperlink{classgko_1_1Executor_a1de8e2668b76e66690acf5eef9e8324d}{gko::\+\+Executor::\+run}} (\begin{DoxyParamCaption}\item[{const \doxymbox{\hyperlink{classgko_1_1Operation}{Operation}} \&}]{op}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [virtual]}}



Runs the specified \doxylink{classgko_1_1Operation}{Operation} using this \doxylink{classgko_1_1Executor}{Executor}. 


\begin{DoxyParams}{Parameters}
{\em op} & the operation to run \\
\hline
\end{DoxyParams}


Implements \doxymbox{\hyperlink{classgko_1_1Executor_a1de8e2668b76e66690acf5eef9e8324d}{gko::\+\+Executor}}.



Reimplemented in \doxymbox{\hyperlink{classgko_1_1ReferenceExecutor_a82b41b42dbd26e8ac5b0146de79e5d34}{gko::\+\+Reference\+Executor}}.

\Hypertarget{classgko_1_1OmpExecutor_abe906f109824da54447e504ff88aa97f}\index{gko::OmpExecutor@{gko::OmpExecutor}!run@{run}}
\index{run@{run}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{run()}{run()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_abe906f109824da54447e504ff88aa97f} 
template$<$typename Closure\+Reference, typename Closure\+Omp, typename Closure\+Cuda, typename Closure\+Hip, typename Closure\+Dpcpp$>$ \\
void \doxymbox{\hyperlink{classgko_1_1Executor_a1de8e2668b76e66690acf5eef9e8324d}{gko::\+\+Executor::\+run}} (\begin{DoxyParamCaption}\item[{std::\+string}]{name}{, }\item[{const Closure\+Reference \&}]{op\+\_\+ref}{, }\item[{const Closure\+Omp \&}]{op\+\_\+omp}{, }\item[{const Closure\+Cuda \&}]{op\+\_\+cuda}{, }\item[{const Closure\+Hip \&}]{op\+\_\+hip}{, }\item[{const Closure\+Dpcpp \&}]{op\+\_\+dpcpp}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Runs one of the passed in functors, depending on the \doxylink{classgko_1_1Executor}{Executor} type. 


\begin{DoxyTemplParams}{Template Parameters}
{\em Closure\+Reference} & type of op\+\_\+ref \\
\hline
{\em Closure\+Omp} & type of op\+\_\+omp \\
\hline
{\em Closure\+Cuda} & type of op\+\_\+cuda \\
\hline
{\em Closure\+Hip} & type of op\+\_\+hip \\
\hline
{\em Closure\+Dpcpp} & type of op\+\_\+dpcpp\\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em name} & the name of the operation \\
\hline
{\em op\+\_\+ref} & functor to run in case of a \doxylink{classgko_1_1ReferenceExecutor}{Reference\+Executor} \\
\hline
{\em op\+\_\+omp} & functor to run in case of a \doxylink{classgko_1_1OmpExecutor}{Omp\+Executor} \\
\hline
{\em op\+\_\+cuda} & functor to run in case of a \doxylink{classgko_1_1CudaExecutor}{Cuda\+Executor} \\
\hline
{\em op\+\_\+hip} & functor to run in case of a \doxylink{classgko_1_1HipExecutor}{Hip\+Executor} \\
\hline
{\em op\+\_\+dpcpp} & functor to run in case of a \doxylink{classgko_1_1DpcppExecutor}{Dpcpp\+Executor} \\
\hline
\end{DoxyParams}
\Hypertarget{classgko_1_1OmpExecutor_ad4e421dcc3d1e5c7e396167a122e57ae}\index{gko::OmpExecutor@{gko::OmpExecutor}!synchronize@{synchronize}}
\index{synchronize@{synchronize}!gko::OmpExecutor@{gko::OmpExecutor}}
\doxysubsubsection{\texorpdfstring{synchronize()}{synchronize()}}
{\footnotesize\ttfamily \label{classgko_1_1OmpExecutor_ad4e421dcc3d1e5c7e396167a122e57ae} 
void gko::\+\+Omp\+Executor::\+synchronize (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Synchronize the operations launched on the executor with its master. 



Implements \doxymbox{\hyperlink{classgko_1_1Executor_a24eeee7648c0f0fd07c9866d07154875}{gko::\+\+Executor}}.



References \doxymbox{\hyperlink{classgko_1_1OmpExecutor_ad4e421dcc3d1e5c7e396167a122e57ae}{synchronize()}}.



Referenced by \doxymbox{\hyperlink{classgko_1_1OmpExecutor_ad4e421dcc3d1e5c7e396167a122e57ae}{synchronize()}}.



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