44 #include "Kokkos_Core.hpp" 46 #ifdef KOKKOS_ENABLE_THREADS 49 #ifdef KOKKOS_ENABLE_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 Kokkos::InitArguments init_args;
140 init_args.num_threads = team_count*threads_per_team;
141 Kokkos::initialize( init_args );
143 std::string name =
"Host";
144 #ifdef KOKKOS_ENABLE_THREADS 145 Kokkos::Threads::print_configuration( std::cout );
146 if (Kokkos::Impl::is_same<Device,Kokkos::Threads>::value)
149 #ifdef KOKKOS_ENABLE_OPENMP 150 Kokkos::OpenMP::print_configuration( std::cout );
151 if (Kokkos::Impl::is_same<Device,Kokkos::OpenMP>::value)
154 std::cout << std::endl <<
"\"" << name <<
" Performance with " 155 << team_count * threads_per_team <<
" threads\"" << std::endl ;
158 test_flat, test_orig, test_deg, test_lin, test_block, symmetric, mkl);
165 #ifdef KOKKOS_ENABLE_SERIAL 166 template int mainHost<float,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
167 template int mainHost<double,Kokkos::Serial>(bool, bool, bool, bool, bool, bool, bool);
170 #ifdef KOKKOS_ENABLE_THREADS 171 template int mainHost<float,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
172 template int mainHost<double,Kokkos::Threads>(bool, bool, bool, bool, bool, bool, bool);
175 #ifdef KOKKOS_ENABLE_OPENMP 176 template int mainHost<float,Kokkos::OpenMP>(bool, bool, bool, bool, bool, bool, bool);
177 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)