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

◆ gather

eve::gather = functor<gather_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<arithmetic_value T, integral_value U>
as_wide_as_t<T, U> gather(T const* ptr, U idx) noexcept;
template<arithmetic_value T, integral_value U, typename N>
}
constexpr auto gather
Load a SIMD value with values selected from a memory region at the given offsets.
Definition gather.hpp:78
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

  • idx: An instance of an integral value.
  • ptr: A pointer to the memory region to load from.

Return value

Example

#include <iostream>
#include <eve/module/core.hpp>
int main()
{
std::vector<int> v{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
eve::wide<int, eve::fixed<4>> res = eve::gather(v.data(), eve::wide<unsigned char, eve::fixed<4>>{0, 2, 2, 11});
std::cout << "res -> " << res << std::endl;
}
Wrapper for SIMD registers.
Definition wide.hpp:94