Files | Classes | Typedefs
Memory Resource Adaptors

Files

file  aligned_resource_adaptor.hpp
 
file  failure_callback_resource_adaptor.hpp
 
file  limiting_resource_adaptor.hpp
 
file  logging_resource_adaptor.hpp
 
file  prefetch_resource_adaptor.hpp
 
file  statistics_resource_adaptor.hpp
 
file  thread_safe_resource_adaptor.hpp
 
file  thrust_allocator_adaptor.hpp
 
file  tracking_resource_adaptor.hpp
 

Classes

class  rmm::mr::aligned_resource_adaptor
 Resource that adapts an upstream resource to allocate memory with a specified alignment. More...
 
class  rmm::mr::failure_callback_resource_adaptor< ExceptionType >
 A device memory resource that calls a callback function when allocations throw a specified exception type. More...
 
class  rmm::mr::limiting_resource_adaptor
 Resource that uses an upstream resource to allocate memory and limits the total allocations possible. More...
 
class  rmm::mr::logging_resource_adaptor
 Resource that uses an upstream resource to allocate memory and logs information about the requested allocation/deallocations. More...
 
class  rmm::mr::prefetch_resource_adaptor
 Resource that prefetches all memory allocations. More...
 
class  rmm::mr::statistics_resource_adaptor
 Resource that uses an upstream resource to allocate memory and tracks allocation statistics (current, peak, total bytes and allocation counts). More...
 
class  rmm::mr::thread_safe_resource_adaptor
 Resource that adapts an upstream resource to be thread safe. More...
 
class  rmm::mr::thrust_allocator< T >
 An allocator compatible with Thrust containers and algorithms using a device_async_resource_ref for memory (de)allocation. More...
 
class  rmm::mr::tracking_resource_adaptor
 Resource that uses an upstream resource to allocate memory and tracks allocations. More...
 

Typedefs

using rmm::mr::failure_callback_t = std::function< bool(std::size_t, void *)>
 Callback function type used by failure_callback_resource_adaptor. More...
 

Detailed Description

Typedef Documentation

◆ failure_callback_t

using rmm::mr::failure_callback_t = typedef std::function<bool(std::size_t, void*)>

Callback function type used by failure_callback_resource_adaptor.

The resource adaptor calls this function when a memory allocation throws a specified exception type. The function decides whether the resource adaptor should try to allocate the memory again or re-throw the exception.

The callback function signature is: bool failure_callback_t(std::size_t bytes, void* callback_arg)

The callback function is passed two parameters: bytes is the size of the failed memory allocation and arg is the extra argument passed to the constructor of the failure_callback_resource_adaptor. The callback function returns a bool where true means to retry the memory allocation and false means to re-throw the exception.