Resource that uses an upstream resource to allocate memory and tracks allocations. More...
#include <tracking_resource_adaptor.hpp>
Public Types | |
| using | allocation_info = detail::tracking_resource_adaptor_impl::allocation_info |
| Allocation info type (pointer, size, optional stack trace). | |
| using | read_lock_t = detail::tracking_resource_adaptor_impl::read_lock_t |
| Shared-reader lock type used to protect the allocations map. | |
| using | write_lock_t = detail::tracking_resource_adaptor_impl::write_lock_t |
| Exclusive-writer lock type used to protect the allocations map. | |
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. More... | |
| device_async_resource_ref | get_upstream_resource () const noexcept |
| rmm::device_async_resource_ref to the upstream resource More... | |
| std::map< void *, allocation_info > const & | get_outstanding_allocations () const noexcept |
| Get the outstanding allocations map. More... | |
| std::size_t | get_allocated_bytes () const noexcept |
| Query the number of bytes currently allocated. More... | |
| std::string | get_outstanding_allocations_str () const |
| Gets a string describing all outstanding allocations (pointer, size, optional stack). More... | |
| 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. |
|
noexcept |
Query the number of bytes currently allocated.
|
noexcept |
Get the outstanding allocations map.
| std::string rmm::mr::tracking_resource_adaptor::get_outstanding_allocations_str | ( | ) | const |
Gets a string describing all outstanding allocations (pointer, size, optional stack).
|
noexcept |
rmm::device_async_resource_ref to the upstream resource