24#ifndef MORPHEUS_DENSEVECTOR_KOKKOS_REDUCTION_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_KOKKOS_REDUCTION_IMPL_HPP
27#include <Morpheus_SpaceTraits.hpp>
28#include <Morpheus_FormatTraits.hpp>
29#include <Morpheus_FormatTags.hpp>
30#include <Morpheus_Spaces.hpp>
35template <
typename ExecSpace,
typename Vector>
36typename Vector::value_type reduce(
37 const Vector& in,
typename Vector::size_type size,
38 typename std::enable_if_t<
39 Morpheus::is_dense_vector_format_container_v<Vector> &&
40 Morpheus::has_generic_backend_v<ExecSpace> &&
41 Morpheus::has_access_v<ExecSpace, Vector>>* =
nullptr) {
42 using execution_space =
typename ExecSpace::execution_space;
43 using size_type =
typename Vector::size_type;
44 using IndexType = Kokkos::IndexType<size_type>;
45 using range_policy = Kokkos::RangePolicy<IndexType, execution_space>;
46 using ValueArray =
typename Vector::value_array_type;
47 using value_type =
typename Vector::non_const_value_type;
49 const ValueArray in_view = in.const_view();
50 range_policy policy(0, size);
52 value_type result = value_type(0);
53 Kokkos::parallel_reduce(
55 KOKKOS_LAMBDA(
const size_type& i, value_type& lsum) {
Generic Morpheus interfaces.
Definition: dummy.cpp:24