Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_KokkosViewUQPCEUnitTest_Threads.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
13 
15 
16 #include "Kokkos_Core.hpp"
17 
18 // Instantiate test for Threads device
19 using Kokkos::Threads;
20 VIEW_UQ_PCE_TESTS_DEVICE( Threads )
21 
22 int main( int argc, char* argv[] ) {
23  Teuchos::GlobalMPISession mpiSession(&argc, &argv);
24 
25  // Initialize threads
26  const size_t num_cores =
27  Kokkos::hwloc::get_available_numa_count() *
28  Kokkos::hwloc::get_available_cores_per_numa();
29  const size_t num_hyper_threads =
30  Kokkos::hwloc::get_available_threads_per_core();
31  // const size_t num_cores = 1;
32  // const size_t num_hyper_threads = 1;
33 
34  Kokkos::InitializationSettings init_args;
35  init_args.set_num_threads(num_cores*num_hyper_threads);
36  Kokkos::initialize( init_args );
37  Kokkos::print_configuration(std::cout);
38 
39  // Run tests
41 
42  // Finish up
43  Kokkos::finalize();
44 
45  return ret;
46 }
#define VIEW_UQ_PCE_TESTS_DEVICE(DEVICE)
static int runUnitTestsFromMain(int argc, char *argv[])
int main(int argc, char **argv)