8 #include <rmm/detail/export.hpp>
10 #include <cuda/memory_resource>
11 #include <cuda/stream_ref>
15 namespace RMM_NAMESPACE {
48 void*
allocate([[maybe_unused]] cuda::stream_ref stream,
63 void deallocate([[maybe_unused]] cuda::stream_ref stream,
94 cuda::mr::device_accessible) noexcept
114 static_assert(cuda::mr::synchronous_resource<cuda_memory_resource>);
115 static_assert(cuda::mr::resource<cuda_memory_resource>);
117 cuda::mr::synchronous_resource_with<cuda_memory_resource, cuda::mr::device_accessible>);
118 static_assert(cuda::mr::resource_with<cuda_memory_resource, cuda::mr::device_accessible>);
Memory resource that uses cudaMalloc/Free for allocation/deallocation.
Definition: cuda_memory_resource.hpp:25
cuda_memory_resource(cuda_memory_resource const &)=default
Default copy constructor.
void * allocate([[maybe_unused]] cuda::stream_ref stream, std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT)
Allocates memory of size at least bytes.
void deallocate([[maybe_unused]] cuda::stream_ref stream, void *ptr, std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
Deallocate memory pointed to by ptr.
friend void get_property(cuda_memory_resource const &, cuda::mr::device_accessible) noexcept
Enables the cuda::mr::device_accessible property.
Definition: cuda_memory_resource.hpp:93
cuda_memory_resource & operator=(cuda_memory_resource const &)=default
Default copy assignment operator.
cuda_memory_resource & operator=(cuda_memory_resource &&)=default
Default move assignment operator.
bool operator==(cuda_memory_resource const &) const noexcept
Compare this resource to another.
cuda_memory_resource(cuda_memory_resource &&)=default
Default move constructor.
void deallocate_sync(void *ptr, std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
Deallocate memory pointed to by ptr synchronously.
void * allocate_sync(std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT)
Allocates memory of size at least bytes synchronously.
bool operator!=(cuda_memory_resource const &) const noexcept
Compare this resource to another.
static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT
Default alignment used for CUDA memory allocation.
Definition: aligned.hpp:25