A memory resource that uses CUDA managed memory.
More...
|
void * | do_allocate (std::size_t n, std::size_t alignment=alignof(std::max_align_t)) override |
| Allocates memory using CUDA managed memory.
|
|
void | do_deallocate (void *ptr, std::size_t, std::size_t alignment=alignof(std::max_align_t)) override |
| Deallocates memory using CUDA managed memory.
|
|
bool | do_is_equal (const std::pmr::memory_resource &other) const noexcept override |
| Compares this memory resource with another for equality.
|
|
A memory resource that uses CUDA managed memory.
◆ do_allocate()
void * Mila::Dnn::Compute::CudaManagedMemoryResource::do_allocate |
( |
std::size_t |
n, |
|
|
std::size_t |
alignment = alignof(std::max_align_t) |
|
) |
| |
|
inlineoverrideprotected |
Allocates memory using CUDA managed memory.
- Parameters
-
n | The size of the memory to allocate. |
alignment | The alignment of the memory to allocate. |
- Returns
- void* A pointer to the allocated memory.
- Exceptions
-
std::bad_alloc | if the allocation fails. |
◆ do_deallocate()
void Mila::Dnn::Compute::CudaManagedMemoryResource::do_deallocate |
( |
void * |
ptr, |
|
|
std::size_t |
, |
|
|
std::size_t |
alignment = alignof(std::max_align_t) |
|
) |
| |
|
inlineoverrideprotected |
Deallocates memory using CUDA managed memory.
- Parameters
-
ptr | A pointer to the memory to deallocate. |
size | The size of the memory to deallocate. |
alignment | The alignment of the memory to deallocate. |
◆ do_is_equal()
bool Mila::Dnn::Compute::CudaManagedMemoryResource::do_is_equal |
( |
const std::pmr::memory_resource & |
other | ) |
const |
|
inlineoverrideprotectednoexcept |
Compares this memory resource with another for equality.
- Parameters
-
other | The other memory resource to compare with. |
- Returns
- true if the other memory resource is also a ManagedMemoryResource.
-
false otherwise.
◆ is_device_accessible
constexpr bool Mila::Dnn::Compute::CudaManagedMemoryResource::is_device_accessible = DeviceAccessible::is_device_accessible |
|
staticconstexpr |
◆ is_host_accessible
constexpr bool Mila::Dnn::Compute::CudaManagedMemoryResource::is_host_accessible = HostAccessible::is_host_accessible |
|
staticconstexpr |
The documentation for this class was generated from the following file: