Developer Guide and Reference

Contents

Number Representation

When specifying extents, positions inside of, or bounds of a container, numeric values can be represented three different ways:
fixed
,
aligned
, and
int
.
Fixed
is most precise and
int
is least precise. It is advised to use as precise specification as possible. The compiler may optimize better with more information.

Fixed

Represent a numerical constant whose value specified at compile time.
template <int NumberT> class fixed;
If offsets applied to index values inside a SIMD loop are known at compile time, then the compiler can use that information. For example, to maintain aligned access, if boundary is fixed and known to be aligned when accessing underlying data layout. When multiple accesses are happening near each other, the compiler will have the opportunity to detect which accesses occur in the same cache lines and potentially avoid prefetching the same cache line repeatedly. Additionally, if the start of an iteration space is known at compile time, if it's a multiple of the SIMD lane count, the compiler could skip generating a peel loop. Whenever possible,
fixed
values should be used over
aligned
or arbitrary integer values.
Although
std::integral_constant<int>
provides the same functionality, the library defines own type to provide overloaded operators and avoid collisions with any other code's interactions with
std::integral_constant<int>
.
The following table provides information about the template arguments for
fixed
.
Template Argument
Description
int Number T
The numerical value the fixed will represent.
The following table provides information about the members of
fixed
.
Member
Description
static constexpr int value = NumberT
The numerical value known at compile-time.
constexpr operator value_type() const