12 #include "Kokkos_Core.hpp"
14 #ifdef KOKKOS_ENABLE_THREADS
17 #ifdef KOKKOS_ENABLE_OPENMP
25 template<
typename Scalar,
typename Device>
28 static void run(
bool test_flat,
bool test_orig,
bool test_deg,
bool test_lin,
29 bool test_block,
bool symmetric,
bool mkl) {
38 performance_test_driver_all<Scalar,Device>(
39 3 , 1 , 9 , nGrid , nIter , test_block , symmetric );
40 performance_test_driver_all<Scalar,Device>(
41 5 , 1 , 5 , nGrid , nIter , test_block , symmetric );
56 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
57 3 , 1 , 9 , nGrid , nIter , test_block , symmetric );
59 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
60 3 , 1 , 12 , nGrid , nIter , test_block , symmetric );
62 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
63 5 , 1, 6 , nGrid , nIter , test_block , symmetric );
74 performance_test_driver_poly_deg<Scalar,Device,Stokhos::DefaultMultiply>(
75 3 , 1 , 12 , nGrid , nIter , test_block , symmetric );
86 performance_test_driver_linear<Scalar,Device,Stokhos::DefaultMultiply>(
87 31 , 255 , 32 , nGrid , nIter , test_block , symmetric );
97 template <
typename Scalar,
typename Device>
98 int mainHost(
bool test_flat,
bool test_orig,
bool test_deg,
bool test_lin,
99 bool test_block,
bool symmetric,
bool mkl)
101 const size_t team_count =
102 Kokkos::hwloc::get_available_numa_count() *
103 Kokkos::hwloc::get_available_cores_per_numa();
104 const size_t threads_per_team =
105 Kokkos::hwloc::get_available_threads_per_core();
107 Kokkos::InitializationSettings init_args;
108 init_args.set_num_threads(team_count*threads_per_team);
109 Kokkos::initialize( init_args );
111 std::string name =
"Host";
112 #ifdef KOKKOS_ENABLE_THREADS
113 Kokkos::Threads().print_configuration( std::cout );
114 if (std::is_same<Device,Kokkos::Threads>::value)
117 #ifdef KOKKOS_ENABLE_OPENMP
118 Kokkos::OpenMP().print_configuration( std::cout );
119 if (std::is_same<Device,Kokkos::OpenMP>::value)
122 std::cout << std::endl <<
"\"" << name <<
" Performance with "
123 << team_count * threads_per_team <<
" threads\"" << std::endl ;
126 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
133 #ifdef KOKKOS_ENABLE_SERIAL
134 template int mainHost<float,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
135 template int mainHost<double,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
138 #ifdef KOKKOS_ENABLE_THREADS
139 template int mainHost<float,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
140 template int mainHost<double,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
143 #ifdef KOKKOS_ENABLE_OPENMP
144 template int mainHost<float,Kokkos::OpenMP>(bool, bool, bool, bool, bool, bool, bool);
145 template int mainHost<double,Kokkos::OpenMP>(bool, bool, bool, bool, bool, bool, bool);
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)