43 #include "Teuchos_GlobalMPISession.hpp"
44 #include "Kokkos_Core.hpp"
55 if (! Kokkos::is_initialized ()) {
56 std::vector<std::string> args = Teuchos::GlobalMPISession::getArgv ();
57 int narg =
static_cast<int> (args.size ());
59 std::vector<char*> args_c (narg);
60 for (
int k = 0; k < narg; ++k) {
64 args_c[k] =
const_cast<char*
> (args[k].c_str ());
66 Kokkos::initialize (narg, narg == 0 ?
nullptr : args_c.data ());
67 std::atexit (Kokkos::finalize_all);
Declaration of Tpetra::Details::initializeKokkos.
void initializeKokkos()
Initialize Kokkos, using command-line arguments (if any) given to Teuchos::GlobalMPISession.