8 #include <rmm/detail/export.hpp>
9 #include <rmm/mr/detail/limiting_resource_adaptor_impl.hpp>
12 #include <cuda/memory_resource>
16 namespace RMM_NAMESPACE {
36 :
public cuda::mr::shared_resource<detail::limiting_resource_adaptor_impl> {
37 using shared_base = cuda::mr::shared_resource<detail::limiting_resource_adaptor_impl>;
44 cuda::mr::device_accessible) noexcept
57 std::size_t allocation_limit,
76 [[nodiscard]] std::
size_t get_allocated_bytes() const;
85 [[nodiscard]] std::
size_t get_allocation_limit() const;
Resource that uses an upstream resource to allocate memory and limits the total allocations possible.
Definition: limiting_resource_adaptor.hpp:36
limiting_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::size_t allocation_limit, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT)
Construct a new limiting resource adaptor using upstream to satisfy allocation requests and limiting ...
device_async_resource_ref get_upstream_resource() const noexcept
device_async_resource_ref to the upstream resource
friend void get_property(limiting_resource_adaptor const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition: limiting_resource_adaptor.hpp:43
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
Alias for a cuda::mr::resource_ref with the property cuda::mr::device_accessible.
Definition: resource_ref.hpp:30
static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT
Default alignment used for CUDA memory allocation.
Definition: aligned.hpp:25