-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathmain.cpp
40 lines (29 loc) · 960 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include <Kokkos_Core.hpp>
#include "kp_all.hpp"
#include "kernels.hpp"
#if USE_MPI
#include <mpi.h>
#endif
//-------------------------------------------------------------------------------------//
int main(int argc, char *argv[]) {
#if USE_MPI
MPI_Init(&argc, &argv);
#endif
const char *profiler_name = argc >= 2 ? argv[1] : "";
const char *profiler_config = argc >= 3 ? argv[2] : "";
auto eventSet = KokkosTools::get_event_set(profiler_name, profiler_config);
// Note: callbacks must be set before Kokkos::initialize()
Kokkos::Tools::Experimental::set_callbacks(eventSet);
Kokkos::initialize(argc, argv);
Kokkos::print_configuration(std::cout);
std::cout << std::endl;
int ret_code = run_calculation(100000);
std::cout << std::endl;
Kokkos::finalize();
#if USE_MPI
MPI_Finalize();
#endif
return ret_code;
}
//-------------------------------------------------------------------------------------//