]> https://gitweb.dealii.org/ - dealii.git/commitdiff
backport to Kokkos 3.4.00
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 7 Dec 2022 23:45:30 +0000 (18:45 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 8 Dec 2022 22:13:15 +0000 (17:13 -0500)
cmake/modules/FindDEAL_II_KOKKOS.cmake
include/deal.II/lac/la_parallel_vector.templates.h
include/deal.II/lac/vector_operations_internal.h
source/lac/la_parallel_vector_cuda.cc
source/lac/read_write_vector.cc

index bbe1f4054dc84213f069d319ff77c035e8fe780c..c147281c0d83dfc060d214de22aa03fb658e8e5c 100644 (file)
@@ -32,7 +32,7 @@ if(DEAL_II_TRILINOS_WITH_KOKKOS)
   # Let deal.II know that we have found Kokkos
   set(KOKKOS_FOUND ON)
 else()
-  find_package(Kokkos 3.7.0 QUIET
+  find_package(Kokkos 3.0.0 QUIET
     HINTS ${KOKKOS_DIR} ${Kokkos_DIR} $ENV{Kokkos_DIR}
     )
 
index a07df612ab8b2b69ad443d4f85148516e8ee0ff1..b280f69f9e90bc029b86b492447485533d75dd16 100644 (file)
@@ -480,7 +480,12 @@ namespace LinearAlgebra
               ::dealii::MemorySpace::Device::kokkos_space::execution_space>(
               exec, 0, size),
             KOKKOS_LAMBDA(size_type i, RealType & update) {
-              update = Kokkos::max(update, Kokkos::abs(data.values(i)));
+#if KOKKOS_VERSION < 30700
+              update = Kokkos::Experimental::fmax(
+                update, Kokkos::Experimental::fabs(data.values(i)));
+#else
+              update = Kokkos::fmax(update, Kokkos::abs(data.values(i)));
+#endif
             },
             Kokkos::Max<RealType, Kokkos::HostSpace>(result));
         }
index 452e378ce0084f18112f1ebaccb244f51a20ab48..323ecb9705226c5f728bd71956f947d2c67aa4a8 100644 (file)
@@ -2529,7 +2529,11 @@ namespace internal
                                                                           0,
                                                                           size),
           KOKKOS_LAMBDA(size_type i, Number & update) {
-            update += Kokkos::abs(data.values(i));
+#if KOKKOS_VERSION < 30700
+            update += Kokkos::Experimental::fabs(data.values(i));
+#else
+            update += Kokkos::fabs(data.values(i));
+#endif
           },
           sum);
       }
@@ -2553,7 +2557,12 @@ namespace internal
                                                                           0,
                                                                           size),
           KOKKOS_LAMBDA(size_type i, Number & update) {
-            update += Kokkos::pow(Kokkos::abs(data.values(i)), exp);
+#if KOKKOS_VERSION < 30700
+            update += Kokkos::Experimental::pow(
+              Kokkos::Experimental::fabs(data.values(i)), exp);
+#else
+            update += Kokkos::pow(Kokkos::fabs(data.values(i)), exp);
+#endif
           },
           sum);
       }
index e4ebd6c6f51318305df4254ae38d6a9d1034adad..83599fa2a2a454a4a8211dfb9f29f56a4be8534c 100644 (file)
@@ -24,39 +24,39 @@ namespace LinearAlgebra
 {
   namespace distributed
   {
-    template class Vector<float, ::dealii::MemorySpace::CUDA>;
-    template class Vector<double, ::dealii::MemorySpace::CUDA>;
+    template class Vector<float, ::dealii::MemorySpace::Device>;
+    template class Vector<double, ::dealii::MemorySpace::Device>;
     template void
     Vector<float, ::dealii::MemorySpace::Host>::import<
-      ::dealii::MemorySpace::CUDA>(
-      const Vector<float, ::dealii::MemorySpace::CUDA> &,
+      ::dealii::MemorySpace::Device>(
+      const Vector<float, ::dealii::MemorySpace::Device> &,
       VectorOperation::values);
     template void
     Vector<double, ::dealii::MemorySpace::Host>::import<
-      ::dealii::MemorySpace::CUDA>(
-      const Vector<double, ::dealii::MemorySpace::CUDA> &,
+      ::dealii::MemorySpace::Device>(
+      const Vector<double, ::dealii::MemorySpace::Device> &,
       VectorOperation::values);
 
     template void
-    Vector<float, ::dealii::MemorySpace::CUDA>::import<
+    Vector<float, ::dealii::MemorySpace::Device>::import<
       ::dealii::MemorySpace::Host>(
       const Vector<float, ::dealii::MemorySpace::Host> &,
       VectorOperation::values);
     template void
-    Vector<double, ::dealii::MemorySpace::CUDA>::import<
+    Vector<double, ::dealii::MemorySpace::Device>::import<
       ::dealii::MemorySpace::Host>(
       const Vector<double, ::dealii::MemorySpace::Host> &,
       VectorOperation::values);
 
     template void
-    Vector<float, ::dealii::MemorySpace::CUDA>::import<
-      ::dealii::MemorySpace::CUDA>(
-      const Vector<float, ::dealii::MemorySpace::CUDA> &,
+    Vector<float, ::dealii::MemorySpace::Device>::import<
+      ::dealii::MemorySpace::Device>(
+      const Vector<float, ::dealii::MemorySpace::Device> &,
       VectorOperation::values);
     template void
-    Vector<double, ::dealii::MemorySpace::CUDA>::import<
-      ::dealii::MemorySpace::CUDA>(
-      const Vector<double, ::dealii::MemorySpace::CUDA> &,
+    Vector<double, ::dealii::MemorySpace::Device>::import<
+      ::dealii::MemorySpace::Device>(
+      const Vector<double, ::dealii::MemorySpace::Device> &,
       VectorOperation::values);
   } // namespace distributed
 } // namespace LinearAlgebra
index 3b77c05a6bfab9e5e214591cb2b0a7245c3a9e86..a6dc6febd2d640a7d22797542ae0fc66167cea56 100644 (file)
@@ -48,7 +48,7 @@ namespace LinearAlgebra
     const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
   template void
   ReadWriteVector<float>::import(
-    const distributed::Vector<float, ::dealii::MemorySpace::CUDA> &,
+    const distributed::Vector<float, ::dealii::MemorySpace::Device> &,
     VectorOperation::values,
     const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
 
@@ -59,7 +59,7 @@ namespace LinearAlgebra
     const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
   template void
   ReadWriteVector<double>::import(
-    const distributed::Vector<double, ::dealii::MemorySpace::CUDA> &,
+    const distributed::Vector<double, ::dealii::MemorySpace::Device> &,
     VectorOperation::values,
     const std::shared_ptr<const Utilities::MPI::CommunicationPatternBase> &);
 #  ifdef DEAL_II_WITH_COMPLEX_VALUES

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.