24#ifndef MORPHEUS_DENSEVECTOR_SERIAL_REDUCTION_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_SERIAL_REDUCTION_IMPL_HPP
27#include <Morpheus_Macros.hpp>
28#if defined(MORPHEUS_ENABLE_SERIAL)
30#include <Morpheus_SpaceTraits.hpp>
31#include <Morpheus_FormatTraits.hpp>
32#include <Morpheus_FormatTags.hpp>
33#include <Morpheus_Spaces.hpp>
40template <
typename ExecSpace,
typename Vector>
41typename Vector::value_type reduce(
42 const Vector& in,
typename Vector::size_type size,
43 typename std::enable_if_t<
44 Morpheus::is_dense_vector_format_container_v<Vector> &&
45 Morpheus::has_custom_backend_v<ExecSpace> &&
46 Morpheus::has_serial_execution_space_v<ExecSpace> &&
47 Morpheus::has_access_v<ExecSpace, Vector>>* =
nullptr) {
48 using value_type =
typename Vector::value_type;
49 using size_type =
typename Vector::size_type;
50 value_type sum = in[0];
51 value_type c = (value_type)0.0;
53 for (size_type i = 1; i < size; i++) {
54 value_type y = in[i] - c;
55 value_type t = sum + y;
Generic Morpheus interfaces.
Definition: dummy.cpp:24