Public Member Functions | Friends | List of all members
rmm::mr::callback_memory_resource Class Reference

A device memory resource that uses the provided callbacks for memory allocation and deallocation. More...

#include <callback_memory_resource.hpp>

Inheritance diagram for rmm::mr::callback_memory_resource:
Inheritance graph
[legend]
Collaboration diagram for rmm::mr::callback_memory_resource:
Collaboration graph
[legend]

Public Member Functions

 callback_memory_resource (allocate_callback_t allocate_callback, deallocate_callback_t deallocate_callback, void *allocate_callback_arg=nullptr, void *deallocate_callback_arg=nullptr)
 Construct a new callback memory resource. More...
 

Friends

void get_property (callback_memory_resource const &, cuda::mr::device_accessible) noexcept
 Enables the cuda::mr::device_accessible property.
 

Detailed Description

A device memory resource that uses the provided callbacks for memory allocation and deallocation.

This class is copyable and shares ownership of its internal state via cuda::mr::shared_resource.

Constructor & Destructor Documentation

◆ callback_memory_resource()

rmm::mr::callback_memory_resource::callback_memory_resource ( allocate_callback_t  allocate_callback,
deallocate_callback_t  deallocate_callback,
void *  allocate_callback_arg = nullptr,
void *  deallocate_callback_arg = nullptr 
)

Construct a new callback memory resource.

Constructs a callback memory resource that uses the user-provided callbacks allocate_callback for allocation and deallocate_callback for deallocation.

Parameters
allocate_callbackThe callback function used for allocation
deallocate_callbackThe callback function used for deallocation
allocate_callback_argAdditional context passed to allocate_callback. It is the caller's responsibility to maintain the lifetime of the pointed-to data for the duration of the lifetime of the callback_memory_resource.
deallocate_callback_argAdditional context passed to deallocate_callback. It is the caller's responsibility to maintain the lifetime of the pointed-to data for the duration of the lifetime of the callback_memory_resource.

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