thrust
Classes | Public Types | Public Member Functions | List of all members
thrust::mr::allocator< T, MR > Class Template Reference

#include <thrust/mr/allocator.h>

Inherits thrust::mr::validator< MR >.

Classes

struct  rebind
 

Public Types

typedef MR::pointer void_pointer
 
typedef T value_type
 
typedef thrust::detail::pointer_traits< void_pointer >::template rebind< T >::other pointer
 
typedef thrust::detail::pointer_traits< void_pointer >::template rebind< const T >::other const_pointer
 
typedef thrust::detail::pointer_traits< pointer >::reference reference
 
typedef thrust::detail::pointer_traits< const_pointer >::reference const_reference
 
typedef std::size_t size_type
 
typedef thrust::detail::pointer_traits< pointer >::difference_type difference_type
 
typedef detail::true_type propagate_on_container_copy_assignment
 
typedef detail::true_type propagate_on_container_move_assignment
 
typedef detail::true_type propagate_on_container_swap
 

Public Member Functions

__host__ __device__ size_type max_size () const
 
__host__ __device__ allocator (MR *resource)
 
template<typename U >
__host__ __device__ allocator (const allocator< U, MR > &other)
 
__host__ pointer allocate (size_type n)
 
__host__ void deallocate (pointer p, size_type n)
 
__host__ __device__ MR * resource () const
 

Detailed Description

template<typename T, class MR>
class thrust::mr::allocator< T, MR >

An mr::allocator is a template that fulfills the C++ requirements for Allocators, allowing to use the NPA-based memory resources where an Allocator is required. Unlike memory resources, but like other allocators, mr::allocator is typed and bound to allocate object of a specific type, however it can be freely rebound to other types.

Template Parameters
Tthe type that will be allocated by this allocator.
MRthe upstream memory resource to use for memory allocation. Must derive from thrust::mr::memory_resource and must be final (in C++11 and beyond).

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