Loading...
Searching...
No Matches
sam_headroom_memory_resource.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2024-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/sam_headroom_memory_resource_impl.hpp>
10
11#include <cuda/memory_resource>
12
13#include <cstddef>
14
15RMM_NAMESPACE_BEGIN
16namespace mr {
35class RMM_EXPORT sam_headroom_memory_resource final
36 : public cuda::mr::shared_resource<detail::sam_headroom_memory_resource_impl> {
37 using shared_base = cuda::mr::shared_resource<detail::sam_headroom_memory_resource_impl>;
38
39 public:
43 RMM_CONSTEXPR_FRIEND void get_property(sam_headroom_memory_resource const&,
44 cuda::mr::device_accessible) noexcept
45 {
46 }
47
51 RMM_CONSTEXPR_FRIEND void get_property(sam_headroom_memory_resource const&,
52 cuda::mr::host_accessible) noexcept
53 {
54 }
55
61 explicit sam_headroom_memory_resource(std::size_t headroom);
62
66 default;
68 default;
70 default;
72 default;
73};
74
75// static property checks
76static_assert(cuda::mr::synchronous_resource<sam_headroom_memory_resource>);
77static_assert(cuda::mr::resource<sam_headroom_memory_resource>);
78static_assert(
79 cuda::mr::synchronous_resource_with<sam_headroom_memory_resource, cuda::mr::device_accessible>);
80static_assert(
81 cuda::mr::synchronous_resource_with<sam_headroom_memory_resource, cuda::mr::host_accessible>);
82static_assert(cuda::mr::resource_with<sam_headroom_memory_resource, cuda::mr::device_accessible>);
83static_assert(cuda::mr::resource_with<sam_headroom_memory_resource, cuda::mr::host_accessible>);
84 // end of group
86} // namespace mr
87RMM_NAMESPACE_END
sam_headroom_memory_resource & operator=(sam_headroom_memory_resource &&)=default
Default move assignment operator.
sam_headroom_memory_resource(sam_headroom_memory_resource const &)=default
Default copy constructor.
friend void get_property(sam_headroom_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition sam_headroom_memory_resource.hpp:43
sam_headroom_memory_resource(std::size_t headroom)
Construct a headroom memory resource.
sam_headroom_memory_resource(sam_headroom_memory_resource &&)=default
Default move constructor.
friend void get_property(sam_headroom_memory_resource const &, cuda::mr::host_accessible) noexcept
Enables the cuda::mr::host_accessible property.
Definition sam_headroom_memory_resource.hpp:51
sam_headroom_memory_resource & operator=(sam_headroom_memory_resource const &)=default
Default copy assignment operator.