Loading...
Searching...
No Matches
cuda_async_managed_memory_resource.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 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/cuda_async_managed_memory_resource_impl.hpp>
10
11#include <cuda/memory_resource>
12#include <cuda_runtime_api.h>
13
14#include <cstddef>
15
16RMM_NAMESPACE_BEGIN
17namespace mr {
23
29 : public cuda::mr::shared_resource<detail::cuda_async_managed_memory_resource_impl> {
30 using shared_base = cuda::mr::shared_resource<detail::cuda_async_managed_memory_resource_impl>;
31
32 public:
36 RMM_CONSTEXPR_FRIEND void get_property(cuda_async_managed_memory_resource const&,
37 cuda::mr::device_accessible) noexcept
38 {
39 }
40
44 RMM_CONSTEXPR_FRIEND void get_property(cuda_async_managed_memory_resource const&,
45 cuda::mr::host_accessible) noexcept
46 {
47 }
48
62
68 [[nodiscard]] cudaMemPool_t pool_handle() const noexcept;
69
72 default;
74 default;
76 default;
78 default;
79};
80
81// static property checks
82static_assert(cuda::mr::synchronous_resource<cuda_async_managed_memory_resource>);
83static_assert(cuda::mr::resource<cuda_async_managed_memory_resource>);
84static_assert(cuda::mr::synchronous_resource_with<cuda_async_managed_memory_resource,
85 cuda::mr::device_accessible>);
86static_assert(cuda::mr::synchronous_resource_with<cuda_async_managed_memory_resource,
87 cuda::mr::host_accessible>);
88static_assert(
89 cuda::mr::resource_with<cuda_async_managed_memory_resource, cuda::mr::device_accessible>);
90static_assert(
91 cuda::mr::resource_with<cuda_async_managed_memory_resource, cuda::mr::host_accessible>);
92 // end of group
94} // namespace mr
95RMM_NAMESPACE_END
cuda_async_managed_memory_resource()
Constructs a cuda_async_managed_memory_resource with the default managed memory pool for the current ...
cudaMemPool_t pool_handle() const noexcept
Returns the underlying native handle to the CUDA pool.
friend void get_property(cuda_async_managed_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition cuda_async_managed_memory_resource.hpp:36
friend void get_property(cuda_async_managed_memory_resource const &, cuda::mr::host_accessible) noexcept
Enables the cuda::mr::host_accessible property.
Definition cuda_async_managed_memory_resource.hpp:44
Memory Resource classes and adaptors.