18 #include <rmm/detail/cuda_memory_resource.hpp>
19 #include <rmm/detail/export.hpp>
20 #include <rmm/detail/nvtx/ranges.hpp>
24 namespace RMM_NAMESPACE {
79 void* allocate(std::
size_t bytes, std::
size_t alignment = alignof(std::max_align_t))
82 return do_allocate(bytes, alignment);
98 void deallocate(
void* ptr, std::size_t bytes, std::size_t alignment =
alignof(std::max_align_t))
101 do_deallocate(ptr, bytes, alignment);
118 return do_is_equal(other);
130 return do_is_equal(other);
142 return !do_is_equal(other);
165 virtual void* do_allocate(std::size_t bytes,
166 std::size_t alignment =
alignof(std::max_align_t)) = 0;
181 virtual void do_deallocate(
void* ptr,
183 std::size_t alignment =
alignof(std::max_align_t)) = 0;
199 return this == &other;
202 static_assert(cuda::mr::resource_with<host_memory_resource, cuda::mr::host_accessible>);
主机内存分配的基类。
定义:host_memory_resource.hpp:56
bool is_equal(host_memory_resource const &other) const noexcept
将此资源与另一个资源进行比较。
定义:host_memory_resource.hpp:116
host_memory_resource(host_memory_resource &&) noexcept=default
默认移动构造函数。
host_memory_resource(host_memory_resource const &)=default
默认复制构造函数。
bool operator==(host_memory_resource const &other) const noexcept
与另一个 host_memory_resource 的比较运算符。
定义:host_memory_resource.hpp:128
friend void get_property(host_memory_resource const &, cuda::mr::host_accessible) noexcept
启用 cuda::mr::host_accessible 属性。
定义:host_memory_resource.hpp:150
void deallocate(void *ptr, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
解除分配 ptr 指向的内存。
定义:host_memory_resource.hpp:98
bool operator!=(host_memory_resource const &other) const noexcept
与另一个 host_memory_resource 的比较运算符。
定义:host_memory_resource.hpp:140