All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
blaze::AlignmentTrait< T > Struct Template Reference

Evaluation of the required alignment of the given data type.The AlignmentTrait class template evaluates the required alignment for the given data type. For instance, for fundamental data types that can be vectorized via SSE or AVX instructions, the proper alignment is 16 or 32 bytes, respectively. For all other data types, a multiple of the alignment chosen by the compiler is returned. The evaluated alignment can be queried via the nested value member. More...

#include <AlignmentTrait.h>

Detailed Description

template<typename T>
struct blaze::AlignmentTrait< T >

Evaluation of the required alignment of the given data type.

The AlignmentTrait class template evaluates the required alignment for the given data type. For instance, for fundamental data types that can be vectorized via SSE or AVX instructions, the proper alignment is 16 or 32 bytes, respectively. For all other data types, a multiple of the alignment chosen by the compiler is returned. The evaluated alignment can be queried via the nested value member.

AlignmentTrait<unsigned int>::value // Evaluates to 32 if AVX2 is available, to 16 if only
// SSE2 is available, and a multiple of the alignment
// chosen by the compiler otherwise.
AlignmentTrait<double>::value // Evaluates to 32 if AVX is available, to 16 if only
// SSE is available, and a multiple of the alignment
// chosen by the compiler otherwise.

The documentation for this struct was generated from the following file: