28#ifndef VC_COMMON_ALIGNEDBASE_H_
29#define VC_COMMON_ALIGNEDBASE_H_
34namespace Vc_VERSIONED_NAMESPACE
41template <
typename T>
constexpr T
max(T a) {
return a; }
45template <
typename T,
typename... Ts>
constexpr T
max(T a, T b, Ts... rest)
47 return a > b ?
max(a, rest...) :
max(b, rest...);
52template <std::
size_t> Vc_INTRINSIC
void *aligned_malloc(std::size_t);
53Vc_ALWAYS_INLINE
void free(
void *);
67template <std::
size_t Alignment>
struct alignas(Alignment)
AlignedBase
69 Vc_FREE_STORE_OPERATORS_ALIGNED(Alignment);
The main vector class for expressing data parallelism.
static constexpr size_t MemoryAlignment
Specifies the alignment requirement for aligned load and store calls for objects of this vector type.
Vc::Vector< T > max(const Vc::Vector< T > &x, const Vc::Vector< T > &y)
AlignedBase< Detail::max(Vector< float >::MemoryAlignment, Vector< double >::MemoryAlignment, Vector< ullong >::MemoryAlignment, Vector< llong >::MemoryAlignment, Vector< ulong >::MemoryAlignment, Vector< long >::MemoryAlignment, Vector< uint >::MemoryAlignment, Vector< int >::MemoryAlignment, Vector< ushort >::MemoryAlignment, Vector< short >::MemoryAlignment, Vector< uchar >::MemoryAlignment, Vector< schar >::MemoryAlignment)> MemoryAlignedBase
Helper class to ensure suitable alignment for arrays of scalar objects for any Vc::Vector<T> type (us...
AlignedBase< Detail::max(alignof(Vector< float >), alignof(Vector< double >), alignof(Vector< ullong >), alignof(Vector< llong >), alignof(Vector< ulong >), alignof(Vector< long >), alignof(Vector< uint >), alignof(Vector< int >), alignof(Vector< ushort >), alignof(Vector< short >), alignof(Vector< uchar >), alignof(Vector< schar >))> VectorAlignedBase
Helper type to ensure suitable alignment for any Vc::Vector<T> type (using the default VectorAbi).
AlignedBase< V::MemoryAlignment > MemoryAlignedBaseT
Variant of the above type ensuring suitable alignment only for the specified vector type V.
AlignedBase< alignof(V)> VectorAlignedBaseT
Variant of the above type ensuring suitable alignment only for the specified vector type V.
Helper class to ensure a given alignment.