From: Daniel Arndt Date: Thu, 9 Mar 2023 22:46:37 +0000 (-0500) Subject: Backport to Kokkos before 3.7.00 X-Git-Tag: v9.5.0-rc1~495^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae35947905973865bd06d1ae6bd8b547f89c588d;p=dealii.git Backport to Kokkos before 3.7.00 --- diff --git a/source/base/kokkos.cc b/source/base/kokkos.cc index 18f41861fa..d1e7742bc2 100644 --- a/source/base/kokkos.cc +++ b/source/base/kokkos.cc @@ -35,9 +35,13 @@ namespace internal // only execute once static bool dummy = [] { dealii_initialized_kokkos = true; +#if KOKKOS_VERSION >= 30700 const auto settings = Kokkos::InitializationSettings().set_num_threads( MultithreadInfo::n_threads()); +#else + const Kokkos::InitArguments settings(MultithreadInfo::n_threads()); +#endif Kokkos::initialize(settings); std::atexit(Kokkos::finalize); return true; diff --git a/source/base/mpi.cc b/source/base/mpi.cc index cd06ceaadd..0e0454697c 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -781,7 +781,11 @@ namespace Utilities for (int i = 0; i < argc; ++i) argv_new.push_back(argv[i]); std::stringstream threads_flag; +#if KOKKOS_VERSION >= 30700 + threads_flag << "--kokkos-num-threads=" << MultithreadInfo::n_threads(); +#else threads_flag << "--kokkos-threads=" << MultithreadInfo::n_threads(); +#endif argv_new.push_back(const_cast(threads_flag.str().c_str())); argv_new.push_back(nullptr); int argc_new = argc + 1;