allocator_traits< Allocator >

allocator_traits< Allocator >#

stdgpu: stdgpu::allocator_traits< Allocator >
stdgpu Latest
Efficient STL-like Data Structures on the GPU

Detailed Description

template<typename Allocator>
struct stdgpu::allocator_traits< Allocator >

A general allocator traitor.

Differences to std::allocator_traits:

  • No detection mechanism of the capabilities of the allocator, thus always using the fallback
  • index_type instead of size_type

Public Types

using allocator_type = Allocator
 
using const_pointer = typename std::pointer_traits< pointer >::template rebind< const value_type >
 
using const_void_pointer = typename std::pointer_traits< pointer >::template rebind< const void >
 
using difference_type = typename std::pointer_traits< pointer >::difference_type
 
using index_type = index64_t
 
using is_always_equal = std::is_empty< Allocator >
 
using pointer = value_type *
 
using propagate_on_container_copy_assignment = std::false_type
 
using propagate_on_container_move_assignment = std::false_type
 
using propagate_on_container_swap = std::false_type
 
template<typename T >
using rebind_alloc = typename std::allocator_traits< Allocator >::template rebind_alloc< T >
 
template<typename T >
using rebind_traits = allocator_traits< rebind_alloc< T > >
 
using value_type = typename Allocator::value_type
 
using void_pointer = typename std::pointer_traits< pointer >::template rebind< void >
 

Static Public Member Functions

static pointer allocate (Allocator &a, index_type n)
 
static pointer allocate (Allocator &a, index_type n, const_void_pointer hint)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
static pointer allocate_filled (ExecutionPolicy &&policy, Allocator &a, index_type n, const value_type &default_value)
 
template<typename T , class... Args>
static STDGPU_HOST_DEVICE void construct (Allocator &a, T *p, Args &&... args)
 
static void deallocate (Allocator &a, pointer p, index_type n)
 
template<typename ExecutionPolicy , STDGPU_DETAIL_OVERLOAD_IF(is_execution_policy_v< remove_cvref_t< ExecutionPolicy > >) >
static void deallocate_filled (ExecutionPolicy &&policy, Allocator &a, pointer p, index_type n)
 
template<typename T >
static STDGPU_HOST_DEVICE void destroy (Allocator &a, T *p)
 
static STDGPU_HOST_DEVICE index_type max_size (const Allocator &a) noexcept
 
static Allocator select_on_container_copy_construction (const Allocator &a)