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

Detailed Description

This module defines all the types and functions provided by EVE.

Contents

 Algorithms and Views
 SIMD versions of the standard range-based algorithms.
 Extensions points
 Macros, classes and functions designed to extend EVE externally.
 Functions
 Numerical function objects.
 SIMD related types
 SIMD related types.

Variables

constexpr auto eve::load = functor<load_t>
 Loads data from a pointer or a pair of iterators into a SIMD value.

Variable Documentation

◆ load

auto eve::load = functor<load_t>
inlineconstexpr

Loads data from a pointer or a pair of iterators into a SIMD value.

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overloads
template<_::data_source Ptr>
wide_value_type_t<Ptr> load(Ptr ptr) const noexcept; // 1
template<_::data_source Ptr, std::ptrdiff_t N>
as_wide_t<value_type_t<Ptr>, fixed<N>> load(Ptr ptr, fixed<N>) const noexcept; // 1
template<_::data_source Ptr, arithmetic_simd_value Wide>
requires std::same_as<value_type_t<Ptr>, element_type_t<Wide>>
Wide load(Ptr ptr, as<Wide> tgt) const noexcept; // 1
template<_::data_source Ptr, logical_simd_value Wide>
(sizeof(value_type_t<Ptr>) == sizeof(element_type_t<Wide>))
Wide load(Ptr ptr, as<Wide> tgt) const noexcept; // 1
// Conditional overloads
auto load[relative_conditional_expr c](/* any non-iterator version of the above overloads */) const noexcept; // 2
// Semantic options
auto load[unsafe](/* any non-iterator version of the above overloads */) const noexcept; // 3
}
Specifies that a type is a Conditional Expression using relative mask.
Definition conditional.hpp:52
constexpr auto load
Loads data from a pointer or a pair of iterators into a SIMD value.
Definition load.hpp:71
as_wide_t< value_type_t< T >, iterator_cardinal_t< T > > wide_value_type_t
Definition wide_value_type.hpp:33
typename decltype(_::value_type_impl< T >())::type value_type_t
A meta function for getting an associated value_type for a relaxed iterator/range.
Definition value_type.hpp:66
EVE Main Namespace.
Definition abi.hpp:19
Lightweight type-wrapper.
Definition as.hpp:29
SIMD register cardinal type.
Definition cardinals.hpp:39

Parameters

Return value

  1. A SIMD value containing the element referenced by the data source or the iterators.
  2. Same as 1., but elements whose corresponding condition mask lane evaluates to false are left undefined.
  3. Same as 1., but uses as scalar version of the operation if a sanitizer is enabled.
Note
  1. and 3. may be sub-optimal for non-contiguous iterators.

Example

#include <eve/eve.hpp>
#include <iostream>
#include <vector>
#include <list>
int main()
{
std::array<double, 16> doubles = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 16.0f};
std::cout << eve::load(doubles.data() + 3) << "\n";
std::vector<float> vec = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
std::cout << eve::load(vec.data(), eve::as<eve::wide<float, eve::fixed<4>>>{}) << "\n";
std::list<float> lst = {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f};
std::cout << eve::load(lst.begin(), eve::lane<8>) << "\n";
int arr[8] = {2, 4, 6, 8, 10, 12, 14, 16};
std::cout << eve::load[eve::keep_between(2, 5).else_(-99)](arr, eve::lane<8>) << "\n";
}
Conditional expression keeping all lanes between two position.
Definition conditional.hpp:593
constexpr auto else_(V const &v) const
Extends a conditional expression with an alternative value.
Definition conditional.hpp:565
Wrapper for SIMD registers.
Definition wide.hpp:94