18 #include <rmm/detail/export.hpp>
19 #include <rmm/detail/nvtx/ranges.hpp>
21 #include <cuda/memory_resource>
25 namespace RMM_NAMESPACE {
80 void* allocate(std::
size_t bytes, std::
size_t alignment = alignof(std::max_align_t))
83 return do_allocate(bytes, alignment);
99 void deallocate(
void* ptr, std::size_t bytes, std::size_t alignment =
alignof(std::max_align_t))
102 do_deallocate(ptr, bytes, alignment);
119 return do_is_equal(other);
131 return do_is_equal(other);
143 return !do_is_equal(other);
166 virtual void* do_allocate(std::size_t bytes,
167 std::size_t alignment =
alignof(std::max_align_t)) = 0;
182 virtual void do_deallocate(
void* ptr,
184 std::size_t alignment =
alignof(std::max_align_t)) = 0;
200 return this == &other;
203 static_assert(cuda::mr::resource_with<host_memory_resource, cuda::mr::host_accessible>);
Base class for host memory allocation.
Definition: host_memory_resource.hpp:57
bool is_equal(host_memory_resource const &other) const noexcept
Compare this resource to another.
Definition: host_memory_resource.hpp:117
host_memory_resource(host_memory_resource &&) noexcept=default
Default move constructor.
host_memory_resource(host_memory_resource const &)=default
Default copy constructor.
bool operator==(host_memory_resource const &other) const noexcept
Comparison operator with another host_memory_resource.
Definition: host_memory_resource.hpp:129
friend void get_property(host_memory_resource const &, cuda::mr::host_accessible) noexcept
Enables the cuda::mr::host_accessible property.
Definition: host_memory_resource.hpp:151
void deallocate(void *ptr, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t))
Deallocate memory pointed to by ptr.
Definition: host_memory_resource.hpp:99
bool operator!=(host_memory_resource const &other) const noexcept
Comparison operator with another host_memory_resource.
Definition: host_memory_resource.hpp:141