MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
aligned_allocator.hpp File Reference
#include <cstddef>
#include <limits>
#include <memory>
#include <new>
#include <type_traits>
#include <mtl/detail/exceptions.hpp>

Classes

class  mtl::detail::aligned_allocator< T, Align >
 C++ Allocator that hands out Align-byte-aligned storage. More...
struct  mtl::detail::aligned_allocator< T, Align >::rebind< U >

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Functions

template<typename T>
T * mtl::detail::allocate_aligned (std::size_t n)
 Allocate and value-initialize n elements of T on an over-aligned heap block (block_alignment<T>).
template<typename T>
void mtl::detail::deallocate_aligned (T *p, std::size_t n) noexcept
 Destroy n elements and free a block from allocate_aligned. No-op on nullptr.

Variables

constexpr std::size_t mtl::detail::default_alignment = 64
 Default over-alignment: 64 bytes covers a typical cache line and the widest common SIMD register (AVX-512).
template<typename T>
constexpr std::size_t mtl::detail::block_alignment
 Alignment used for a block of T: at least default_alignment, but never less than T's natural alignment.