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_width< Type, ABI >
 Computes the fundamental width 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_width_t = lanes_t<expected_width_v<Type,ABI>>
 Computes the expected width of a given type.

Variables

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

Typedef Documentation

◆ expected_width_t

template<typename Type, regular_abi ABI = eve::current_abi_type>
using eve::expected_width_t = lanes_t<expected_width_v<Type,ABI>>

Computes the expected width of a given type.

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

eve::expected_width_t is the exact width 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_width_v = expected_width_t<Type, ABI>::value;
lanes_t< expected_width_v< Type, ABI > > expected_width_t
Computes the expected width of a given type.
Definition expected_width.hpp:65

Variable Documentation

◆ nofs_width_v

template<scalar_value T, regular_abi ABI = eve::current_abi_type>
width_type eve::nofs_width_v
constexpr
Initial value:
=
(std::same_as<ABI, x86_512_> && !_::avx512_default_64_bytes)
? expected_width_v<T, x86_256_> : expected_width_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_width 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_width. 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_width_t = lanes_t<nofs_width_v<T>>;
template <scalar_value T>
using nofs_wide = wide<T, nofs_width_t<T>>;
template <plain_scalar_value T>
using nofs_logical = logical<nofs_wide<T>>;
SIMD register width type.
Definition widths.hpp:48
Wrapper for SIMD registers.
Definition wide.hpp:95