TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
nda::mem::Allocator Concept Reference

#include <nda/concepts.hpp>

Detailed Description

Check if a given type satisfies the allocator concept.

Allocators are used to reserve and free memory. Depending on their address space, the memory can either be allocated on the Host (CPU), on the Device (GPU) or on unified memory (see nda::mem::AddressSpace).

Note
The named C++ Allocator requirements of the standard library are different.
Template Parameters
AType to check.

Definition at line 166 of file concepts.hpp.

Concept definition

template<typename A>
concept nda::mem::Allocator = requires(A &a) {
{ a.allocate(size_t{}) } noexcept -> std::same_as<blk_t>;
{ a.allocate_zero(size_t{}) } noexcept -> std::same_as<blk_t>;
{ a.deallocate(std::declval<blk_t>()) } noexcept;
{ A::address_space } -> std::same_as<AddressSpace const &>;
}
Check if a given type satisfies the allocator concept.
Definition concepts.hpp:166