diff --git a/include/ddc/ddc_to_kokkos_execution_policy.hpp b/include/ddc/ddc_to_kokkos_execution_policy.hpp index 1138e7c4a..79dcef997 100644 --- a/include/ddc/ddc_to_kokkos_execution_policy.hpp +++ b/include/ddc/ddc_to_kokkos_execution_policy.hpp @@ -20,8 +20,7 @@ auto ddc_to_kokkos_execution_policy( ExecSpace const& execution_space, DiscreteDomain const& domain) { - using work_tag = std:: - conditional_t(), use_annotated_operator, void>; + using work_tag = void; using index_type = Kokkos::IndexType; if constexpr (sizeof...(DDims) == 0) { return Kokkos::RangePolicy(execution_space, 0, 1); diff --git a/include/ddc/detail/kokkos.hpp b/include/ddc/detail/kokkos.hpp index 2dce976bc..cfa3436d3 100644 --- a/include/ddc/detail/kokkos.hpp +++ b/include/ddc/detail/kokkos.hpp @@ -192,20 +192,4 @@ KOKKOS_FUNCTION auto build_mdspan( DDC_IF_NVCC_THEN_POP } -struct use_annotated_operator -{ -}; - -template -constexpr bool need_annotated_operator() noexcept -{ -#if defined(KOKKOS_ENABLE_CUDA) - return std::is_same_v; -#elif defined(KOKKOS_ENABLE_HIP) - return std::is_same_v; -#else - return false; -#endif -} - } // namespace ddc::detail diff --git a/include/ddc/parallel_for_each.hpp b/include/ddc/parallel_for_each.hpp index ba92881d6..ed68acca5 100644 --- a/include/ddc/parallel_for_each.hpp +++ b/include/ddc/parallel_for_each.hpp @@ -32,27 +32,13 @@ class ForEachKokkosLambdaAdapter explicit ForEachKokkosLambdaAdapter(F const& f) : m_f(f) {} template = true> - void operator()([[maybe_unused]] index_type unused_id) const + KOKKOS_FUNCTION void operator()([[maybe_unused]] index_type unused_id) const { m_f(DiscreteElement<>()); } - template = true> - KOKKOS_FUNCTION void operator()( - use_annotated_operator, - [[maybe_unused]] index_type unused_id) const - { - m_f(DiscreteElement<>()); - } - - template 0), bool> = true> - void operator()(index_type... ids) const - { - m_f(DiscreteElement(ids...)); - } - template 0), bool> = true> - KOKKOS_FUNCTION void operator()(use_annotated_operator, index_type... ids) const + KOKKOS_FUNCTION void operator()(index_type... ids) const { m_f(DiscreteElement(ids...)); } diff --git a/include/ddc/parallel_transform_reduce.hpp b/include/ddc/parallel_transform_reduce.hpp index 6c7343cd6..87c4b0744 100644 --- a/include/ddc/parallel_transform_reduce.hpp +++ b/include/ddc/parallel_transform_reduce.hpp @@ -103,16 +103,8 @@ class TransformReducerKokkosLambdaAdapter { } - template = true> - void operator()([[maybe_unused]] index_type unused_id, typename Reducer::value_type& a) - const - { - a = reducer(a, functor(DiscreteElement<>())); - } - template = true> KOKKOS_FUNCTION void operator()( - use_annotated_operator, [[maybe_unused]] index_type unused_id, typename Reducer::value_type& a) const @@ -121,17 +113,7 @@ class TransformReducerKokkosLambdaAdapter } template 0), bool> = true> - void operator()(index_type... ids, typename Reducer::value_type& a) const - { - a = reducer(a, functor(DiscreteElement(ids...))); - } - - - template 0), bool> = true> - KOKKOS_FUNCTION void operator()( - use_annotated_operator, - index_type... ids, - typename Reducer::value_type& a) const + KOKKOS_FUNCTION void operator()(index_type... ids, typename Reducer::value_type& a) const { a = reducer(a, functor(DiscreteElement(ids...))); }