Home
librmm
libucxx
ucxx
nightly (26.12)
nightly (26.12)
stable (26.10)
legacy (26.08)
Toggle main menu visibility
Loading...
Searching...
No Matches
include
rmm
mr
pool_memory_resource.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
#pragma once
6
7
#include <rmm/detail/export.hpp>
8
#include <rmm/mr/detail/pool_memory_resource_impl.hpp>
9
#include <
rmm/resource_ref.hpp
>
10
11
#include <cuda/memory_resource>
12
13
#include <cstddef>
14
#include <optional>
15
16
RMM_NAMESPACE_BEGIN
17
namespace
mr {
23
34
class
RMM_EXPORT
pool_memory_resource
35
:
public
cuda::mr::shared_resource<detail::pool_memory_resource_impl> {
36
using
shared_base = cuda::mr::shared_resource<detail::pool_memory_resource_impl>;
37
38
public
:
44
RMM_CONSTEXPR_FRIEND
void
get_property
(
pool_memory_resource
const
&,
45
cuda::mr::device_accessible)
noexcept
46
{
47
}
48
62
explicit
pool_memory_resource
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
63
std::size_t initial_pool_size,
64
std::optional<std::size_t> maximum_pool_size = std::nullopt);
65
69
[[nodiscard]]
device_async_resource_ref
get_upstream_resource
() const noexcept;
70
78
[[nodiscard]] std::
size_t
pool_size
() const noexcept;
79
};
80
81
static_assert(cuda::
mr
::resource_with<
pool_memory_resource
, cuda::
mr
::device_accessible>,
82
"pool_memory_resource does not satisfy the cuda::mr::resource concept"
);
83
// end of group
85
}
// namespace mr
86
RMM_NAMESPACE_END
rmm::mr::pool_memory_resource::pool_memory_resource
pool_memory_resource(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::size_t initial_pool_size, std::optional< std::size_t > maximum_pool_size=std::nullopt)
Construct a pool_memory_resource and allocate the initial device memory pool using upstream.
rmm::mr::pool_memory_resource::get_upstream_resource
device_async_resource_ref get_upstream_resource() const noexcept
rmm::device_async_resource_ref to the upstream resource
rmm::mr::pool_memory_resource::get_property
friend void get_property(pool_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition
pool_memory_resource.hpp:44
rmm::mr::pool_memory_resource::pool_size
std::size_t pool_size() const noexcept
Computes the size of the current pool.
rmm::device_async_resource_ref
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
rmm::mr
Memory Resource classes and adaptors.
resource_ref.hpp
Generated by
1.18.0