Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_KokkosArrayKernelsUnitTest_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 
10 // Utilities
14 
15 // Device
16 #include "Kokkos_Core.hpp"
17 
18 // Kernels
20 
21 // Tests
23 
24 using namespace KokkosKernelsUnitTest;
25 
27 
28 // Test declarations
31 
32 // Tests using Threads device
33 using Kokkos::Threads;
34 UNIT_TEST_GROUP_SCALAR_DEVICE( double, Threads )
35 UNIT_TEST_GROUP_SCALAR_HOST_DEVICE( double, Threads )
36 
37 int main( int argc, char* argv[] ) {
38  Teuchos::GlobalMPISession mpiSession(&argc, &argv);
39 
40  const size_t team_count =
41  Kokkos::hwloc::get_available_numa_count() *
42  Kokkos::hwloc::get_available_cores_per_numa();
43  const size_t threads_per_team =
44  Kokkos::hwloc::get_available_threads_per_core();
45 
46  // Initialize threads
47  Kokkos::InitializationSettings init_args;
48  init_args.set_num_threads(team_count*threads_per_team);
49  init_args.set_device_id(0);
50  Kokkos::initialize( init_args );
51  Kokkos::print_configuration( std::cout );
52 
53  // Setup (has to happen after initialization)
54  setup.setup();
55 
56  // Run tests
58 
59  // Finish up
60  Kokkos::finalize();
61 
62  return ret;
63 }
static int runUnitTestsFromMain(int argc, char *argv[])
#define UNIT_TEST_GROUP_SCALAR_HOST_DEVICE(SCALAR, DEVICE)
int main(int argc, char **argv)
#define UNIT_TEST_GROUP_SCALAR_DEVICE(SCALAR, DEVICE)