\doxysection{spaces.\+hpp}
\hypertarget{spaces_8hpp_source}{}\label{spaces_8hpp_source}\index{ginkgo/extensions/kokkos/spaces.hpp@{ginkgo/extensions/kokkos/spaces.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\ GINKGO\_EXTENSIONS\_KOKKOS\_SPACES\_HPP}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#define\ GINKGO\_EXTENSIONS\_KOKKOS\_SPACES\_HPP}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <Kokkos\_Core.hpp>}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <ginkgo/config.hpp>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception.hpp>}}
\DoxyCodeLine{00012\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/exception\_helpers.hpp>}}
\DoxyCodeLine{00013\ \textcolor{preprocessor}{\#include\ <ginkgo/core/base/executor.hpp>}}
\DoxyCodeLine{00014\ }
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ \textcolor{keyword}{namespace\ }\doxymbox{\hyperlink{namespacegko}{gko}}\ \{}
\DoxyCodeLine{00017\ \textcolor{keyword}{namespace\ }ext\ \{}
\DoxyCodeLine{00018\ \textcolor{keyword}{namespace\ }kokkos\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{namespace\ }detail\ \{}
\DoxyCodeLine{00020\ }
\DoxyCodeLine{00021\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_SYCL}}
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#if\ KOKKOS\_VERSION\ >=\ 40500}}
\DoxyCodeLine{00023\ \textcolor{keyword}{using\ }KokkosSYCLExecSpace\ =\ Kokkos::SYCL;}
\DoxyCodeLine{00024\ \textcolor{keyword}{using\ }KokkosSYCLMemorySpace\ =\ Kokkos::SYCLDeviceUSMSpace;}
\DoxyCodeLine{00025\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00026\ \textcolor{keyword}{using\ }KokkosSYCLExecSpace\ =\ Kokkos::Experimental::SYCL;}
\DoxyCodeLine{00027\ \textcolor{keyword}{using\ }KokkosSYCLMemorySpace\ =\ Kokkos::Experimental::SYCLDeviceUSMSpace;}
\DoxyCodeLine{00028\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00029\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00039\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace,\ \textcolor{keyword}{typename}\ ExecType>}
\DoxyCodeLine{00040\ \textcolor{keyword}{struct\ }compatible\_space}
\DoxyCodeLine{00041\ \ \ \ \ :\ std::integral\_constant<bool,\ Kokkos::has\_shared\_space\ ||}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::has\_shared\_host\_pinned\_space>\ \{\};}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \textcolor{keyword}{template}\ <>}
\DoxyCodeLine{00045\ \textcolor{keyword}{struct\ }compatible\_space<Kokkos::HostSpace,\ ReferenceExecutor>\ :\ std::true\_type\ \{}
\DoxyCodeLine{00046\ \};}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00049\ \textcolor{keyword}{struct\ }compatible\_space<MemorySpace,\ ReferenceExecutor>\ \{}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{comment}{//\ need\ manual\ implementation\ of\ std::integral\_constant\ because,}}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{comment}{//\ while\ compiling\ for\ cuda,\ somehow\ bool\ is\ replaced\ by\ \_\_nv\_bool}}
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{bool}\ value\ =}
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ Kokkos::SpaceAccessibility<Kokkos::HostSpace,\ MemorySpace>::accessible;}
\DoxyCodeLine{00054\ \};}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_OPENMP}}
\DoxyCodeLine{00057\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00058\ \textcolor{keyword}{struct\ }compatible\_space<MemorySpace,\ OmpExecutor>}
\DoxyCodeLine{00059\ \ \ \ \ :\ compatible\_space<MemorySpace,\ ReferenceExecutor>\ \{\};}
\DoxyCodeLine{00060\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00061\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_CUDA}}
\DoxyCodeLine{00062\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00063\ \textcolor{keyword}{struct\ }compatible\_space<MemorySpace,\ CudaExecutor>\ \{}
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{bool}\ value\ =}
\DoxyCodeLine{00065\ \ \ \ \ \ \ \ \ Kokkos::SpaceAccessibility<Kokkos::Cuda,\ MemorySpace>::accessible;}
\DoxyCodeLine{00066\ \};}
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_HIP}}
\DoxyCodeLine{00070\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00071\ \textcolor{keyword}{struct\ }compatible\_space<MemorySpace,\ HipExecutor>\ \{}
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{bool}\ value\ =}
\DoxyCodeLine{00073\ \ \ \ \ \ \ \ \ Kokkos::SpaceAccessibility<Kokkos::HIP,\ MemorySpace>::accessible;}
\DoxyCodeLine{00074\ \};}
\DoxyCodeLine{00075\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00076\ }
\DoxyCodeLine{00077\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_SYCL}}
\DoxyCodeLine{00078\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00079\ \textcolor{keyword}{struct\ }compatible\_space<MemorySpace,\ DpcppExecutor>\ \{}
\DoxyCodeLine{00080\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{constexpr}\ \textcolor{keywordtype}{bool}\ value\ =}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ Kokkos::SpaceAccessibility<KokkosSYCLExecSpace,}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ MemorySpace>::accessible;}
\DoxyCodeLine{00083\ \};}
\DoxyCodeLine{00084\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00095\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace,\ \textcolor{keyword}{typename}\ ExecType>}
\DoxyCodeLine{00096\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ check\_compatibility(std::shared\_ptr<const\ ExecType>)}
\DoxyCodeLine{00097\ \{}
\DoxyCodeLine{00098\ \ \ \ \ \textcolor{keywordflow}{return}\ compatible\_space<MemorySpace,\ ExecType>::value;}
\DoxyCodeLine{00099\ \}}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00110\ }
\DoxyCodeLine{00111\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace>}
\DoxyCodeLine{00112\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ check\_compatibility(std::shared\_ptr<const\ Executor>\ exec)}
\DoxyCodeLine{00113\ \{}
\DoxyCodeLine{00114\ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{auto}\ p\ =\ std::dynamic\_pointer\_cast<const\ ReferenceExecutor>(exec))\ \{}
\DoxyCodeLine{00115\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ check\_compatibility<MemorySpace>(p);}
\DoxyCodeLine{00116\ \ \ \ \ \}}
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{auto}\ p\ =\ std::dynamic\_pointer\_cast<const\ OmpExecutor>(exec))\ \{}
\DoxyCodeLine{00118\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ check\_compatibility<MemorySpace>(p);}
\DoxyCodeLine{00119\ \ \ \ \ \}}
\DoxyCodeLine{00120\ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{auto}\ p\ =\ std::dynamic\_pointer\_cast<const\ CudaExecutor>(exec))\ \{}
\DoxyCodeLine{00121\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ check\_compatibility<MemorySpace>(p);}
\DoxyCodeLine{00122\ \ \ \ \ \}}
\DoxyCodeLine{00123\ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{auto}\ p\ =\ std::dynamic\_pointer\_cast<const\ HipExecutor>(exec))\ \{}
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ check\_compatibility<MemorySpace>(p);}
\DoxyCodeLine{00125\ \ \ \ \ \}}
\DoxyCodeLine{00126\ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{auto}\ p\ =\ std::dynamic\_pointer\_cast<const\ DpcppExecutor>(exec))\ \{}
\DoxyCodeLine{00127\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ check\_compatibility<MemorySpace>(p);}
\DoxyCodeLine{00128\ \ \ \ \ \}}
\DoxyCodeLine{00129\ \ \ \ \ GKO\_NOT\_IMPLEMENTED;}
\DoxyCodeLine{00130\ \}}
\DoxyCodeLine{00131\ }
\DoxyCodeLine{00132\ }
\DoxyCodeLine{00143\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ MemorySpace,\ \textcolor{keyword}{typename}\ T>}
\DoxyCodeLine{00144\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ assert\_compatibility(T\&\&\ obj)}
\DoxyCodeLine{00145\ \{}
\DoxyCodeLine{00146\ \ \ \ \ GKO\_THROW\_IF\_INVALID(check\_compatibility<MemorySpace>(obj.get\_executor()),}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}Executor\ type\ and\ memory\ space\ are\ incompatible"{}});}
\DoxyCodeLine{00148\ \}}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ }
\DoxyCodeLine{00151\ \}\ \ \textcolor{comment}{//\ namespace\ detail}}
\DoxyCodeLine{00152\ }
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00161\ \textcolor{keyword}{inline}\ std::shared\_ptr<Executor>\ create\_default\_host\_executor()}
\DoxyCodeLine{00162\ \{}
\DoxyCodeLine{00163\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_SERIAL}}
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<Kokkos::DefaultHostExecutionSpace,}
\DoxyCodeLine{00165\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::Serial>)\ \{}
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ ReferenceExecutor::create();}
\DoxyCodeLine{00167\ \ \ \ \ \}}
\DoxyCodeLine{00168\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00169\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_THREADS}}
\DoxyCodeLine{00170\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<Kokkos::DefaultHostExecutionSpace,}
\DoxyCodeLine{00171\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::Threads>)\ \{}
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ ReferenceExecutor::create();}
\DoxyCodeLine{00173\ \ \ \ \ \}}
\DoxyCodeLine{00174\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00175\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_OPENMP}}
\DoxyCodeLine{00176\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<Kokkos::DefaultHostExecutionSpace,}
\DoxyCodeLine{00177\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::OpenMP>)\ \{}
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1OmpExecutor_af977cb680e0427ca4eb71eb7b1266211}{OmpExecutor::create}}();}
\DoxyCodeLine{00179\ \ \ \ \ \}}
\DoxyCodeLine{00180\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00181\ \ \ \ \ GKO\_NOT\_IMPLEMENTED;}
\DoxyCodeLine{00182\ \}}
\DoxyCodeLine{00183\ }
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00206\ \textcolor{keyword}{template}\ <\textcolor{keyword}{typename}\ ExecSpace,}
\DoxyCodeLine{00207\ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{typename}\ MemorySpace\ =\ \textcolor{keyword}{typename}\ ExecSpace::memory\_space>}
\DoxyCodeLine{00208\ \textcolor{keyword}{inline}\ std::shared\_ptr<Executor>\ create\_executor(ExecSpace\ ex,\ MemorySpace\ =\ \{\})}
\DoxyCodeLine{00209\ \{}
\DoxyCodeLine{00210\ \ \ \ \ \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{00211\ \ \ \ \ \ \ \ \ Kokkos::SpaceAccessibility<ExecSpace,\ MemorySpace>::accessible);}
\DoxyCodeLine{00212\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_SERIAL}}
\DoxyCodeLine{00213\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ Kokkos::Serial>)\ \{}
\DoxyCodeLine{00214\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ ReferenceExecutor::create();}
\DoxyCodeLine{00215\ \ \ \ \ \}}
\DoxyCodeLine{00216\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00217\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_OPENMP}}
\DoxyCodeLine{00218\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ Kokkos::OpenMP>)\ \{}
\DoxyCodeLine{00219\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1OmpExecutor_af977cb680e0427ca4eb71eb7b1266211}{OmpExecutor::create}}();}
\DoxyCodeLine{00220\ \ \ \ \ \}}
\DoxyCodeLine{00221\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00222\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_THREADS}}
\DoxyCodeLine{00223\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ Kokkos::Threads>)\ \{}
\DoxyCodeLine{00224\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ ReferenceExecutor::create();}
\DoxyCodeLine{00225\ \ \ \ \ \}}
\DoxyCodeLine{00226\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00227\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_CUDA}}
\DoxyCodeLine{00228\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ Kokkos::Cuda>)\ \{}
\DoxyCodeLine{00229\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,\ Kokkos::CudaSpace>)\ \{}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1CudaExecutor_a075a1957241de65c0cad59f9534430a2}{CudaExecutor::create}}(}
\DoxyCodeLine{00231\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00232\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<CudaAllocator>(),\ ex.cuda\_stream());}
\DoxyCodeLine{00233\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00234\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,\ Kokkos::CudaUVMSpace>)\ \{}
\DoxyCodeLine{00235\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1CudaExecutor_a075a1957241de65c0cad59f9534430a2}{CudaExecutor::create}}(}
\DoxyCodeLine{00236\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00237\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<CudaUnifiedAllocator>(Kokkos::device\_id()),}
\DoxyCodeLine{00238\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ex.cuda\_stream());}
\DoxyCodeLine{00239\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00240\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,}
\DoxyCodeLine{00241\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::CudaHostPinnedSpace>)\ \{}
\DoxyCodeLine{00242\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1CudaExecutor_a075a1957241de65c0cad59f9534430a2}{CudaExecutor::create}}(}
\DoxyCodeLine{00243\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00244\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<CudaHostAllocator>(Kokkos::device\_id()),}
\DoxyCodeLine{00245\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ex.cuda\_stream());}
\DoxyCodeLine{00246\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00247\ \ \ \ \ \}}
\DoxyCodeLine{00248\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00249\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_HIP}}
\DoxyCodeLine{00250\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ Kokkos::HIP>)\ \{}
\DoxyCodeLine{00251\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,\ Kokkos::HIPSpace>)\ \{}
\DoxyCodeLine{00252\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1HipExecutor_a8afc5210bf8dd8aedfceab4b73f0047b}{HipExecutor::create}}(}
\DoxyCodeLine{00253\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00254\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<HipAllocator>(),\ ex.hip\_stream());}
\DoxyCodeLine{00255\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00256\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,\ Kokkos::HIPManagedSpace>)\ \{}
\DoxyCodeLine{00257\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1HipExecutor_a8afc5210bf8dd8aedfceab4b73f0047b}{HipExecutor::create}}(}
\DoxyCodeLine{00258\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00259\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<HipUnifiedAllocator>(Kokkos::device\_id()),}
\DoxyCodeLine{00260\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ex.hip\_stream());}
\DoxyCodeLine{00261\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00262\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<MemorySpace,\ Kokkos::HIPHostPinnedSpace>)\ \{}
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1HipExecutor_a8afc5210bf8dd8aedfceab4b73f0047b}{HipExecutor::create}}(}
\DoxyCodeLine{00264\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Kokkos::device\_id(),\ create\_default\_host\_executor(),}
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::make\_shared<HipHostAllocator>(Kokkos::device\_id()),}
\DoxyCodeLine{00266\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ex.hip\_stream());}
\DoxyCodeLine{00267\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00268\ \ \ \ \ \}}
\DoxyCodeLine{00269\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00270\ \textcolor{preprocessor}{\#ifdef\ KOKKOS\_ENABLE\_SYCL}}
\DoxyCodeLine{00271\ \ \ \ \ \textcolor{keywordflow}{if}\ \textcolor{keyword}{constexpr}\ (std::is\_same\_v<ExecSpace,\ detail::KokkosSYCLExecSpace>)\ \{}
\DoxyCodeLine{00272\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static\_assert}(}
\DoxyCodeLine{00273\ \ \ \ \ \ \ \ \ \ \ \ \ std::is\_same\_v<MemorySpace,\ detail::KokkosSYCLMemorySpace>,}
\DoxyCodeLine{00274\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}Ginkgo\ doesn't\ support\ shared\ memory\ space\ allocation\ for\ SYCL"{}});}
\DoxyCodeLine{00275\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \doxymbox{\hyperlink{classgko_1_1DpcppExecutor_af69a356ee07f641010df5d2e9e518bb0}{DpcppExecutor::create}}(Kokkos::device\_id(),}
\DoxyCodeLine{00276\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ create\_default\_host\_executor());}
\DoxyCodeLine{00277\ \ \ \ \ \}}
\DoxyCodeLine{00278\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00279\ \ \ \ \ GKO\_NOT\_IMPLEMENTED;}
\DoxyCodeLine{00280\ \}}
\DoxyCodeLine{00281\ }
\DoxyCodeLine{00282\ }
\DoxyCodeLine{00288\ \textcolor{keyword}{inline}\ std::shared\_ptr<Executor>\ create\_default\_executor(}
\DoxyCodeLine{00289\ \ \ \ \ Kokkos::DefaultExecutionSpace\ ex\ =\ \{\})}
\DoxyCodeLine{00290\ \{}
\DoxyCodeLine{00291\ \ \ \ \ \textcolor{keywordflow}{return}\ create\_executor(std::move(ex));}
\DoxyCodeLine{00292\ \}}
\DoxyCodeLine{00293\ }
\DoxyCodeLine{00294\ }
\DoxyCodeLine{00295\ \}\ \ \textcolor{comment}{//\ namespace\ kokkos}}
\DoxyCodeLine{00296\ \}\ \ \textcolor{comment}{//\ namespace\ ext}}
\DoxyCodeLine{00297\ \}\ \ \textcolor{comment}{//\ namespace\ gko}}
\DoxyCodeLine{00298\ }
\DoxyCodeLine{00299\ }
\DoxyCodeLine{00300\ \textcolor{preprocessor}{\#endif\ \ }\textcolor{comment}{//\ GINKGO\_EXTENSIONS\_KOKKOS\_SPACES\_HPP}}

\end{DoxyCode}
