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

Detailed Description

Type traits for SIMD related types and functions.

Using EVE types and functions may require information about some properties of the processed types that are accessible through the following traits.

Convenience header:

#include <eve/traits.hpp>

Classes

struct  eve::abi< Type, Lanes >
 Find proper ABI for Type/Lanes pair. More...
struct  eve::as< T >
 Lightweight type-wrapper. More...
struct  eve::as_element< T >
 Lightweight type-wrapper over element type. More...
struct  eve::cardinal< Type >
 Computes the cardinal of a given type. More...
struct  eve::common_compatible< Ts >
 Computes the type compatible with a list of values. More...
struct  eve::common_type< Ts >
 Computes a type that can represent all values in a list of types. More...
struct  eve::comparisons< T >
 Extension point for ordering and equality computation. More...
struct  eve::element_type< T >
 Extracts the scalar part of a type. More...
struct  eve::underlying_type< Ts >
 Computes the most scalar type associated with a type. More...

Concepts

concept  eve::same_lanes_or_scalar
 Checks that all types Ts are either scalar or share a common number of lanes.
concept  eve::same_lanes_or_scalar_tuple
 Checks that all types within a product type are either scalar or share a common number of lanes.
concept  eve::same_lanes
 Checks that all SIMD types Ts share a common number of lanes.
concept  eve::same_types
 Checks that all types Ts are scalars of a single type U or simd_values sharing the same lane count and of element type U.
concept  eve::same_types_tuple
 Checks that all types within a product type are scalars of a single type U or simd_values sharing the same lane count and of element type U.

Typedefs

template<typename T>
using eve::iterator_cardinal_t = decltype(_::iterator_cardinal_impl<T>())
 A meta-function that returns a cardinal for a relaxed iterator/range. If T defines a nested static function iterator_cardinal() (which should return eve::fixed).
template<typename... Ts>
using eve::max_lanes_t = fixed<max_lanes_v<Ts...>>
 The cardinal type of the maximum lane count of given wide or scalar types.
template<typename T>
using eve::value_type_t = typename decltype(_::value_type_impl<T>())::type
 A meta function for getting an associated value_type for a relaxed iterator/range.
template<typename T>
using eve::wide_value_type_t = as_wide_t<value_type_t<T>, iterator_cardinal_t<T>>

Variables

template<typename... Ts>
constexpr auto eve::max_lanes_v = _::compute_max_lanes<Ts...>()
 A meta function for getting a maximum lane count of given wide or scalar types.
template<typename T>
constexpr std::size_t eve::max_scalar_size_v
 A meta function for getting a maximum size of scalar.

Typedef Documentation

◆ iterator_cardinal_t

template<typename T>
using eve::iterator_cardinal_t = decltype(_::iterator_cardinal_impl<T>())

A meta-function that returns a cardinal for a relaxed iterator/range. If T defines a nested static function iterator_cardinal() (which should return eve::fixed).

Template Parameters
TType to process

NOTE: for aligned_ptr we return expected_cardinal.

Required header: #include <eve/traits/iterator_cardinal.hpp>, #include <eve/traits.hpp>

template<typename T>
inline constexpr auto iterator_cardinal_v = iterator_cardinal<T>::value;

◆ max_lanes_t

template<typename... Ts>
using eve::max_lanes_t = fixed<max_lanes_v<Ts...>>

The cardinal type of the maximum lane count of given wide or scalar types.

Template Parameters
TsTypes to process

◆ value_type_t

template<typename T>
using eve::value_type_t = typename decltype(_::value_type_impl<T>())::type

A meta function for getting an associated value_type for a relaxed iterator/range.

Template Parameters
TType to process

value_type_t<T> is computed as follows:

  • If T has begin/end - value_type_t for return type of begin
  • If T is std::iterator -> returns iterator_traits<T>::value_type
  • If T has nested value_type -> returns it
  • If T is a product type and all elements have value_type_t defined for them -
  • kumi::tuple for the individual product types.
  • Otherwise it's undefined.
Template Parameters
TType to process

Required header: #include <eve/traits.hpp>

◆ wide_value_type_t

template<typename T>
using eve::wide_value_type_t = as_wide_t<value_type_t<T>, iterator_cardinal_t<T>>
Template Parameters
TType to process

Required header: #include <eve/traits/wide_value_type.hpp>, #include <eve/traits.hpp>

template<typename T>
using wide_value_type_t = as_wide_t<value_type_t<T>, iterator_cardinal_t<T>>
decltype(_::iterator_cardinal_impl< T >()) iterator_cardinal_t
A meta-function that returns a cardinal for a relaxed iterator/range. If T defines a nested static fu...
Definition iterator_cardinal.hpp:49
as_wide_t< value_type_t< T >, iterator_cardinal_t< T > > wide_value_type_t
Definition wide_value_type.hpp:33

Variable Documentation

◆ max_lanes_v

template<typename... Ts>
auto eve::max_lanes_v = _::compute_max_lanes<Ts...>()
inlineconstexpr

A meta function for getting a maximum lane count of given wide or scalar types.

Template Parameters
TsTypes to process

◆ max_scalar_size_v

template<typename T>
std::size_t eve::max_scalar_size_v
constexpr
Initial value:
= kumi::max_flat( kumi::as_tuple_t<T>{}
, [](auto m) { return sizeof(m); }
)
constexpr max_flat_t max_flat

A meta function for getting a maximum size of scalar.

Template Parameters
TType to process
   For a product type returns max size of individual fields.
   Otherwise returns sizeof(T)

Required header: #include <eve/traits/max_scalar_size.hpp>, #include <eve/traits.hpp>