18 #include <rmm/detail/cuda_memory_resource.hpp>
19 #include <rmm/detail/export.hpp>
20 #include <rmm/detail/nvtx/ranges.hpp>
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);
101 std::size_t alignment =
alignof(std::max_align_t)) noexcept
104 do_deallocate(ptr, bytes, alignment);
121 return do_is_equal(other);
133 return do_is_equal(other);
145 return !do_is_equal(other);
168 virtual void* do_allocate(std::size_t bytes,
169 std::size_t alignment =
alignof(std::max_align_t)) = 0;
184 virtual void do_deallocate(
void* ptr,
186 std::size_t alignment =
alignof(std::max_align_t)) noexcept = 0;
202 return this == &other;
205 #if CCCL_MAJOR_VERSION > 3 || (CCCL_MAJOR_VERSION == 3 && CCCL_MINOR_VERSION >= 1)
220 void* allocate_sync(std::size_t bytes, std::size_t alignment)
222 return allocate(bytes, alignment);
238 void deallocate_sync(
void* ptr, std::size_t bytes, std::size_t alignment)
240 return deallocate(ptr, bytes, alignment);
248 rmm::detail::polyfill::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:119
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:131
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:153
bool operator!=(host_memory_resource const &other) const noexcept
Comparison operator with another host_memory_resource.
Definition: host_memory_resource.hpp:143
void deallocate(void *ptr, std::size_t bytes, std::size_t alignment=alignof(std::max_align_t)) noexcept
Deallocate memory pointed to by ptr.
Definition: host_memory_resource.hpp:99