Resource that uses an upstream resource to allocate memory and tracks allocations. More...
#include <tracking_resource_adaptor.hpp>
Public Member Functions | |
| tracking_resource_adaptor (cuda::mr::any_resource< cuda::mr::device_accessible > upstream, bool capture_stacks=false) | |
| Construct a tracking resource adaptor using upstream to satisfy allocation requests. | |
| device_async_resource_ref | get_upstream_resource () const noexcept |
| rmm::device_async_resource_ref to the upstream resource | |
| std::map< void *, allocation_info > const & | get_outstanding_allocations () const noexcept |
| Get the outstanding allocations map. | |
| std::size_t | get_allocated_bytes () const noexcept |
| Query the number of bytes currently allocated. | |
| std::string | get_outstanding_allocations_str () const |
| Gets a string describing all outstanding allocations (pointer, size, optional stack). | |
| void | log_outstanding_allocations () const |
| Log any outstanding allocations via RMM_LOG_DEBUG. | |
Friends | |
| void | get_property (tracking_resource_adaptor const &, cuda::mr::device_accessible) noexcept |
| Enables the cuda::mr::device_accessible property. | |
Resource that uses an upstream resource to allocate memory and tracks allocations.
Tracks every allocation (size, pointer, and optionally stack trace). Intended as a debug adaptor; should not be used in performance-sensitive code.
This class is copyable and shares ownership of its internal state via cuda::mr::shared_resource.
| rmm::mr::tracking_resource_adaptor::tracking_resource_adaptor | ( | cuda::mr::any_resource< cuda::mr::device_accessible > | upstream, |
| bool | capture_stacks = false ) |
Construct a tracking resource adaptor using upstream to satisfy allocation requests.
| upstream | The resource used for allocating/deallocating device memory. |
| capture_stacks | If true, capture stacks for each allocation. |
|
nodiscardnoexcept |
Query the number of bytes currently allocated.
|
nodiscardnoexcept |
Get the outstanding allocations map.
|
nodiscard |
Gets a string describing all outstanding allocations (pointer, size, optional stack).
|
nodiscardnoexcept |
rmm::device_async_resource_ref to the upstream resource