\doxysection{batch\+\_\+logger.\+hpp}
\hypertarget{batch__logger_8hpp_source}{}\label{batch__logger_8hpp_source}\index{ginkgo/core/log/batch\_logger.hpp@{ginkgo/core/log/batch\_logger.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\_LOG\_BATCH\_LOGGER\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_LOG\_BATCH\_LOGGER\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <memory>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/batch\_multi\_vector.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/log/logger.hpp>}}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00017\ \textcolor{keyword}{namespace\ }batch\ \{}
\DoxyCodeLine{00023\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko_1_1batch_1_1log}{log}}\ \{}
\DoxyCodeLine{00024\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00032\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType>}
\DoxyCodeLine{00033\ \textcolor{keyword}{struct\ }log\_data\ final\ \{}
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keyword}{using\ }real\_type\ =\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}};}
\DoxyCodeLine{00035\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ int;}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00037\ \ \ \ \ log\_data(std::shared\_ptr<const\ Executor>\ exec,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_batch\_items);}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \ \ \ \ log\_data(std::shared\_ptr<const\ Executor>\ exec,\ \doxymbox{\hyperlink{namespacegko_a9579c98b1d85bf4ad02d7cb5b96fc771}{size\_type}}\ num\_batch\_items,}
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<unsigned\ char>}}\&\ workspace);}
\DoxyCodeLine{00041\ }
\DoxyCodeLine{00045\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<real\_type>}}\ res\_norms;}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00050\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ iter\_counts;}
\DoxyCodeLine{00051\ \};}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00069\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ValueType\ =\ default\_precision>}
\DoxyCodeLine{00070\ \textcolor{keyword}{class\ }BatchConvergence\ final\ :\ \textcolor{keyword}{public}\ \doxymbox{\hyperlink{classgko_1_1log_1_1Logger}{gko::log::Logger}}\ \{}
\DoxyCodeLine{00071\ \ \ \ \ GKO\_ASSERT\_SUPPORTED\_VALUE\_TYPE;}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keyword}{using\ }real\_type\ =\ \doxymbox{\hyperlink{namespacegko_a107302a750bfa82a2107c77293f791c9}{remove\_complex<ValueType>}};}
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keyword}{using\ }index\_type\ =\ int;}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keyword}{using\ }mask\_type\ =\ gko::log::Logger::mask\_type;}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00078\ \ \ \ \ \textcolor{keywordtype}{void}\ on\_batch\_solver\_completed(}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\&\ iteration\_count,}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<real\_type>}}\&\ residual\_norm)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keyword}{static}\ std::unique\_ptr<BatchConvergence>\ \doxymbox{\hyperlink{classgko_1_1batch_1_1log_1_1BatchConvergence_aeadd0bc7ce1a27945e762c1bc4c246bc}{create}}(}
\DoxyCodeLine{00095\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ mask\_type\&\ enabled\_events\ =}
\DoxyCodeLine{00096\ \ \ \ \ \ \ \ \ \ \ \ \ gko::log::Logger::batch\_solver\_completed\_mask)}
\DoxyCodeLine{00097\ \ \ \ \ \{}
\DoxyCodeLine{00098\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unique\_ptr<BatchConvergence>(}
\DoxyCodeLine{00099\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{new}\ BatchConvergence(enabled\_events));}
\DoxyCodeLine{00100\ \ \ \ \ \}}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\&\ \doxymbox{\hyperlink{classgko_1_1batch_1_1log_1_1BatchConvergence_a378c6a063aa01db86d3221d78aff105d}{get\_num\_iterations}}()\ const\ noexcept}
\DoxyCodeLine{00106\ \ \ \ \ \{}
\DoxyCodeLine{00107\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ iteration\_count\_;}
\DoxyCodeLine{00108\ \ \ \ \ \}}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00113\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1array}{array<real\_type>}}\&\ \doxymbox{\hyperlink{classgko_1_1batch_1_1log_1_1BatchConvergence_aa286a9c964d7ea72448ff59a26206ea6}{get\_residual\_norm}}()\ const\ noexcept}
\DoxyCodeLine{00114\ \ \ \ \ \{}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ residual\_norm\_;}
\DoxyCodeLine{00116\ \ \ \ \ \}}
\DoxyCodeLine{00117\ }
\DoxyCodeLine{00118\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00119\ \ \ \ \ \textcolor{keyword}{explicit}\ \doxymbox{\hyperlink{classgko_1_1batch_1_1log_1_1BatchConvergence}{BatchConvergence}}(\textcolor{keyword}{const}\ mask\_type\&\ enabled\_events\ =}
\DoxyCodeLine{00120\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gko::log::Logger::batch\_solver\_completed\_mask)}
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{namespacegko}{gko}}::\doxymbox{\hyperlink{namespacegko_1_1batch_1_1log}{log}}::Logger(enabled\_events)}
\DoxyCodeLine{00122\ \ \ \ \ \{\}}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00125\ \ \ \ \ \textcolor{keyword}{mutable}\ \doxymbox{\hyperlink{classgko_1_1array}{array<index\_type>}}\ iteration\_count\_\{\};}
\DoxyCodeLine{00126\ \ \ \ \ \textcolor{keyword}{mutable}\ \doxymbox{\hyperlink{classgko_1_1array}{array<real\_type>}}\ residual\_norm\_\{\};}
\DoxyCodeLine{00127\ \};}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00130\ \}\ \ \textcolor{comment}{//\ namespace\ log}}
\DoxyCodeLine{00131\ \}\ \ \textcolor{comment}{//\ namespace\ batch}}
\DoxyCodeLine{00132\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00134\ }
\DoxyCodeLine{00135\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_LOG\_BATCH\_LOGGER\_HPP\_}}

\end{DoxyCode}
