8template<
typename Context>
10 std::same_as<Context, float> or
11 std::same_as<Context.
double> or
12 std::same_as<Context. std::span<float>> or
13 std::same_as<Context. std::span<double>> or
14 std::same_as<Context. std::span<float const>> or
15 std::same_as<Context. std::span<double const>>;
17template<
typename T,
typename Op>
18void dsp_visit(std::span<T> r, std::span<T const> a, std::span<T const> b, Op op)
noexcept
23 using S = fast_simd<T>;
24 constexpr auto stride = S::size;
27 auto wide_size = (size / stride) * stride;
33 hilet a_wide_end = a.data() + wide_size;
34 while (a_ != a_wide_end) {
35 op(S{a_}, S{b_}).store(r_);
42 hilet a_end = a_ptr + size;
44 *r_++ = op(*a_++, *b_++);
48template<
typename T,
typename Op>
49void dsp_visit(std::span<T> r, std::span<T const> a, T b, Op op)
noexcept
53 using S = fast_simd<T>;
54 constexpr auto stride = S::size;
57 auto wide_size = (size / stride) * stride;
62 hilet b_wide = S::broadcast(b);
63 hilet a_wide_end = a.data() + wide_size;
64 while (a_ != a_wide_end) {
65 op(S{a_}, b_wide).store(r_);
71 hilet a_end = a_ptr + size;
77template<
typename T,
typename Op>
78void dsp_visit(std::span<float> r,
float a, Op op)
noexcept
80 using S = fast_simd<float>;
81 constexpr auto stride = S::size;
83 hilet size = r.size();
84 hilet wide_size = (size / stride) * stride;
87 hilet a_ = S::broadcast(b);
89 hilet r_wide_end = r.data() + wide_size;
90 while (r_ != r_wide_end) {
91 op(S{r_} + a_wide).store(r_);
96 hilet r_end = r_ + size;
102void dsp_add(dsp_argument
auto... args)
noexcept
104 return dsp_operator(args..., [](
auto a,
auto b) { return a + b; });
107void dsp_sub(dsp-argument
auto... args)
noexcept
109 return dsp_operator(args..., [](
auto a,
auto b) { return a - b; });
112void dsp_mul(dsp-argument
auto... args)
noexcept
114 return dsp_operator(args..., [](
auto a,
auto b) { return a * b; });
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:238
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
Definition dsp_float.hpp:9