MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::detail::aligned_allocator< T, Align > Class Template Reference

C++ Allocator that hands out Align-byte-aligned storage. More...

#include <aligned_allocator.hpp>

Classes

struct  rebind

Public Types

using value_type = T

Public Member Functions

 aligned_allocator () noexcept=default
template<typename U>
 aligned_allocator (const aligned_allocator< U, Align > &) noexcept
T * allocate (std::size_t n)
void deallocate (T *p, std::size_t) noexcept
template<typename U>
bool operator== (const aligned_allocator< U, Align > &) const noexcept
template<typename U>
bool operator!= (const aligned_allocator< U, Align > &) const noexcept

Static Public Attributes

static constexpr std::size_t alignment = Align

Detailed Description

template<typename T, std::size_t Align = block_alignment<T>>
class mtl::detail::aligned_allocator< T, Align >

C++ Allocator that hands out Align-byte-aligned storage.

Usable as std::vector<T, aligned_allocator<T>> for SIMD-friendly scratch/packing buffers. Stateless: all instances compare equal.

Member Typedef Documentation

◆ value_type

template<typename T, std::size_t Align = block_alignment<T>>
using mtl::detail::aligned_allocator< T, Align >::value_type = T

Constructor & Destructor Documentation

◆ aligned_allocator() [1/2]

template<typename T, std::size_t Align = block_alignment<T>>
mtl::detail::aligned_allocator< T, Align >::aligned_allocator ( )
defaultnoexcept

◆ aligned_allocator() [2/2]

template<typename T, std::size_t Align = block_alignment<T>>
template<typename U>
mtl::detail::aligned_allocator< T, Align >::aligned_allocator ( const aligned_allocator< U, Align > & )
inlinenoexcept

Member Function Documentation

◆ allocate()

template<typename T, std::size_t Align = block_alignment<T>>
T * mtl::detail::aligned_allocator< T, Align >::allocate ( std::size_t n)
inlinenodiscard

◆ deallocate()

template<typename T, std::size_t Align = block_alignment<T>>
void mtl::detail::aligned_allocator< T, Align >::deallocate ( T * p,
std::size_t  )
inlinenoexcept

◆ operator!=()

template<typename T, std::size_t Align = block_alignment<T>>
template<typename U>
bool mtl::detail::aligned_allocator< T, Align >::operator!= ( const aligned_allocator< U, Align > & ) const
inlinenoexcept

◆ operator==()

template<typename T, std::size_t Align = block_alignment<T>>
template<typename U>
bool mtl::detail::aligned_allocator< T, Align >::operator== ( const aligned_allocator< U, Align > & ) const
inlinenoexcept

Member Data Documentation

◆ alignment

template<typename T, std::size_t Align = block_alignment<T>>
std::size_t mtl::detail::aligned_allocator< T, Align >::alignment = Align
staticconstexpr

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