14 #include "Kokkos_Core.hpp"
18 template <
typename scalar,
typename device>
19 int mainHost(
bool test_flat,
bool test_orig,
bool test_deg,
bool test_lin,
20 bool test_block,
bool symmetric,
bool mkl);
22 template <
typename scalar>
23 int mainCuda(
bool test_flat,
bool test_orig,
bool test_lin,
24 bool test_block,
bool symmetric,
int device_id);
29 bool test_host =
true;
30 #ifdef KOKKOS_ENABLE_CUDA
31 bool test_cuda =
true;
34 bool test_block =
true;
35 bool test_flat =
true;
36 bool test_orig =
true;
37 bool test_deg =
false;
38 bool test_lin =
false;
39 bool symmetric =
true;
42 #ifdef KOKKOS_ENABLE_SERIAL
45 #ifdef KOKKOS_ENABLE_OPENMP
48 #ifdef KOKKOS_ENABLE_THREADS
53 bool print_usage =
false;
56 std::string s(argv[i]);
59 else if (s ==
"no-host")
61 #ifdef KOKKOS_ENABLE_CUDA
64 else if (s ==
"no-cuda")
66 else if (s ==
"device") {
68 device = std::atoi(argv[i]);
71 else if (s ==
"block")
73 else if (s ==
"no-block")
77 else if (s ==
"no-flat")
81 else if (s ==
"no-orig")
85 else if (s ==
"no-deg")
87 else if (s ==
"linear")
89 else if (s ==
"no-linear")
91 else if (s ==
"symmetric")
93 else if (s ==
"no-symmetric")
97 else if (s ==
"no-mkl")
99 else if (s ==
"single")
101 else if (s ==
"double")
103 #ifdef KOKKOS_ENABLE_SERIAL
104 else if (s ==
"serial")
106 else if (s ==
"no-serial")
109 #ifdef KOKKOS_ENABLE_OPENMP
112 else if (s ==
"no-omp")
115 #ifdef KOKKOS_ENABLE_THREADS
116 else if (s ==
"threads")
118 else if (s ==
"no-threads")
121 else if (s ==
"-h" || s ==
"--help")
124 std::cout <<
"Invalid argument: " << s << std::endl;
130 std::cout <<
"Usage:" << std::endl
132 <<
" [no-][cuda|host|serial|omp|threads|block|flat|orig|deg|linear|symmetric] [single|double] [device device_id]"
133 << std::endl <<
"Defaults are all enabled." << std::endl;
139 #ifdef KOKKOS_ENABLE_SERIAL
142 mainHost<float,Kokkos::Serial>(
143 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
145 mainHost<double,Kokkos::Serial>(
146 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
150 #ifdef KOKKOS_ENABLE_THREADS
153 mainHost<float,Kokkos::Threads>(
154 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
156 mainHost<double,Kokkos::Threads>(
157 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
161 #ifdef KOKKOS_ENABLE_OPENMP
164 mainHost<float,Kokkos::OpenMP>(
165 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
167 mainHost<double,Kokkos::OpenMP>(
168 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
174 #ifdef KOKKOS_ENABLE_CUDA
void mainHost(const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const int use_print, const int use_trials, const int use_nodes[], const bool check, Kokkos::Example::FENL::DeviceConfig dev_config)
void mainCuda(const Teuchos::RCP< const Teuchos::Comm< int > > &comm, const int use_print, const int use_trials, const int use_nodes[], const bool check, Kokkos::Example::FENL::DeviceConfig dev_config)
int main(int argc, char **argv)
template int mainCuda< double >(bool, bool, bool, bool, bool, int)
template int mainCuda< float >(bool, bool, bool, bool, bool, int)