7 #include <rmm/detail/export.hpp>
8 #include <rmm/mr/detail/fixed_size_memory_resource_impl.hpp>
11 #include <cuda/memory_resource>
15 namespace RMM_NAMESPACE {
32 :
public cuda::mr::shared_resource<detail::fixed_size_memory_resource_impl> {
33 using shared_base = cuda::mr::shared_resource<detail::fixed_size_memory_resource_impl>;
42 cuda::mr::device_accessible) noexcept
46 static constexpr std::size_t default_block_size = 1 << 20;
50 static constexpr std::size_t default_blocks_to_preallocate = 128;
64 cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
66 std::size_t block_size = default_block_size,
67 std::size_t blocks_to_preallocate = default_blocks_to_preallocate);
81 [[nodiscard]] std::
size_t get_block_size() const noexcept;
A memory resource which allocates memory blocks of a single fixed size.
Definition: fixed_size_memory_resource.hpp:32
friend void get_property(fixed_size_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition: fixed_size_memory_resource.hpp:41
fixed_size_memory_resource(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::size_t block_size=default_block_size, std::size_t blocks_to_preallocate=default_blocks_to_preallocate)
Construct a new fixed_size_memory_resource that allocates memory from upstream.
device_async_resource_ref get_upstream_resource() const noexcept
device_async_resource_ref to the upstream resource
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