10#include <Kokkos_Core.hpp>
12#include "detail/kokkos.hpp"
14#include "discrete_domain.hpp"
15#include "discrete_element.hpp"
17namespace ddc::detail {
19template <
class ExecSpace,
class Support>
20auto ddc_to_kokkos_execution_policy(ExecSpace
const& execution_space, Support
const& domain)
22 using work_tag =
void;
23 using index_type = Kokkos::IndexType<DiscreteElementType>;
24 if constexpr (Support::rank() == 0) {
25 return Kokkos::RangePolicy<ExecSpace, work_tag, index_type>(execution_space, 0, 1);
27 if constexpr (Support::rank() == 1) {
28 return Kokkos::RangePolicy<
31 index_type>(execution_space, 0, domain.extents().value());
33 using iteration_pattern
34 = Kokkos::Rank<Support::rank(), Kokkos::Iterate::Right, Kokkos::Iterate::Right>;
35 Kokkos::Array<std::size_t, Support::rank()>
const begin {};
36 std::array
const end = detail::array(domain.extents());
37 Kokkos::Array<std::size_t, Support::rank()> end2;
38 for (
int i = 0; i < Support::rank(); ++i) {
41 return Kokkos::MDRangePolicy<
45 index_type>(execution_space, begin, end2);
The top-level namespace of DDC.