24#ifndef MORPHEUS_DENSEVECTOR_SERIAL_WAXPBY_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_SERIAL_WAXPBY_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>
39template <
typename ExecSpace,
typename Vector1,
typename Vector2,
42 const typename Vector1::size_type n,
43 const typename Vector1::value_type alpha,
const Vector1& x,
44 const typename Vector2::value_type beta,
const Vector2& y, Vector3& w,
45 typename std::enable_if_t<
46 Morpheus::is_dense_vector_format_container_v<Vector1> &&
47 Morpheus::is_dense_vector_format_container_v<Vector2> &&
48 Morpheus::is_dense_vector_format_container_v<Vector3> &&
49 Morpheus::has_custom_backend_v<ExecSpace> &&
50 Morpheus::has_serial_execution_space_v<ExecSpace> &&
51 Morpheus::has_access_v<ExecSpace, Vector1, Vector2, Vector3>>* =
53 using size_type =
typename Vector1::size_type;
55 assert(x.size() >= n);
56 assert(y.size() >= n);
57 assert(w.size() >= n);
60 for (size_type i = 0; i < n; i++) w[i] = x[i] + beta * y[i];
61 }
else if (beta == 1.0) {
62 for (size_type i = 0; i < n; i++) w[i] = alpha * x[i] + y[i];
64 for (size_type i = 0; i < n; i++) w[i] = alpha * x[i] + beta * y[i];
Generic Morpheus interfaces.
Definition: dummy.cpp:24