44 #include "Kokkos_Core.hpp" 46 #ifdef KOKKOS_HAVE_PTHREAD 49 #ifdef KOKKOS_HAVE_OPENMP 57 template<
typename Scalar,
typename Device>
60 static void run(
bool test_flat,
bool test_orig,
bool test_deg,
bool test_lin,
61 bool test_block,
bool symmetric,
bool mkl) {
70 performance_test_driver_all<Scalar,Device>(
71 3 , 1 , 9 , nGrid , nIter , test_block , symmetric );
72 performance_test_driver_all<Scalar,Device>(
73 5 , 1 , 5 , nGrid , nIter , test_block , symmetric );
88 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
89 3 , 1 , 9 , nGrid , nIter , test_block , symmetric );
91 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
92 3 , 1 , 12 , nGrid , nIter , test_block , symmetric );
94 performance_test_driver_poly<Scalar,Device,Stokhos::DefaultMultiply>(
95 5 , 1, 6 , nGrid , nIter , test_block , symmetric );
106 performance_test_driver_poly_deg<Scalar,Device,Stokhos::DefaultMultiply>(
107 3 , 1 , 12 , nGrid , nIter , test_block , symmetric );
118 performance_test_driver_linear<Scalar,Device,Stokhos::DefaultMultiply>(
119 31 , 255 , 32 , nGrid , nIter , test_block , symmetric );
129 template <
typename Scalar,
typename Device>
130 int mainHost(
bool test_flat,
bool test_orig,
bool test_deg,
bool test_lin,
131 bool test_block,
bool symmetric,
bool mkl)
133 const size_t team_count =
134 Kokkos::hwloc::get_available_numa_count() *
135 Kokkos::hwloc::get_available_cores_per_numa();
136 const size_t threads_per_team =
137 Kokkos::hwloc::get_available_threads_per_core();
139 Device::initialize( team_count * threads_per_team );
141 std::string name =
"Host";
142 #ifdef KOKKOS_HAVE_PTHREAD 143 Kokkos::Threads::print_configuration( std::cout );
144 if (Kokkos::Impl::is_same<Device,Kokkos::Threads>::value)
147 #ifdef KOKKOS_HAVE_OPENMP 148 Kokkos::OpenMP::print_configuration( std::cout );
149 if (Kokkos::Impl::is_same<Device,Kokkos::OpenMP>::value)
152 std::cout << std::endl <<
"\"" << name <<
" Performance with " 153 << team_count * threads_per_team <<
" threads\"" << std::endl ;
156 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
163 #ifdef KOKKOS_HAVE_SERIAL 164 template int mainHost<float,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
165 template int mainHost<double,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
168 #ifdef KOKKOS_HAVE_PTHREAD 169 template int mainHost<float,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
170 template int mainHost<double,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
173 #ifdef KOKKOS_HAVE_OPENMP 174 template int mainHost<float,Kokkos::OpenMP>(bool, bool, bool, bool, bool, bool, bool);
175 template int mainHost<double,Kokkos::OpenMP>(bool, bool, bool, bool, bool, bool, bool);
int mainHost(bool test_flat, bool test_orig, bool test_deg, bool test_lin, bool test_block, bool symmetric, bool mkl)