From: Daniel Arndt Date: Thu, 8 Dec 2022 14:17:51 +0000 (-0500) Subject: Backport for Kokkos 3.0 X-Git-Tag: v9.5.0-rc1~697^2~17 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c59ea65bae36388085aded1370ac47344bf446c4;p=dealii.git Backport for Kokkos 3.0 --- diff --git a/cmake/modules/FindDEAL_II_KOKKOS.cmake b/cmake/modules/FindDEAL_II_KOKKOS.cmake index c147281c0d..bbe1f4054d 100644 --- a/cmake/modules/FindDEAL_II_KOKKOS.cmake +++ b/cmake/modules/FindDEAL_II_KOKKOS.cmake @@ -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.0.0 QUIET + find_package(Kokkos 3.7.0 QUIET HINTS ${KOKKOS_DIR} ${Kokkos_DIR} $ENV{Kokkos_DIR} ) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index b280f69f9e..0733230f52 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -480,7 +480,9 @@ namespace LinearAlgebra ::dealii::MemorySpace::Device::kokkos_space::execution_space>( exec, 0, size), KOKKOS_LAMBDA(size_type i, RealType & update) { -#if KOKKOS_VERSION < 30700 +#if KOKKOS_VERSION < 30400 + update = fmax(update, fabs(data.values(i))); +#elif KOKKOS_VERSION < 30700 update = Kokkos::Experimental::fmax( update, Kokkos::Experimental::fabs(data.values(i))); #else diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index 323ecb9705..4f2a2b475a 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -2529,7 +2529,9 @@ namespace internal 0, size), KOKKOS_LAMBDA(size_type i, Number & update) { -#if KOKKOS_VERSION < 30700 +#if KOKKOS_VERSION < 30400 + update += fabs(data.values(i)); +#elif KOKKOS_VERSION < 30700 update += Kokkos::Experimental::fabs(data.values(i)); #else update += Kokkos::fabs(data.values(i)); @@ -2557,7 +2559,9 @@ namespace internal 0, size), KOKKOS_LAMBDA(size_type i, Number & update) { -#if KOKKOS_VERSION < 30700 +#if KOKKOS_VERSION < 30400 + update += pow(fabs(data.values(i)), exp); +#elif KOKKOS_VERSION < 30700 update += Kokkos::Experimental::pow( Kokkos::Experimental::fabs(data.values(i)), exp); #else