E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
gather
auto eve::gather =
functor
<gather_t>
inline
constexpr
Header file
#include <eve/module/core.hpp>
Callable Signatures
namespace
eve
{
template
<arithmetic_value T,
int
egral_value U>
as_wide_as_t<T, U>
gather
(T
const
* ptr, U idx);
template
<arithmetic_value T,
int
egral_value U,
typename
N>
auto
gather
(
aligned_ptr<T, N>
ptr, U idx);
}
eve::gather
constexpr auto gather
Load a SIMD value with values selected from a memory region at the given offsets.
Definition
gather.hpp:74
eve
EVE Main Namespace.
Definition
abi.hpp:18
eve::aligned_ptr
Wrapper for non-owning aligned pointers.
Definition
aligned_ptr.hpp:50
Parameters
idx
: An instance of an
integral value
.
ptr
: A pointer to the memory region to load from.
Return value
A
value
equivalent to:
as_wide_as_t<T, U> res = { ptr[idx[0]], ptr[idx[1]], ..., ptr[idx[N-1]] };
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
<
char
,
eve::fixed<4>
>{0, 2, 2, 11});
std::cout <<
"res -> "
<< res << std::endl;
}
eve::fixed
SIMD register cardinal type.
Definition
cardinal.hpp:15
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:93
eve