E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ broadcast

auto eve::broadcast = functor<broadcast_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::scalar_value T> eve::as_wide_t<T> broadcast(T v) noexcept; // 1
template<eve::scalar_value T, std::ptrdiff_t N> as_wide_t<T> broadcast(T v, fixed<N> sz) noexcept; // 2
template<eve::simd_value T, std::size_t I> T broadcast(T v, index_t<I> i) noexcept; // 3
template<eve::simd_value T, std::size_t I, std::ptrdiff_t N>
eve::as_wide_t<T,fixed<N>> broadcast(T v, index_t<I> i, fixed<N> sz) noexcept; // 4
}
constexpr auto broadcast
Computes the.
Definition broadcast.hpp:79
EVE Main Namespace.
Definition abi.hpp:18
SIMD register cardinal type.
Definition cardinal.hpp:15

Parameters

  • v: A value.
  • i: An eve::index instance indicating which lane of x to broadcast.
  • sz: An eve::lane instance indicating how many lanes to broadcast to.

Return value

  1. A SIMD value equals to eve::as_wide_t<T>{v}.
  2. A SIMD value equals to eve::as_wide_t<T,eve::fixed<N>>{v}.
  3. A SIMD value equals to T{v.get(I)}.
  4. A SIMD value equals to eve::as_wide_t<T,eve::fixed<N>>{v.get(I)}.

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 << eve::broadcast( 7.6 ) << "\n";
std::cout << eve::broadcast(7.6, eve::lane<8> ) << "\n";
std::cout << "\n";
std::cout << pf << "\n"
<< eve::broadcast(pf, eve::index<3> ) << "\n";
std::cout << "\n";
std::cout << pi << "\n"
<< eve::broadcast(pi, eve::index<5>, eve::lane<4> ) << "\n";
}
constexpr auto pi
Callable object computing the constant .
Definition pi.hpp:77
Wrapper for SIMD registers.
Definition wide.hpp:70