9#include <Kokkos_Core.hpp>
11#include "ddc/chunk_traits.hpp"
16
17
18
19
20template <
class ChunkDst,
class T>
23 static_assert(is_borrowed_chunk_v<ChunkDst>);
24 static_assert(std::is_assignable_v<chunk_reference_t<ChunkDst>, T>,
"Not assignable");
25 Kokkos::deep_copy(dst.allocation_kokkos_view(), value);
26 return dst.span_view();
30
31
32
33
34
35template <
class ExecSpace,
class ChunkDst,
class T>
36auto parallel_fill(ExecSpace
const& execution_space, ChunkDst&& dst, T
const& value)
38 static_assert(is_borrowed_chunk_v<ChunkDst>);
39 static_assert(std::is_assignable_v<chunk_reference_t<ChunkDst>, T>,
"Not assignable");
40 Kokkos::deep_copy(execution_space, dst.allocation_kokkos_view(), value);
41 return dst.span_view();
The top-level namespace of DDC.
auto parallel_fill(ExecSpace const &execution_space, ChunkDst &&dst, T const &value)
Fill a borrowed chunk with a given value.
auto parallel_fill(ChunkDst &&dst, T const &value)
Fill a borrowed chunk with a given value.