Template Class AlignedAllocator¶
Defined in File Memory.hpp
Class Documentation¶
-
template<class T>
class AlignedAllocator¶ C++ Allocator class for aligned memory.
C++17’s std::pmr::polymorphic_allocator substitutes this whole class. However, clang (even the latest version 13) does not support pmr yet.
- Template Parameters
T – Datatype to allocate
Public Functions
-
inline explicit constexpr AlignedAllocator(uint32_t alignment)¶
Constructor of AlignedAllocator class.
- Parameters
alignment – Memory alignment we want.
-
inline uint32_t alignment() const¶
Get alignment of the allocator.
-
template<typename U>
inline explicit constexpr AlignedAllocator([[maybe_unused]] const AlignedAllocator<U> &rhs) noexcept¶
-
inline T *allocate(std::size_t size) const¶
Allocate memory with for the given number of datatype T.
- Parameters
size – The number of T objects for the allocation
- Returns
Allocated aligned memory
api/classPennylane_1_1Util_1_1AlignedAllocator
Download Python script
Download Notebook
View on GitHub