18 #ifndef AMESOS2_KOKKOS_IMPL_HPP
19 #define AMESOS2_KOKKOS_IMPL_HPP
21 #include <type_traits>
23 #include <Kokkos_Core.hpp>
24 #include <KokkosSparse_CrsMatrix.hpp>
25 #include <Tpetra_KokkosCompat_ClassicNodeAPI_Wrapper.hpp>
27 #define AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(S,LO,NODE_TYPE) \
28 template class Amesos2::AMESOS2_KOKKOS_IMPL_SOLVER_NAME<KokkosSparse::CrsMatrix<S, LO, \
29 typename NODE_TYPE::device_type>, \
30 Kokkos::View<S**, Kokkos::LayoutLeft, typename NODE_TYPE::device_type> >;
32 #ifdef KOKKOS_ENABLE_CUDA_UVM
33 #define AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(S,LO) \
34 template class Amesos2::AMESOS2_KOKKOS_IMPL_SOLVER_NAME<KokkosSparse::CrsMatrix<S, LO, \
35 Kokkos::Device<Kokkos::Cuda,Kokkos::CudaSpace>>, \
36 Kokkos::View<S**, Kokkos::LayoutLeft, Kokkos::Device<Kokkos::Cuda,Kokkos::CudaSpace>> >;
38 #define AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(S,LO)
41 #if defined(KOKKOS_ENABLE_SERIAL)
42 #ifdef HAVE_TPETRA_INST_FLOAT
43 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosSerialWrapperNode)
45 #ifdef HAVE_TPETRA_INST_DOUBLE
46 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosSerialWrapperNode)
48 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
49 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosSerialWrapperNode)
51 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
52 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosSerialWrapperNode)
56 #if defined(KOKKOS_ENABLE_THREADS)
57 #ifdef HAVE_TPETRA_INST_FLOAT
58 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosKokkosThreadsWrapperNode)
60 #ifdef HAVE_TPETRA_INST_DOUBLE
61 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosKokkosThreadsWrapperNode)
63 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
64 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosKokkosThreadsWrapperNode)
66 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
67 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosKokkosThreadsWrapperNode)
69 #endif // KOKKOS_ENABLE_THREADS
71 #if defined(KOKKOS_ENABLE_OPENMP)
72 #ifdef HAVE_TPETRA_INST_FLOAT
73 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode)
75 #ifdef HAVE_TPETRA_INST_DOUBLE
76 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode)
78 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
79 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode)
81 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
82 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosOpenMPWrapperNode)
84 #endif // KOKKOS_ENABLE_OPENMP
86 #if defined(KOKKOS_ENABLE_CUDA)
87 #ifdef HAVE_TPETRA_INST_FLOAT
88 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosCudaWrapperNode)
89 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(
float,
int)
91 #ifdef HAVE_TPETRA_INST_DOUBLE
92 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosCudaWrapperNode)
93 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(
double,
int)
95 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
96 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosCudaWrapperNode)
97 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(Kokkos::complex<
float>,
int)
99 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
100 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosCudaWrapperNode)
101 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER_UVM_OFF(Kokkos::complex<
double>,
int)
103 #endif // KOKKOS_ENABLE_CUDA
105 #if defined(KOKKOS_ENABLE_HIP)
106 #ifdef HAVE_TPETRA_INST_FLOAT
107 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosHIPWrapperNode)
109 #ifdef HAVE_TPETRA_INST_DOUBLE
110 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosHIPWrapperNode)
112 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
113 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosHIPWrapperNode)
115 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
116 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosHIPWrapperNode)
118 #endif // KOKKOS_ENABLE_HIP
120 #if defined(KOKKOS_ENABLE_SYCL)
121 #ifdef HAVE_TPETRA_INST_FLOAT
122 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
float,
int, Tpetra::KokkosCompat::KokkosSYCLWrapperNode)
124 #ifdef HAVE_TPETRA_INST_DOUBLE
125 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(
double,
int, Tpetra::KokkosCompat::KokkosSYCLWrapperNode)
127 #ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
128 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<float>,
int, Tpetra::KokkosCompat::KokkosSYCLWrapperNode)
130 #ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
131 AMESOS2_KOKKOS_LOCAL_INSTANT_KOKKOS_ADAPTER(Kokkos::complex<double>,
int, Tpetra::KokkosCompat::KokkosSYCLWrapperNode)
133 #endif // KOKKOS_ENABLE_SYCL
135 #endif // AMESOS2_KOKKOS_IMPL_HPP
Amesos2::MultiVecAdapter specialization for the Kokkos::View class.