Memory resource that uses cudaMallocManaged/Free for allocation/deallocation.
More...
#include <managed_memory_resource.hpp>
|
|
| managed_memory_resource (managed_memory_resource const &)=default |
| | Default copy constructor.
|
|
| managed_memory_resource (managed_memory_resource &&)=default |
| | Default move constructor.
|
| managed_memory_resource & | operator= (managed_memory_resource const &)=default |
| | Default copy assignment operator.
|
| managed_memory_resource & | operator= (managed_memory_resource &&)=default |
| | Default move assignment operator.
|
| void * | allocate (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 (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.
|
| void * | allocate_sync (std::size_t bytes, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) |
| | Allocates memory of size at least bytes synchronously.
|
| 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.
|
| bool | operator== (managed_memory_resource const &) const noexcept |
| | Compare this resource to another.
|
| bool | operator!= (managed_memory_resource const &) const noexcept |
| | Compare this resource to another.
|
|
| void | get_property (managed_memory_resource const &, cuda::mr::device_accessible) noexcept |
| | Enables the cuda::mr::device_accessible property.
|
| void | get_property (managed_memory_resource const &, cuda::mr::host_accessible) noexcept |
| | Enables the cuda::mr::host_accessible property.
|
Memory resource that uses cudaMallocManaged/Free for allocation/deallocation.
◆ allocate()
| void * rmm::mr::managed_memory_resource::allocate |
( |
cuda::stream_ref | stream, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
nodiscard |
Allocates memory of size at least bytes.
The returned pointer will have at minimum 256 byte alignment.
The stream argument is ignored.
- Parameters
-
| stream | This argument is ignored |
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
- Returns
- void* Pointer to the newly allocated memory
◆ allocate_sync()
| void * rmm::mr::managed_memory_resource::allocate_sync |
( |
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
nodiscard |
Allocates memory of size at least bytes synchronously.
- Parameters
-
| bytes | The size of the allocation |
| alignment | The alignment of the allocation |
- Returns
- void* Pointer to the newly allocated memory
◆ deallocate()
| void rmm::mr::managed_memory_resource::deallocate |
( |
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.
The stream argument is ignored.
- Parameters
-
| stream | This argument is ignored |
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation. This must be equal to the value of bytes that was passed to the allocate call that returned ptr. |
| alignment | The alignment that was passed to the allocate call that returned ptr |
◆ deallocate_sync()
| void rmm::mr::managed_memory_resource::deallocate_sync |
( |
void * | ptr, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment = rmm::CUDA_ALLOCATION_ALIGNMENT ) |
|
noexcept |
Deallocate memory pointed to by ptr synchronously.
- Parameters
-
| ptr | Pointer to be deallocated |
| bytes | The size in bytes of the allocation |
| alignment | The alignment that was passed to the allocate call that returned ptr |
◆ operator!=()
| bool rmm::mr::managed_memory_resource::operator!= |
( |
managed_memory_resource const & | | ) |
const |
|
nodiscardnoexcept |
◆ operator=() [1/2]
| managed_memory_resource & rmm::mr::managed_memory_resource::operator= |
( |
managed_memory_resource && | | ) |
|
|
default |
◆ operator=() [2/2]
| managed_memory_resource & rmm::mr::managed_memory_resource::operator= |
( |
managed_memory_resource const & | | ) |
|
|
default |
◆ operator==()
| bool rmm::mr::managed_memory_resource::operator== |
( |
managed_memory_resource const & | | ) |
const |
|
nodiscardnoexcept |
◆ get_property [1/2]
| void get_property |
( |
managed_memory_resource const & | , |
|
|
cuda::mr::device_accessible | ) |
|
friend |
Enables the cuda::mr::device_accessible property.
This property declares that a managed_memory_resource provides device accessible memory
◆ get_property [2/2]
| void get_property |
( |
managed_memory_resource const & | , |
|
|
cuda::mr::host_accessible | ) |
|
friend |
Enables the cuda::mr::host_accessible property.
This property declares that a managed_memory_resource provides host accessible memory
The documentation for this class was generated from the following file: