A device memory resource that uses the provided callbacks for memory allocation and deallocation. More...
#include <callback_memory_resource.hpp>


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. | |
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.
| 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.
| allocate_callback | The callback function used for allocation |
| deallocate_callback | The callback function used for deallocation |
| allocate_callback_arg | Additional 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_arg | Additional 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. |