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

◆ broadcast

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>
}
constexpr auto broadcast
Computes the.
Definition broadcast.hpp:79
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107
EVE Main Namespace.
Definition abi.hpp:19

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"
std::cout << "\n";
std::cout << pi << "\n"
}