14 #ifndef QMCPLUSPLUS_ALLOCATOR_H 15 #define QMCPLUSPLUS_ALLOCATOR_H 22 #if defined(__INTEL_COMPILER) 23 #define ASSUME_ALIGNED(x) __assume_aligned(x,QMC_SIMD_ALIGNMENT) 24 #elif defined(__GNUC__) && !defined(__ibmxl__) 25 #define ASSUME_ALIGNED(x) (x) = (__typeof__(x)) __builtin_assume_aligned(x,QMC_SIMD_ALIGNMENT) 27 #define ASSUME_ALIGNED(x) 32 template<
class T,
size_t ALIGN = QMC_SIMD_ALIGNMENT>
41 template<
typename T,
size_t ALIGN = QMC_SIMD_ALIGNMENT>
44 constexpr
size_t ND = ALIGN /
sizeof(T);
45 static_assert(ALIGN %
sizeof(T) == 0,
"getAlignedSize ALIGN must be a multiple of sizeof(T)");
46 return ((
n + ND - 1) / ND) * ND;
49 template<
typename T,
size_t ALIGN = QMC_SIMD_ALIGNMENT>
52 static_assert(ALIGN %
sizeof(T) == 0,
"getAlignedSize ALIGN must be a multiple of sizeof(T)");
53 return ALIGN /
sizeof(T);
size_t getAlignedSize(size_t n)
return size in T's of allocated aligned memory
std::vector< T, aligned_allocator< T > > aligned_vector
helper functions for EinsplineSetBuilder