10#include <Kokkos_Core.hpp>
12#include "discrete_vector.hpp"
14namespace ddc::detail {
16template <
class ExecSpace, std::size_t N>
17auto ddc_to_kokkos_execution_policy(
18 ExecSpace
const& execution_space,
19 std::array<DiscreteVectorElement, N>
const& size)
21 using work_tag =
void;
22 using index_type = Kokkos::IndexType<DiscreteVectorElement>;
23 if constexpr (N == 0) {
24 return Kokkos::RangePolicy<ExecSpace, work_tag, index_type>(execution_space, 0, 1);
26 if constexpr (N == 1) {
28 RangePolicy<ExecSpace, work_tag, index_type>(execution_space, 0, size[0]);
30 using iteration_pattern
31 = Kokkos::Rank<N, Kokkos::Iterate::Right, Kokkos::Iterate::Right>;
32 Kokkos::Array<DiscreteVectorElement, N>
const begin {};
33 Kokkos::Array<DiscreteVectorElement, N> end;
34 for (std::size_t i = 0; i < N; ++i) {
37 return Kokkos::MDRangePolicy<
41 index_type>(execution_space, begin, end);
The top-level namespace of DDC.