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
aligned_resource_adaptor.hpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
* SPDX-License-Identifier: Apache-2.0
4
*/
5
#pragma once
6
7
#include <
rmm/aligned.hpp
>
8
#include <rmm/detail/export.hpp>
9
#include <rmm/mr/detail/aligned_resource_adaptor_impl.hpp>
10
#include <
rmm/resource_ref.hpp
>
11
12
#include <cuda/memory_resource>
13
14
#include <cstddef>
15
16
RMM_NAMESPACE_BEGIN
17
namespace
mr {
33
class
RMM_EXPORT
aligned_resource_adaptor
34
:
public
cuda::mr::shared_resource<detail::aligned_resource_adaptor_impl> {
35
using
shared_base = cuda::mr::shared_resource<detail::aligned_resource_adaptor_impl>;
36
37
public
:
41
RMM_CONSTEXPR_FRIEND
void
get_property
(
aligned_resource_adaptor
const
&,
42
cuda::mr::device_accessible)
noexcept
43
{
44
}
45
49
static
constexpr
std::size_t
default_alignment_threshold
=
50
detail::aligned_resource_adaptor_impl::default_alignment_threshold;
51
62
explicit
aligned_resource_adaptor
(cuda::mr::any_resource<cuda::mr::device_accessible> upstream,
63
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
64
std::size_t alignment = rmm::CUDA_ALLOCATION_ALIGNMENT,
65
std::size_t alignment_threshold =
default_alignment_threshold
);
66
67
~aligned_resource_adaptor
() =
default
;
68
72
[[nodiscard]]
device_async_resource_ref
get_upstream_resource
() const noexcept;
73
};
74
75
static_assert(cuda::
mr
::resource_with<
aligned_resource_adaptor
, cuda::
mr
::device_accessible>,
76
"aligned_resource_adaptor does not satisfy the cuda::mr::resource concept"
);
77
// end of group
79
}
// namespace mr
80
RMM_NAMESPACE_END
aligned.hpp
rmm::mr::aligned_resource_adaptor::get_upstream_resource
device_async_resource_ref get_upstream_resource() const noexcept
rmm::device_async_resource_ref to the upstream resource
rmm::mr::aligned_resource_adaptor::get_property
friend void get_property(aligned_resource_adaptor const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition
aligned_resource_adaptor.hpp:41
rmm::mr::aligned_resource_adaptor::default_alignment_threshold
static constexpr std::size_t default_alignment_threshold
The default alignment threshold used by the adaptor (0 = always align).
Definition
aligned_resource_adaptor.hpp:49
rmm::mr::aligned_resource_adaptor::aligned_resource_adaptor
aligned_resource_adaptor(cuda::mr::any_resource< cuda::mr::device_accessible > upstream, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT, std::size_t alignment_threshold=default_alignment_threshold)
Construct an aligned resource adaptor using upstream to satisfy allocation requests.
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