12 #include <cuda/memory_resource>
16 #include <rapidsmpf/detail/rmm_resource_adaptor_impl.hpp>
17 #include <rapidsmpf/memory/scoped_memory_record.hpp>
32 :
public cuda::mr::shared_resource<detail::RmmResourceAdaptorImpl> {
33 using shared_base = cuda::mr::shared_resource<detail::RmmResourceAdaptorImpl>;
48 cuda::mr::any_resource<cuda::mr::device_accessible> primary_mr,
49 std::optional<cuda::mr::any_resource<cuda::mr::device_accessible>> fallback_mr =
125 static_assert(cuda::mr::resource_with<
RmmResourceAdaptor, cuda::mr::device_accessible>);
A RMM memory resource adaptor tailored to RapidsMPF.
void begin_scoped_memory_record()
Begin recording a new scoped memory usage record for the current thread.
ScopedMemoryRecord get_main_record() const
Returns a copy of the main memory record.
std::int64_t current_allocated() const noexcept
Get the total current allocated memory from both primary and fallback.
rmm::device_async_resource_ref get_upstream_resource() const noexcept
Get a reference to the primary upstream resource.
std::optional< rmm::device_async_resource_ref > get_fallback_resource() const noexcept
Get a reference to the fallback upstream resource.
ScopedMemoryRecord end_scoped_memory_record()
End the current scoped memory record and return it.
RmmResourceAdaptor(cuda::mr::any_resource< cuda::mr::device_accessible > primary_mr, std::optional< cuda::mr::any_resource< cuda::mr::device_accessible >> fallback_mr=std::nullopt)
Construct with specified primary and optional fallback memory resource.
friend void get_property(RmmResourceAdaptor const &, cuda::mr::device_accessible) noexcept
Tag this resource as device-accessible for the CCCL concept.
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
RAPIDS Multi-Processor interfaces.
Memory statistics for a specific scope.