E.V.E
v2023.02.15
Loading...
Searching...
No Matches
◆
gather
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
)
noexcept
;
template
<arithmetic_value T,
int
egral_value U,
typename
N>
as_wide_as_t<T, U>
gather
(
aligned_ptr<T, N>
ptr,
U
idx
)
noexcept
;
}
eve::gather
constexpr auto gather
Load a SIMD value with values selected from a memory region at the given offsets.
Definition
gather.hpp:78
eve::translate_t
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition
translation.hpp:107
eve
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
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
<
unsigned
char
,
eve::fixed<4>
>{0, 2, 2, 11});
std::cout <<
"res -> "
<< res << std::endl;
}
eve::wide
Wrapper for SIMD registers.
Definition
wide.hpp:94
eve