10#include <Kokkos_Core.hpp>
12#include "ddc/chunk_traits.hpp"
17
18
19
20
21template <
class ChunkDst,
class ChunkSrc>
24 static_assert(is_borrowed_chunk_v<ChunkDst>);
25 static_assert(is_borrowed_chunk_v<ChunkSrc>);
27 std::is_assignable_v<chunk_reference_t<ChunkDst>, chunk_reference_t<ChunkSrc>>,
29 assert(dst.domain().extents() == src.domain().extents());
30 Kokkos::deep_copy(dst.allocation_kokkos_view(), src.allocation_kokkos_view());
31 return dst.span_view();
35
36
37
38
39
40template <
class ExecSpace,
class ChunkDst,
class ChunkSrc>
41auto parallel_deepcopy(ExecSpace
const& execution_space, ChunkDst&& dst, ChunkSrc&& src)
43 static_assert(is_borrowed_chunk_v<ChunkDst>);
44 static_assert(is_borrowed_chunk_v<ChunkSrc>);
46 std::is_assignable_v<chunk_reference_t<ChunkDst>, chunk_reference_t<ChunkSrc>>,
48 assert(dst.domain().extents() == src.domain().extents());
49 Kokkos::deep_copy(execution_space, dst.allocation_kokkos_view(), src.allocation_kokkos_view());
50 return dst.span_view();
The top-level namespace of DDC.
auto parallel_deepcopy(ChunkDst &&dst, ChunkSrc &&src)
Copy the content of a borrowed chunk into another.
auto parallel_deepcopy(ExecSpace const &execution_space, ChunkDst &&dst, ChunkSrc &&src)
Copy the content of a borrowed chunk into another.