Skip to content

Commit

Permalink
Documentation fixes and update
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Oct 27, 2024
1 parent 349919f commit a11d927
Show file tree
Hide file tree
Showing 404 changed files with 1,450 additions and 1,077 deletions.
2 changes: 1 addition & 1 deletion doc/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
</tbody>
</table>
</div>
<!--END TITLEAREA -->
<!--END TITLEAREA-->
<!-- end header part -->
4 changes: 2 additions & 2 deletions doc/internals/algo.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ details like correct tail handling, alignment handling or unrolling.
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
For an in-depth discussion about those issues, you can take a look at the Algorithms section
of our [CppCon talk](https://www.youtube.com/embed/WZGNCPBMInI?t=1412).

# Basic Components
Expand All @@ -25,7 +25,7 @@ of our [CppCon talk](https://www.youtube.com/embed/WZGNCPBMInI?t=1412).

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
frequent loop structures. 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
Expand Down
9 changes: 7 additions & 2 deletions doc/internals/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ following protocol:
- Let `func` be an **EVE** object function object that supports masks and let `cond`
be a [logical value](@ref eve::logical_value) or a [conditional expression](@ref eve::conditional_expr).

- Then, for any [value](@ref eve::value) `x`, the expression `func[cond](x, ...)`
is equivalent to `if_else(cond, func_(x,...), x)`.
- Then, for any [value](@ref eve::value) `x`, the expression

func[cond](x, ...)

is equivalent to

if_else(cond, func_(x,...), x).

In these basic cases, if the mask is set to `false` for a given lane, the value returned by the
function is the corresponding value of `x`, regardless of other parameters. Note that this semantic
Expand Down
24 changes: 17 additions & 7 deletions doc/internals/semantic.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ template<eve::value V, std::integral I> auto get(V const& v, I i)
@endcode

@subsection glossary_elementwise Element-wise Operations
For any [values](@ref eve::value) `x1`, ..., `xn` of types `T1`, ..., `Tn` , a Callable Object `f`
For any [values](@ref eve::value) `x1, ..., xn` of types `T1, ..., Tn` , a Callable Object `f`
returning a [value](@ref eve::value) of type `R` is said to be **Element-wise** if the expression
`R r = f(x1, ...,xn)` is semantically equivalent to:

Expand Down Expand Up @@ -80,7 +80,7 @@ definition is required by the internal implementation.

@subsection glossary_arithmetic Arithmetic Functions

For any [values](@ref eve::value) `x1`, ..., `xn` of types `T1`, ..., `Tn` so that the expression
For any [values](@ref eve::value) `x1, ..., xn` of types `T1, ..., Tn` so that the expression
`using C = eve::common_compatible_t<T1,...,Tn>` is valid, a Callable Object `f` is said to be
an **Arithmetic Function** if the expression `C r = f(x1, ...,xn)` is semantically equivalent to:

Expand All @@ -98,11 +98,18 @@ In a less formal way, **EVE** @ref glossary_arithmetic generalizes the notion of
arithmetic operations. By construction, a large majority of @ref glossary_arithmetic are _de facto_
@ref glossary_elementwise.

@subsection glossary_bitwise Bitwise Functions

**EVE** @ref glossary_bitwise are @ref glossary_arithmetic that are quite type agnostic as long as they are all
**size-compatible**. By construction, all but [bit_select](@ref eve::bit_select) @ref glossary_bitwise are
de facto_ @ref glossary_elementwise and return a value in the (possibly vector extended)
type of their first parameter.

@subsection glossary_logical Logical Functions

**EVE** @ref glossary_logical are @ref glossary_arithmetic that can only be applied to
[logical values](@ref eve::logical_value) `L1`, ..., `Ln` as long as they are all
**cardinal-compatible**. By construction, a large majority of @ref glossary_bitwise are
[logical values](@ref eve::logical_value) `L1, ..., Ln` as long as they are all
**cardinal-compatible**. By construction, a large majority of @ref glossary_logical are
_de facto_ @ref glossary_elementwise.

@subsection glossary_constant Constant Functions
Expand All @@ -125,10 +132,13 @@ than its mathematical value.
The constant implementation is so that, for any constant generator `g`:

- `g(eve::as<T>())`returns the nearest representable value of the mathematical constant
- `eve::downward(g)(eve::as<T>())`returns a value no lesser than 0.5 ULP from the mathematical constant
- `eve::upward(g)(eve::as<T>())`returns a value no greater than 0.5 ULP from the mathematical constant
- `g[eve::downward](eve::as<T>())`returns a value no lesser than 0.5 ULP from the mathematical constant
- `g[eve::upward](eve::as<T>())`returns a value no greater than 0.5 ULP from the mathematical constant

For all constants,

`g[eve::downward](eve::as<T>()) <= g(eve::as<T>()) <= g[eve::upward](eve::as<T>())`

For all constants, `eve::downward(g)(eve::as<T>()) <= g(eve::as<T>()) <= eve::upward(g)(eve::as<T>())`
is always verified.

We encourage user facing issue with reproducible computation to use those decorators to make all
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial/interacting_with_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TTS_CASE("Check remove spaces") {
//! [slicing_aggregate]

TTS_CASE("Slice Example") {
// Om most platforms is 2 registers or even 4.
// On most platforms is 2 registers or even 4.
using i32x16 = eve::wide<int, eve::fixed<16>>;

// half type
Expand Down
8 changes: 8 additions & 0 deletions include/eve/concept/conditional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace eve
{
//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept conditional_expr
//! @brief Specifies that a type is a Conditional Expression
//!
Expand All @@ -30,9 +31,13 @@ namespace eve
{ T::is_inverted };
{ T::is_complete };
};
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept relative_conditional_expr
//! @brief Specifies that a type is a Conditional Expression using relative mask
//!
Expand All @@ -50,4 +55,7 @@ namespace eve
{ a.offset(eve::as<eve::wide<int>>()) };
{ a.roffset(eve::as<eve::wide<int>>()) };
};
//================================================================================================
//! @}
//================================================================================================
}
4 changes: 4 additions & 0 deletions include/eve/concept/generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace eve
{
//====================================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept generator
//! The concept `generator<Constant>` is satisfied if `Constant` is built as a eve::constant_callable.
//!
Expand All @@ -25,4 +26,7 @@ namespace eve
//====================================================================================================================
template<typename Constant>
concept generator = requires { typename Constant::constant_callable_tag; };
//================================================================================================
//! @}
//================================================================================================
}
5 changes: 5 additions & 0 deletions include/eve/concept/invocable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ concept invocable = requires(F&& f, Args&&...args)

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @brief std::predicate but doesn't require regularity
//!
//! @tparam T
Expand All @@ -94,4 +95,8 @@ concept invocable = requires(F&& f, Args&&...args)
concept irregular_predicate = requires (T&& f, Args&&... args) {
{ !f(EVE_FWD(args)...) } -> std::convertible_to<bool>;
};
//================================================================================================
//! @}
//================================================================================================

}
8 changes: 8 additions & 0 deletions include/eve/concept/scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ template<typename Type> struct logical;

//==================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept plain_scalar_value
//! @brief Specify that a type represents a plain scalar value
//! The concept `plain_scalar_value<T>` is satisfied if and only if the translation of T is an
Expand All @@ -45,9 +46,13 @@ template<typename Type> struct logical;
//==================================================================================================
template<typename T>
concept plain_scalar_value = detail::is_plain<translate_t<T>>();
//================================================================================================
//! @}
//================================================================================================

//==================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept logical_scalar_value
//! @brief Specify that a type represents a logical scalar value
//! The concept `logical_scalar_value<T>` is satisfied if and only if T is an instance of
Expand All @@ -60,6 +65,9 @@ concept plain_scalar_value = detail::is_plain<translate_t<T>>();
template<typename T>
concept logical_scalar_value = detail::instance_of<T, logical>
&& plain_scalar_value<typename T::value_type>;
//================================================================================================
//! @}
//================================================================================================
}

namespace eve::detail
Expand Down
4 changes: 4 additions & 0 deletions include/eve/concept/simd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ namespace eve

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept logical_simd_value
//! @brief Specify that a type represents a logical SIMD value.
//! The concept `logical_simd_value<T>` is satisfied if and only if T is an instance of
Expand All @@ -44,4 +45,7 @@ namespace eve
template<typename T>
concept logical_simd_value = detail::instance_of<T,logical>
&& plain_simd_value<typename T::mask_type>;
//================================================================================================
//! @}
//================================================================================================
}
4 changes: 4 additions & 0 deletions include/eve/concept/translation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace eve
{
//==================================================================================================
//! @concept has_plain_translation
//! @{
//! @brief Specify that a type can be translated to a plain scalar value.
//! The concept `has_plain_translation<T>` is satisfied if and only if calling `translate_t<T>`
//! returns a type that is different from `T`.
Expand All @@ -24,4 +25,7 @@ namespace eve
//==================================================================================================
template <typename T>
concept has_plain_translation = !std::same_as<translate_t<T>, T>;
//================================================================================================
//! @}
//================================================================================================
}
32 changes: 32 additions & 0 deletions include/eve/concept/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace eve
{
//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept value
//! @brief The concept `value<T>` is satisfied if and only if T satisfies
//! either `eve::scalar_value` or `eve::simd_value`.
Expand All @@ -31,9 +32,13 @@ namespace eve
//! - `eve::wide<int, eve::fixed<1>>`
//================================================================================================
template<typename T> concept value = simd_value<T> || scalar_value<T>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept integral_value
//! @brief The concept `integral_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies `std::integral`
Expand All @@ -44,9 +49,13 @@ namespace eve
//! - `eve::wide<int, eve::fixed<1>>`
//================================================================================================
template<typename T> concept integral_value = value<T> && std::integral<translate_element_type_t<T>>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept signed_value
//! @brief The concept `signed_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies `std::is_signed`
Expand All @@ -57,9 +66,13 @@ namespace eve
//! - `eve::wide<int, eve::fixed<1>>`
//================================================================================================
template<typename T> concept signed_value = value<T> && std::is_signed_v<translate_element_type_t<T>>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept unsigned_value
//! @brief The concept `unsigned_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies `std::unsigned_integral`
Expand All @@ -69,9 +82,13 @@ namespace eve
//! - `eve::wide<std::uint8_t, eve::fixed<1>>`
//================================================================================================
template<typename T> concept unsigned_value = value<T> && std::unsigned_integral<translate_element_type_t<T>>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept signed_integral_value
//! @brief The concept `signed_integral_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies `std::signed_integral`
Expand All @@ -81,9 +98,13 @@ namespace eve
//! - `eve::wide<int, eve::fixed<1>>`
//================================================================================================
template<typename T> concept signed_integral_value = value<T> && std::signed_integral<translate_element_type_t<T>>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept floating_value
//! @brief The concept `floating_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies `std::floating_point`
Expand All @@ -93,9 +114,13 @@ namespace eve
//! - `eve::wide<float, eve::fixed<2>>`
//================================================================================================
template<typename T> concept floating_value = value<T> && std::floating_point<translate_element_type_t<T>>;
//================================================================================================
//! @}
//================================================================================================

//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept logical_value
//! @brief The concept `logical_value<T>` is satisfied if and only if T satisfies
//! `eve::value` and the element type satisfies is_logical_v
Expand All @@ -105,10 +130,14 @@ namespace eve
//! - `eve::logical<double>`
//================================================================================================
template<typename T> concept logical_value = value<T> && is_logical_v<T>;
//================================================================================================
//! @}
//================================================================================================


//================================================================================================
//! @ingroup simd_concepts
//! @{
//! @concept plain_value
//! @brief The concept `plain_value<T>` is satisfied if and only if T satisfies
//! `eve::plain_simd_value` or `eve::plain_scalar_value`.
Expand All @@ -118,4 +147,7 @@ namespace eve
//! - `eve::wide<double>`
//================================================================================================
template<typename T> concept plain_value = plain_simd_value<T> || plain_scalar_value<T>;
//================================================================================================
//! @}
//================================================================================================
}
Loading

0 comments on commit a11d927

Please sign in to comment.