E.V.E
v2023.02.15

◆ broadcast

eve::broadcast = {}
inlineconstexpr

Computes the.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T broadcast(T x) noexcept;
}
constexpr callable_broadcast_ broadcast
Computes the.
Definition: broadcast.hpp:56
Definition: abi.hpp:18

Parameters

  • x: An instance of an SIMD value
  • i: An eve::index indicating which lane of x to broadcast

Return value

  • If x is an instance of an SIMD value T, the call is equivalent to T{x.get(I)}.
  • If x is an instance of a scalar value the call simply returns x

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {1.2f,0.34f,0.056f,0.0078f};
wide_it pi = {-1, 2,-3, 4,-5, 6,-7, 8};
std::cout << pf << "\n"
<< eve::broadcast(pf, eve::index<3> ) << "\n";
std::cout << "\n";
std::cout << pi << "\n"
<< eve::broadcast(pi, eve::index<5> ) << "\n";
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65