\doxysection{version.\+hpp}
\hypertarget{version_8hpp_source}{}\label{version_8hpp_source}\index{ginkgo/core/base/version.hpp@{ginkgo/core/base/version.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{//\ SPDX-\/FileCopyrightText:\ 2017\ -\/\ 2024\ 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\_BASE\_VERSION\_HPP\_}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GKO\_PUBLIC\_CORE\_BASE\_VERSION\_HPP\_}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ }
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <ostream>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/config.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/types.hpp>}}
\DoxyCodeLine{00013\ }
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00025\ \textcolor{keyword}{struct\ }version\ \{}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keyword}{constexpr}\ version(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}},\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}},}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}})}
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}}\{\doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}}\},\ \doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}}\{\doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}}\},\ \doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}}\{\doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}}\},\ \doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}}\{\doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}}\}}
\DoxyCodeLine{00029\ \ \ \ \ \{\}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}};}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}};}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{namespacegko_a09ee89da532d8b1fa6fdecec2d20b9bf}{uint64}}\ \doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}};}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}*\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}};}
\DoxyCodeLine{00052\ \};}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00054\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator==(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ first,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ second)}
\DoxyCodeLine{00055\ \{}
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keywordflow}{return}\ first.\doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}}\ ==\ second.\doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}}\ \&\&\ first.\doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}}\ ==\ second.\doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}}\ \&\&}
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \ \ \ first.\doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}}\ ==\ second.\doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}};}
\DoxyCodeLine{00058\ \}}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator!=(\textcolor{keyword}{const}\ version\&\ first,\ \textcolor{keyword}{const}\ version\&\ second)}
\DoxyCodeLine{00061\ \{}
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keywordflow}{return}\ !(first\ ==\ second);}
\DoxyCodeLine{00063\ \}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator<(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ first,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ second)}
\DoxyCodeLine{00066\ \{}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keywordflow}{if}\ (first.major\ <\ second.major)\ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keywordflow}{if}\ (first.major\ ==\ second.major\ \&\&\ first.minor\ <\ second.minor)\ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keywordflow}{if}\ (first.major\ ==\ second.major\ \&\&\ first.minor\ ==\ second.minor\ \&\&}
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ first.patch\ <\ second.patch)}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{00073\ \}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator<=(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ first,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ second)}
\DoxyCodeLine{00076\ \{}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordflow}{return}\ !(second\ <\ first);}
\DoxyCodeLine{00078\ \}}
\DoxyCodeLine{00079\ }
\DoxyCodeLine{00080\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator>(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ first,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ second)}
\DoxyCodeLine{00081\ \{}
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keywordflow}{return}\ second\ <\ first;}
\DoxyCodeLine{00083\ \}}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ operator>=(\textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ first,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ second)}
\DoxyCodeLine{00086\ \{}
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordflow}{return}\ !(first\ <\ second);}
\DoxyCodeLine{00088\ \}}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#undef\ GKO\_ENABLE\_VERSION\_COMPARISON}}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00092\ }
\DoxyCodeLine{00101\ \textcolor{keyword}{inline}\ std::ostream\&\ operator<<(std::ostream\&\ os,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\&\ ver)}
\DoxyCodeLine{00102\ \{}
\DoxyCodeLine{00103\ \ \ \ \ os\ <<\ ver.\doxymbox{\hyperlink{structgko_1_1version_a019ce1d31714612e0c77c8ef5eb4cfde}{major}}\ <<\ \textcolor{stringliteral}{"{}."{}}\ <<\ ver.\doxymbox{\hyperlink{structgko_1_1version_abb548e6dca39e0a3718ecf13cafbba36}{minor}}\ <<\ \textcolor{stringliteral}{"{}."{}}\ <<\ ver.\doxymbox{\hyperlink{structgko_1_1version_a7580f68f7cf0600bc620c47ed6330c95}{patch}};}
\DoxyCodeLine{00104\ \ \ \ \ \textcolor{keywordflow}{if}\ (ver.\doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}})\ \{}
\DoxyCodeLine{00105\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\ ("{}}\ <<\ ver.\doxymbox{\hyperlink{structgko_1_1version_a1bd0eaa4d551c145ff9cd0c10e555ac3}{tag}}\ <<\ \textcolor{stringliteral}{"{})"{}};}
\DoxyCodeLine{00106\ \ \ \ \ \}}
\DoxyCodeLine{00107\ \ \ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{00108\ \}}
\DoxyCodeLine{00109\ }
\DoxyCodeLine{00110\ }
\DoxyCodeLine{00132\ \textcolor{keyword}{class\ }version\_info\ \{}
\DoxyCodeLine{00133\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00139\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ version\_info\&\ \doxymbox{\hyperlink{classgko_1_1version__info_ab13efac1405dd90951d2d9485acc4f30}{get}}()}
\DoxyCodeLine{00140\ \ \ \ \ \{}
\DoxyCodeLine{00141\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ version\_info\ info\{\};}
\DoxyCodeLine{00142\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ info;}
\DoxyCodeLine{00143\ \ \ \ \ \}}
\DoxyCodeLine{00144\ }
\DoxyCodeLine{00148\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a5b8240b191920dc3688ccfbbd8ae3378}{header\_version}};}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00155\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a85dd2724c9c37cb7f315a99dc03f0d72}{core\_version}};}
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00163\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a772fcf25f93d719b733602b4bba7d7ec}{reference\_version}};}
\DoxyCodeLine{00164\ }
\DoxyCodeLine{00170\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a795e1a6f8bdb0a4157b2d52b92e7b44e}{omp\_version}};}
\DoxyCodeLine{00171\ }
\DoxyCodeLine{00177\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a75d283ac87b2f80abdc48fa48b3a5d51}{cuda\_version}};}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00184\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a8934c0aa9c7d62f8168eaa3e91281182}{hip\_version}};}
\DoxyCodeLine{00185\ }
\DoxyCodeLine{00191\ \ \ \ \ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ \doxymbox{\hyperlink{classgko_1_1version__info_a21377cf89fa8d05c6c9533017ed3f3d4}{dpcpp\_version}};}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00194\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_header\_version()\ noexcept}
\DoxyCodeLine{00195\ \ \ \ \ \{}
\DoxyCodeLine{00196\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\{GKO\_VERSION\_MAJOR,\ GKO\_VERSION\_MINOR,\ GKO\_VERSION\_PATCH,}
\DoxyCodeLine{00197\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ GKO\_VERSION\_TAG\};}
\DoxyCodeLine{00198\ \ \ \ \ \}}
\DoxyCodeLine{00199\ }
\DoxyCodeLine{00200\ \ \ \ \ \textcolor{keyword}{static}\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_core\_version()\ noexcept;}
\DoxyCodeLine{00201\ }
\DoxyCodeLine{00202\ \ \ \ \ static\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_reference\_version()\ noexcept;}
\DoxyCodeLine{00203\ }
\DoxyCodeLine{00204\ \ \ \ \ static\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_omp\_version()\ noexcept;}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00206\ \ \ \ \ static\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_cuda\_version()\ noexcept;}
\DoxyCodeLine{00207\ }
\DoxyCodeLine{00208\ \ \ \ \ static\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_hip\_version()\ noexcept;}
\DoxyCodeLine{00209\ }
\DoxyCodeLine{00210\ \ \ \ \ static\ \doxymbox{\hyperlink{structgko_1_1version}{version}}\ get\_dpcpp\_version()\ noexcept;}
\DoxyCodeLine{00211\ }
\DoxyCodeLine{00212\ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info}{version\_info}}()}
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ :\ \doxymbox{\hyperlink{classgko_1_1version__info_a5b8240b191920dc3688ccfbbd8ae3378}{header\_version}}\{get\_header\_version()\},}
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a85dd2724c9c37cb7f315a99dc03f0d72}{core\_version}}\{get\_core\_version()\},}
\DoxyCodeLine{00215\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a772fcf25f93d719b733602b4bba7d7ec}{reference\_version}}\{get\_reference\_version()\},}
\DoxyCodeLine{00216\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a795e1a6f8bdb0a4157b2d52b92e7b44e}{omp\_version}}\{get\_omp\_version()\},}
\DoxyCodeLine{00217\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a75d283ac87b2f80abdc48fa48b3a5d51}{cuda\_version}}\{get\_cuda\_version()\},}
\DoxyCodeLine{00218\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a8934c0aa9c7d62f8168eaa3e91281182}{hip\_version}}\{get\_hip\_version()\},}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{classgko_1_1version__info_a21377cf89fa8d05c6c9533017ed3f3d4}{dpcpp\_version}}\{get\_dpcpp\_version()\}}
\DoxyCodeLine{00220\ \ \ \ \ \{\}}
\DoxyCodeLine{00221\ \};}
\DoxyCodeLine{00222\ }
\DoxyCodeLine{00223\ }
\DoxyCodeLine{00232\ std::ostream\&\ operator<<(std::ostream\&\ os,\ \textcolor{keyword}{const}\ \doxymbox{\hyperlink{classgko_1_1version__info}{version\_info}}\&\ ver\_info);}
\DoxyCodeLine{00233\ }
\DoxyCodeLine{00234\ }
\DoxyCodeLine{00235\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00236\ }
\DoxyCodeLine{00237\ }
\DoxyCodeLine{00238\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GKO\_PUBLIC\_CORE\_BASE\_VERSION\_HPP\_}}

\end{DoxyCode}
