Skip to content

Commit

Permalink
#197: Support current Kokkos 3.6 and future optimization of mirror cr…
Browse files Browse the repository at this point in the history
…eation without initialization
  • Loading branch information
PhilMiller committed Jun 1, 2022
1 parent 4713e4e commit a62f384
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/checkpoint/container/view_serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
#include <Kokkos_Serial.hpp>
#include <Kokkos_DynRankView.hpp>

#if KOKKOS_VERSION > 30699L
#define CHECKPOINT_KOKKOS_WITHOUTINIT Kokkos::WithoutInitializing,
#else
#define CHECKPOINT_KOKKOS_WITHOUTINIT
#endif

#if KOKKOS_KERNELS_ENABLED
#include <Kokkos_StaticCrsGraph.hpp>
#include <KokkosSparse_CrsMatrix.hpp>
Expand Down Expand Up @@ -238,7 +244,7 @@ inline void serialize(

// Kokkos::deep_copy between DynamicView instances is not yet implemented
#if 0
auto host_view = Kokkos::create_mirror_view(Kokkos::WithoutInitializing, view);
auto host_view = Kokkos::create_mirror_view(CHECKPOINT_KOKKOS_WITHOUTINIT view);
if (s.isPacking()) {
deepCopyWithLocalFence(host_view, view);
}
Expand Down Expand Up @@ -351,7 +357,7 @@ inline void serialize_impl(SerializerT& s, Kokkos::DynRankView<T,Args...>& view)
s | init;

if (init) {
auto host_view = Kokkos::create_mirror_view(Kokkos::WithoutInitializing, view);
auto host_view = Kokkos::create_mirror_view(CHECKPOINT_KOKKOS_WITHOUTINIT view);
using HostViewType = decltype(host_view);

if (s.isPacking()) {
Expand Down

0 comments on commit a62f384

Please sign in to comment.