E.V.E
v2023.02.15
Loading...
Searching...
No Matches
Architecture related Types and Helpers

Detailed Description

Architecture related Types and Helpers.

This module defines the types and helpers functions to properly handle architecture specific components

Classes

struct  eve::fundamental_cardinal< Type, ABI >
 Computes the fundamental cardinal of a given type. More...
struct  eve::platform
 Platform specific constexpr information. More...

Typedefs

template<typename Type, regular_abi ABI = eve::current_abi_type>
using eve::expected_cardinal_t = fixed<expected_cardinal_v<Type,ABI>>
 Computes the expected cardinal of a given type.

Variables

template<scalar_value T, regular_abi ABI = eve::current_abi_type>
constexpr std::ptrdiff_t eve::nofs_cardinal_v
 nofs stands for "no frequency scaling".

Typedef Documentation

◆ expected_cardinal_t

template<typename Type, regular_abi ABI = eve::current_abi_type>
using eve::expected_cardinal_t = fixed<expected_cardinal_v<Type,ABI>>

Computes the expected cardinal of a given type.

Required header: #include <eve/arch/expected_cardinal.hpp>

eve::expected_cardinal_t is the exact cardinal type of the register able to store values of type Type for a given SIMD ABI as a native register type.

Template Parameters
TypeType of value to assess
ABISIMD ABI to use as reference. Must models eve::regular_abi.

Helper variable template

template<typename Type, regular_abi ABI = eve::current_abi_type>
inline constexpr auto expected_cardinal_v = expected_cardinal_t<Type, ABI>::value;
fixed< expected_cardinal_v< Type, ABI > > expected_cardinal_t
Computes the expected cardinal of a given type.
Definition expected_cardinal.hpp:63

Variable Documentation

◆ nofs_cardinal_v

template<scalar_value T, regular_abi ABI = eve::current_abi_type>
std::ptrdiff_t eve::nofs_cardinal_v
constexpr
Initial value:
=
(std::same_as<ABI, x86_512_> && !_::avx512_default_64_bytes)
? expected_cardinal_v<T, x86_256_> : expected_cardinal_v<T, ABI>

nofs stands for "no frequency scaling".

You can find more explanations in the 'frequency scaling tutorial'. This refers to extreme frequency scaling one encounters when working with 64 byte registers on intel. The processor scales frequency drammatically for a substantial period of time. So even if the algorithm itself will run faster the overall perf will go down. Generally speaking, 64 byte registers on intel make sense only for really big data sets. nofs_cardinal will produce 32 byte registers on avx512. If you would like to default to 64 byte registers, you can build with DEVE_AVX512_DEFAULT_64_BYTES. This is probably a good idea on AMD-ZEN4 but we do not detect that at the moment.

Note
frequency scaling exists for avx2 as well but is generally considered acceptable. For example popular implementations of libc use avx2, so you are very likely already have it. You can always set the width manually if needed.
eve::algo by default will use nofs_cardinal. See allow_frequency_scaling trait.
Template Parameters
TypeType of value to assess
ABISIMD ABI to use as reference. Must models eve::regular_abi. defaults to current.


Helpers

template <scalar_value T, regular_abi ABI = eve::current_abi_type>
using nofs_cardinal_t = fixed<nofs_cardinal_v<T>>;
template <scalar_value T>
using nofs_wide = wide<T, nofs_cardinal_t<T>>;
template <plain_scalar_value T>
using nofs_logical = logical<nofs_wide<T>>;
SIMD register cardinal type.
Definition cardinals.hpp:39
Wrapper for SIMD registers.
Definition wide.hpp:94