64 return _aligned_malloc(size, alignment);
67 if (posix_memalign(&ptr, alignment, size) != 0) {
return nullptr; }
72#if defined(NATIVE_SIMD_WIDTH) || defined(DOXYGEN)
126#ifdef NATIVE_SIMD_WIDTH
127template <
typename T,
size_t ALIGN = NATIVE_SIMD_WIDTH>
129template <
typename T,
size_t ALIGN>
136 using value_type = T;
138 using const_pointer =
const T *;
139 using reference = T &;
140 using const_reference =
const T &;
141 using size_type = std::size_t;
142 using difference_type = std::ptrdiff_t;
144 template <
typename U>
152 template <
typename U>
157 pointer address(reference x)
const noexcept {
return std::addressof(x); }
158 const_pointer address(const_reference x)
const noexcept
160 return std::addressof(x);
163 pointer allocate(size_type n,
const void * = 0)
165 return static_cast<pointer
>(
aligned_malloc(ALIGN, n *
sizeof(T)));
167 void deallocate(pointer p, size_type) {
aligned_free(p); }
169 size_type max_size()
const noexcept
171 return (size_type(-1) - size_type(ALIGN)) /
sizeof(T);
173 template <
typename U,
typename... Args>
174 void construct(U *p, Args &&...args)
176 ::new (
static_cast<void *
>(p)) U(std::forward<Args>(args)...);
178 void destroy(pointer p) { p->~T(); }
Aligned allocator.
Definition alloc.H:132
void * aligned_malloc(size_t alignment, size_t size)
Aligned memory allocation.
Definition alloc.H:61
void aligned_free(void *ptr)
Aligned memory deallocation.
Definition alloc.H:102
static Vec< T, SIMD_WIDTH > operator==(const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
Equal to operator. Maps to cmpeq().
Definition ext.H:3778
static Vec< T, SIMD_WIDTH > operator!=(const Vec< T, SIMD_WIDTH > &a, const Vec< T, SIMD_WIDTH > &b)
Not equal to operator. Maps to cmpneq().
Definition ext.H:3780
Namespace for T-SIMD.
Definition time_measurement.H:161