]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Backport to Kokkos before 3.7.00
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 9 Mar 2023 22:46:37 +0000 (17:46 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 9 Mar 2023 22:52:39 +0000 (17:52 -0500)
source/base/kokkos.cc
source/base/mpi.cc

index 18f41861fab2667e329b17b981d6a120d4f3e2dd..d1e7742bc22a7eb27ffb94b96dffa89c28890795 100644 (file)
@@ -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;
index cd06ceaadd81575296203b6676f078dc3b884412..0e0454697cb7ae1e529499f522e9f4873e7aafbd 100644 (file)
@@ -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<char *>(threads_flag.str().c_str()));
         argv_new.push_back(nullptr);
         int argc_new = argc + 1;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.