Class thrust::mr::stateless_resource_allocator

A helper allocator class that uses global instances of a given upstream memory resource. Requires the memory resource to be default constructible.

Template Parameters:

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

Inherits From:

  • thrust::mr::allocator< T, Upstream >
  • thrust::mr::validator< MR >

#include <thrust/mr/allocator.h>
template <typename T,   typename Upstream> class thrust::mr::stateless_resource_allocator { public:   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below void_pointer;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below value_type;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below pointer;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below const_pointer;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below reference;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below const_reference;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below size_type;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below difference_type;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below propagate_on_container_copy_assignment;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below propagate_on_container_move_assignment;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  typedef see below propagate_on_container_swap;
  template <typename U>   struct rebind;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  template <typename U>   struct rebind;
  _CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE   stateless_resource_allocator();
  _CCCL_HOST_DEVICE   stateless_resource_allocator(const stateless_resource_allocator & other);
  template <typename U>   _CCCL_HOST_DEVICE   stateless_resource_allocator(const stateless_resource_allocator< U, Upstream > & other);
  stateless_resource_allocator &   operator=(const stateless_resource_allocator &) = default;
  _CCCL_HOST_DEVICE   ~stateless_resource_allocator();
   /* Inherited from thrust::mr::allocator< T, Upstream > */  _CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE size_type   max_size() const;
   /* Inherited from thrust::mr::allocator< T, Upstream > */  _CCCL_HOST_DEVICE   allocator(MR * resource);
   /* Inherited from thrust::mr::allocator< T, Upstream > */  template <typename U>   _CCCL_HOST_DEVICE   allocator(const allocator< U, MR > & other);
   /* Inherited from thrust::mr::allocator< T, Upstream > */  _CCCL_NODISCARD _CCCL_HOST pointer   allocate(size_type n);
   /* Inherited from thrust::mr::allocator< T, Upstream > */  _CCCL_HOST void   deallocate(pointer p,     size_type n);
   /* Inherited from thrust::mr::allocator< T, Upstream > */  _CCCL_HOST_DEVICE MR *   resource() const; };

Member Classes

Struct thrust::mr::stateless_resource_allocator::rebind

Member Functions

Function thrust::mr::stateless_resource_allocator::stateless_resource_allocator

_CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE stateless_resource_allocator(); Default constructor. Uses get_global_resource to get the global instance of Upstream and initializes the allocator base subobject with that resource.

Function thrust::mr::stateless_resource_allocator::stateless_resource_allocator

_CCCL_HOST_DEVICE stateless_resource_allocator(const stateless_resource_allocator & other); Copy constructor. Copies the memory resource pointer.

Function thrust::mr::stateless_resource_allocator::stateless_resource_allocator

template <typename U> _CCCL_HOST_DEVICE stateless_resource_allocator(const stateless_resource_allocator< U, Upstream > & other); Conversion constructor from an allocator of a different type. Copies the memory resource pointer.

Function thrust::mr::stateless_resource_allocator::operator=

stateless_resource_allocator & operator=(const stateless_resource_allocator &) = default;

Function thrust::mr::stateless_resource_allocator::~stateless_resource_allocator

_CCCL_HOST_DEVICE ~stateless_resource_allocator(); Destructor.