diff --git a/algo_rationale.html b/algo_rationale.html index 30e0d82844..ddb12e6443 100644 --- a/algo_rationale.html +++ b/algo_rationale.html @@ -125,7 +125,7 @@

-

+

General Principles

SIMD algorithms are complex to design, implement and tests as a lot of care has to be put into details like correct tail handling, alignment handling or unrolling.

EVE's algorithms and views module is designed to simplify such design while:

@@ -137,24 +137,24 @@

All those features are usable through generic interfaces to allow for reuse of similar loops structure at the cost of some idiosyncrasies.

For a in-depth discussion about those issues, you can take a look at the Algorithms section of our CppCon talk.

-

+

Basic Components

-

+

Reusable loops

Many algorithms require some form of while(f != l) loop. However, with SIMD, even this simple operation is non trivial. EVE algorithm building-blocks provide implementation for the most frequent loop structure. Those loops can then customized and reused without having to care about the actual range type used. For example, eve::mismatch is implemented as a customized call to eve::find.

-

+

Ranges or Iterators

-

+

General concepts

Iterators are more fundamental than ranges. However, ranges can have some extra information like, for example, that instead of begin() it has aligned_begin() and the algorithm can use that. So the interfaces are range based. We don't generally accept iterator in interfaces just because it increases the maintenance. The eve::algo::as_range can be used to turn iterators pair into a EVE compatible range.

One case where it can be very awkward to use ranges instead of iterators is in multi-range algorithms , like transform_to. In this case, unless we have some reason no to, we allow for passing anything that zips to range, i.e. range, iterator or iterator,range. Exceptions are documented and have static_asserts that will tell you it's not supported.

-

+

Relaxed concepts

Many things that we want to accept in the interfaces as range and/or iterator are not ideal for writing code against. We also need to strip things like vector::iterator to pointers. What also we want is to associate a cardinal with iterator.

This is why we have two layers: relaxed_range/relaxed_iterator and iterator. There are a few things that relaxed_* should be able to do but the main one is preprocess_range(traits, f, l) which returns enhanced traits and iterator pair.

-

+

Customization

-

+

Algorithms traits

EVE allows to customize algorithms with traits. Traits are passed via [] and can be combined.

The more common ones are:

diff --git a/changelog.html b/changelog.html index a5638d0343..0162478e05 100644 --- a/changelog.html +++ b/changelog.html @@ -125,24 +125,24 @@

-

+

Version 2023.02.15

Codename: Perdita Quiescent

-

+

What's Changed

-

+

Removal and Depreciation

  • The proba module as been removed. (See #1490) It will be reworked as a separate project later on with a proper API.
-

+

Architectures/Compilers Support & Fixes

-

+

The One Big News for this release: SVE

  • SVE with fixed size, power of 2 cardinal is now supported for most of our API. Some more optimizations are on the way but the support is functional. (See #1432, #1435, #1436, #1437, #1438, #1448, #1453, #1455, #1456, #1463, #1464, #1472, #1473, #1474,#1487, #1489, #1491, #1494, #1533, #1556)
-

+

Other Fixes

  • EVE now compiles on ARM M1 with Homebrew g++. (See #1471)
  • @@ -152,7 +152,7 @@

  • Integral sign/signnz functions are now more efficient on x86 (See #1499)
  • Implementation for X86 AVX2/AVX512 gather and masked gather are now optimized. (See #1526)
-

+

Features

  • jtlap implemented a large amount of new functions for eve::complex.
  • @@ -161,7 +161,7 @@

  • The minmax function is now available. (See #1507)
  • DenisYaroshevskiy implemented new traits for algorithms to take care of costly kernels, no alignment and to support fused operations. (See #1535, #1543)
-

+

Bug Fixes

  • Convert is now more efficient and don't generate piecewise evaluation in some scenario involving logicals. (See #1447, #1428)
  • @@ -171,15 +171,15 @@

  • Fix issue with dynamic SIMD extension detection that were broken by accident. (See #1504)

Full Changelog: https://github.com/jfalcou/eve/compare/v2022.09.1...2023.02.15

-

+

Version 2022.09.1

Codename: Rosalind Serendipitous

This is a patch release that fix some issue with the versioning of EVE installation and some documentation issue.

Full Changelog: https://github.com/jfalcou/eve/compare/v2022.09.0...2022.09.1

-

+

Version 2022.09.0

Codename: Rosalind Serendipitous

-

+

What's Changed

A lot. The main non-code changes is our move from MIT License to the BOOST SOFTWARE License. Next to that, support for more algorithms and complex numbers has been added.

Starting this fall, we will also try to provide more regular release.

@@ -242,17 +242,17 @@

-

+

New Contributors

Thanks to all our new contributor for this release!

  • Simran-B made their first contribution in (See #1303)
  • justend29 made their first contribution in (See #1338)
-

+

Version 2022.03.0

Codename: Miranda Numinous

-

+

What's Changed

This release is an API/ABI breaking changes release.

A lot of improvements in QoL, QoI, and API have been made. Some more breaking ABI changes are planned, including a passive move toward an include file layout more amenable to future modularization.

@@ -345,7 +345,7 @@

-

+

New Contributors

Thanks to all our new contributor for this release!

-

+

Version 2021.10.0

Codename: Titania Unleashed

-

+

What's Changed

  • First tagged release for EVE which includes:
      @@ -370,7 +370,7 @@

-

+

Version beta.2020.09

Initial beta release

diff --git a/conditional.html b/conditional.html index 0c02e77d5a..c0703e2d61 100644 --- a/conditional.html +++ b/conditional.html @@ -126,7 +126,7 @@

When you call a function on one or more SIMD values, you expect the computation to be performed on every elements of its parameters. Sometimes, you may want to make the application of a given function dependent on some condition.

Let's explore the functionalities EVE provides for achieving those results.

-

+

Explicit Selection

Let's say the function we want to write computes the product of two values a and b if a is equal to b and their difference otherwise.

The scalar code is looking like:

@@ -164,7 +164,7 @@

  • the value to use whenever an element of said condition evaluates to false, here the difference of a and b
  • Warning
    Contrary to a if ... else statement, eve::if_else will evaluates all its arguments before performing its selection even if potential short-cut can be applied later on.
    -

    +

    Conditional Function Syntax

    Let's define a sqrt_positive function that computes the square root of its argument if it's positive or returns it unchanged otherwise. One can write:

    #include <eve/module/core.hpp>
    @@ -221,10 +221,10 @@

    auto const f = eve::sqrt[a >= 0];
    return f(a);
    }
    -

    +

    Conditional Expressions

    If passing a simple logical expression is the most common use-case of the conditional syntax, one may requires more flexibility. To do so, EVE provides various objects to express more elaborated conditions.

    -

    +

    Mask with alternative

    One may want to use the conditional syntax to call a function but instead of returning the first argument if the condition is false, one may want to return an arbitrary value. This use case is handled by the eve::if_ helper by wrapping logical expression so that an alternative value can be specified.

    Let's modify sqrt_positive so that, if the argument is not positive, 0 is returned instead.

    @@ -253,7 +253,7 @@

    }
    auto else_(V const &v) const
    Extends a conditional expression with an alternative value.
    Definition: conditional.hpp:111
    Extensible wrapper for SIMD conditional.
    Definition: conditional.hpp:99
    -

    +

    Context-sensitive mask

    Some algorithms require conditional function calls but use logical expression relative to the element index inside a eve::simd_value rather than its value. One may want for example to not compute an expression on the first and last element of such eve::simd_value.

    A frequent example is trying to load data from memory while ignoring trailing garbage or out of bounds values:

    @@ -320,7 +320,7 @@

    std::cout << load_between(&data[0] - 1) << "\n";
    }

    The output is obviously the same.

    -

    +

    Conclusion

    Conditional operations on SIMD values is a good way to keep a high level code over some complex computations. EVE provides different levels of abstraction for such operations as well as various helpers to specify how the conditions can be computed based either on values or indexes.

    diff --git a/dev_cmake.html b/dev_cmake.html index a4ec637c61..00f49a61cb 100644 --- a/dev_cmake.html +++ b/dev_cmake.html @@ -126,7 +126,7 @@

    From now on, we make the assumption your Docker instance is running and that you're logged into its interactive shell as per the protocol previously defined. In this tutorial, we will go over the process to configure the tests and run them properly.

    -

    +

    CMake setup

    First, you'd need to create a build directory and cd into it

    mkdir build_arch && cd build_arch
    @@ -167,7 +167,7 @@ 

    Arm (sve-512) cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain/gcc.sve512.cmake

    Once run, your build folder should contain all the necessary artifact to compile and run EVE test suite.

    -

    +

    Compiling EVE Unit Tests

    EVE provides a large number of test targets that are grouped by theme. Each of these themes and tests with a theme can be compiled with a proper target.

    In term of options, we encourage you to use the -DEVE_NO_FORCEINLINE macro that prevents costly optimization to be used during the compilation of tests.

    @@ -223,7 +223,7 @@

    Once compiled, the test executable are located in the unit folder and can be run via:

    ./unit/unit.core.abs.exe
     

    The unit.exe target is very large and requires a comfortable amount of CPUs to be compiled in parallel.

    -

    +

    Compiling EVE Random Tests

    Random tests run a given function over a samples of random values to test its relative precision. The following table list the main high-level random target.

    diff --git a/glossary_semantic.html b/glossary_semantic.html index 5d257335e3..5d210c34f6 100644 --- a/glossary_semantic.html +++ b/glossary_semantic.html @@ -126,14 +126,14 @@

    EVE provides a lot of function that operates on similar premises. This page gather the general behaviors EVE types and functions can exhibit.

    -

    +

    Property of EVE types

    -

    +

    Cardinal

    For any value type, the cardinal is the number of elements it contains. This information is retrieved via the eve::cardinal type trait.

    For any SIMD type T, eve::cardinal<T>::type evaluates to eve::fixed<N>, where N is the number of lanes of the underlying SIMD register.

    Two types are said to be cardinal compatible if they have the same cardinal or at least one of them is a scalar type.

    -

    +

    Element type

    For any value type, its underlying element type is the type used to represent its internal values. This information is retrieved via the eve::element_type type trait.

    -

    +

    ABI traits

    SIMD type internals depend on the actual architecture and instruction set available. This information is retrieved via the eve::abi_of type trait.

      @@ -150,9 +150,9 @@

    • When the type uses an emulated SIMD register, the resulting type is eve::emulated_.
    • When the type elements are tuple-like, the resulting type is eve::bundle_.
    -

    +

    Operations Classification

    -

    +

    Generalized Element Access

    EVE functions' semantics rely on a generic way to access an element of a value, be it scalar or SIMD.

    To do so, we define a synthetic function get(v,i) that retrieve the ith element of a value v.

    @@ -176,7 +176,7 @@

    For any SIMD value x of type T, a Callable Object f returning a scalar value of type R is said to be a Reduction if the expression R r = f(x) is semantically equivalent to:

    R r = f(get(x,0), ..., get(x,cardinal_v<T>-1));

    Most reduction operations are not defined on scalar values unless their definition is required by the internal implementation.

    -

    +

    Function Semantic

    Arithmetic Functions

    @@ -193,14 +193,14 @@

    EVE Logical Functions are Arithmetic Functions that can only be applied to logical values L1, ..., Ln as long as they are all cardinal-compatible. By construction, a large majority of glossary_bitwise are de facto Element-wise Operations.

    Constant Functions

    -

    +

    General Principles

    EVE constant generator are Callable Object that takes a single argument of type eve::as. This argument provides the information about the type used to generate the constant. E.g:

    auto z = eve::zero(as<int>()); // equivalent to auto z = static_cast<int>(0);
    auto vp = eve::half(as<wide<float>>()); // equivalent to auto vp = wide<float>(0.5);
    constexpr auto half
    Computes the constant .
    Definition: half.hpp:66
    constexpr auto zero
    Computes the constant 0.
    Definition: zero.hpp:78
    -

    +

    Precision handling

    Some constants are exactly representable in IEEE754 types. However, some mathematical constants can be under-represented on a given type while simultaneously be over-represented on other. For example, \(\pi\) in float is greater than its mathematical value. Meanwhile \(\pi\) in double is less than its mathematical value.

    The constant implementation is so that, for any constant generator g:

    diff --git a/group__math__trig.html b/group__math__trig.html index 1b3dfb6d33..03065a089b 100644 --- a/group__math__trig.html +++ b/group__math__trig.html @@ -135,11 +135,11 @@

    For example eve::cos(eve::pio_2(as<double>()))) is 6.1232e-17 (as pio_2 is not exact), but eve::cospi(0.5) is 0 (as 0.5 is exact).

    -

    Moreover each function can be decorated with eve::quarter_circle, eve:half_circle, eve::full_circle.

    +

    Moreover each function can be decorated with eve::quarter_circle, eve:half_circle, eve::full_circle.

      -
    • eve::quarter_circle provides accurate result for the corresponding radian angle in \(]-\pi/4,\pi/4[\), Nan outside
    • -
    • eve::half_circle provides accurate result for the corresponding radian angle in \(]-\pi/2,\pi/2[\), Nan outside
    • -
    • eve::full_circle provides accurate result for the corresponding radian angle in \(]-\pi,\pi[\), Nan outside
    • +
    • eve::quarter_circle provides accurate result for the corresponding radian angle in \(]-\pi/4,\pi/4[\), Nan outside
    • +
    • eve::half_circle provides accurate result for the corresponding radian angle in \(]-\pi/2,\pi/2[\), Nan outside
    • +
    • eve::full_circle provides accurate result for the corresponding radian angle in \(]-\pi,\pi[\), Nan outside
    • regular call (not decorated) choose the best call and is valid on the full range.
    Warning
    Note that these decorator only work for floating real values.
    @@ -236,15 +236,6 @@
    - - - - - - - - -
    constexpr auto eve::tanpi = functor<tanpi_t>
     elementwise_callable object computing the tangent from an input in \(\pi\) multiples.
     
    constexpr full_circle_type const eve::full_circle = {}
     Higher-order Callable Object imbuing a limited range semantic onto other Callable Objects.
     
    constexpr quarter_circle_type const eve::quarter_circle = {}
     Higher-order Callable Object imbuing a limited range semantic onto other Callable Objects.
     
    constexpr half_circle_type const eve::half_circle = {}
     Higher-order Callable Object imbuing a limited range standard semantic onto other Callable Objects.
     
    diff --git a/group__math__trig_ga03482f35c4921d89499b1034eee99be0.html b/group__math__trig_ga03482f35c4921d89499b1034eee99be0.html index cc7e8175f4..b41c74c969 100644 --- a/group__math__trig_ga03482f35c4921d89499b1034eee99be0.html +++ b/group__math__trig_ga03482f35c4921d89499b1034eee99be0.html @@ -153,13 +153,12 @@

    Header file

    constexpr auto cospi[logical_value auto m](floating_value auto x) noexcept; // 2
    // Semantic options
    -
    constexpr auto cospi[quarter_circle](floating_value auto x) noexcept; // 3
    +
    constexpr auto cospi[quarter_circle](floating_value auto x) noexcept; // 3
    }
    eve::conditional_expr
    Specifies that a type is a Conditional Expression.
    Definition: conditional.hpp:27
    eve::floating_value
    The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
    Definition: value.hpp:95
    eve::logical_value
    The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
    Definition: value.hpp:107
    eve::cospi
    constexpr auto cospi
    elementwise_callable object computing the cosine from an input in multiples.
    Definition: cospi.hpp:81
    -
    eve::quarter_circle
    constexpr quarter_circle_type const quarter_circle
    Higher-order Callable Object imbuing a limited range semantic onto other Callable Objects.
    Definition: trigo_tags.hpp:159
    eve
    EVE Main Namespace.
    Definition: abi.hpp:18

    Parameters

    * `x`: [floating value](@ref floating_value).
     * `c`: [Conditional expression](@ref conditional_expr) masking the operation.
    @@ -190,7 +189,7 @@ 

    Example

    std::cout << "-> cospi(wf) = " << eve::cospi(wf) << "\n";
    std::cout << "-> cospi[ignore_last(2)](wf)= " << eve::cospi[eve::ignore_last(2)](wf) << "\n";
    std::cout << "-> cospi[wf > 0.0](wf) = " << eve::cospi[wf > 0.0](wf) << "\n";
    -
    std::cout << "-> cospi[quarter_circle](wf)= " << eve::cospi[eve::quarter_circle](wf) << "\n";
    +
    std::cout << "-> cospi[quarter_circle](wf)= " << eve::cospi[eve::quarter_circle](wf) << "\n";
    }
    Conditional expression ignoring the k last lanes from a eve::simd_value.
    Definition: conditional.hpp:304
    Wrapper for SIMD registers.
    Definition: wide.hpp:70
    diff --git a/group__math__trig_ga18a94fd518b423cd10fbc07e5ac67d26.html b/group__math__trig_ga18a94fd518b423cd10fbc07e5ac67d26.html index d8f10d0155..5876c1d636 100644 --- a/group__math__trig_ga18a94fd518b423cd10fbc07e5ac67d26.html +++ b/group__math__trig_ga18a94fd518b423cd10fbc07e5ac67d26.html @@ -153,13 +153,12 @@

    Header file

    constexpr auto tanpi[logical_value auto m](floating_value auto x) noexcept; // 2
    // Semantic options
    -
    constexpr auto tanpi[quarter_circle](floating_value auto x) noexcept; // 3
    +
    constexpr auto tanpi[quarter_circle](floating_value auto x) noexcept; // 3
    }
    Specifies that a type is a Conditional Expression.
    Definition: conditional.hpp:27
    The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
    Definition: value.hpp:95
    The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
    Definition: value.hpp:107
    constexpr auto tanpi
    elementwise_callable object computing the tangent from an input in multiples.
    Definition: tanpi.hpp:78
    -
    constexpr quarter_circle_type const quarter_circle
    Higher-order Callable Object imbuing a limited range semantic onto other Callable Objects.
    Definition: trigo_tags.hpp:159
    EVE Main Namespace.
    Definition: abi.hpp:18

    Parameters

     * `x`: [floating value](@ref floating_value).
      * `c`: [Conditional expression](@ref conditional_expr) masking the operation.
    diff --git a/group__math__trig_ga19188d4707f5219c4a8a3f964518a616.html b/group__math__trig_ga19188d4707f5219c4a8a3f964518a616.html
    index edb1028c34..9ad0718494 100644
    --- a/group__math__trig_ga19188d4707f5219c4a8a3f964518a616.html
    +++ b/group__math__trig_ga19188d4707f5219c4a8a3f964518a616.html
    @@ -153,13 +153,12 @@ 

    Header file

    constexpr auto tand[logical_value auto m](floating_value auto x) noexcept; // 2
    // Semantic options
    -
    constexpr auto tand[quarter_circle](floating_value auto x) noexcept; // 3
    +
    constexpr auto tand[quarter_circle](floating_value auto x) noexcept; // 3
    }
    Specifies that a type is a Conditional Expression.
    Definition: conditional.hpp:27
    The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
    Definition: value.hpp:95
    The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
    Definition: value.hpp:107
    constexpr auto tand
    elementwise_callable object computing the tangent from an input in degrees.
    Definition: tand.hpp:78
    -
    constexpr quarter_circle_type const quarter_circle
    Higher-order Callable Object imbuing a limited range semantic onto other Callable Objects.
    Definition: trigo_tags.hpp:159
    EVE Main Namespace.
    Definition: abi.hpp:18