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
binning_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/binning_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
30
class
RMM_EXPORT
binning_memory_resource
31
:
public
cuda::mr::shared_resource<detail::binning_memory_resource_impl> {
32
using
shared_base = cuda::mr::shared_resource<detail::binning_memory_resource_impl>;
33
34
public
:
40
RMM_CONSTEXPR_FRIEND
void
get_property
(
binning_memory_resource
const
&,
41
cuda::mr::device_accessible)
noexcept
42
{
43
}
44
53
explicit
binning_memory_resource
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream);
54
67
binning_memory_resource
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
68
int8_t min_size_exponent,
// NOLINT(bugprone-easily-swappable-parameters)
69
int8_t max_size_exponent);
70
71
~binning_memory_resource
() =
default
;
72
76
[[nodiscard]]
device_async_resource_ref
get_upstream_resource
() const noexcept;
77
93
void
add_bin
(std::
size_t
allocation_size,
94
std::optional<
device_async_resource_ref
> bin_resource = std::nullopt);
95
};
96
97
static_assert(cuda::
mr
::resource_with<
binning_memory_resource
, cuda::
mr
::device_accessible>,
98
"binning_memory_resource does not satisfy the cuda::mr::resource concept"
);
99
// end of group
101
}
// namespace mr
102
RMM_NAMESPACE_END
rmm::mr::binning_memory_resource::add_bin
void add_bin(std::size_t allocation_size, std::optional< device_async_resource_ref > bin_resource=std::nullopt)
Add a bin allocator to this resource.
rmm::mr::binning_memory_resource::binning_memory_resource
binning_memory_resource(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, int8_t min_size_exponent, int8_t max_size_exponent)
Construct a new binning memory resource object with a range of initial bins.
rmm::mr::binning_memory_resource::get_upstream_resource
device_async_resource_ref get_upstream_resource() const noexcept
device_async_resource_ref to the upstream resource
rmm::mr::binning_memory_resource::binning_memory_resource
binning_memory_resource(cuda::mr::any_resource< cuda::mr::device_accessible > upstream)
Construct a new binning memory resource object.
rmm::mr::binning_memory_resource::get_property
friend void get_property(binning_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition
binning_memory_resource.hpp:40
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