A memory resource that allocates pinned (page-locked) memory using CUDA.
More...
|
void * | do_allocate (std::size_t n, std::size_t alignment=alignof(std::max_align_t)) override |
| Allocates pinned memory.
|
|
void | do_deallocate (void *ptr, std::size_t, std::size_t alignment=alignof(std::max_align_t)) override |
| Deallocates pinned 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 allocates pinned (page-locked) memory using CUDA.
◆ do_allocate()
void * Mila::Dnn::Compute::CudaPinnedMemoryResource::do_allocate |
( |
std::size_t |
n, |
|
|
std::size_t |
alignment = alignof(std::max_align_t) |
|
) |
| |
|
inlineoverrideprotected |
Allocates pinned memory.
- Parameters
-
n | The size of the memory to allocate. |
alignment | The alignment of the memory to allocate. |
- Returns
- void* Pointer to the allocated memory.
- Exceptions
-
std::bad_alloc | if the allocation fails. |
◆ do_deallocate()
void Mila::Dnn::Compute::CudaPinnedMemoryResource::do_deallocate |
( |
void * |
ptr, |
|
|
std::size_t |
, |
|
|
std::size_t |
alignment = alignof(std::max_align_t) |
|
) |
| |
|
inlineoverrideprotected |
Deallocates pinned memory.
- Parameters
-
ptr | 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::CudaPinnedMemoryResource::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 PinnedMemoryResource.
-
false otherwise.
◆ is_device_accessible
constexpr bool Mila::Dnn::Compute::CudaPinnedMemoryResource::is_device_accessible = DeviceAccessible::is_device_accessible |
|
staticconstexpr |
◆ is_host_accessible
constexpr bool Mila::Dnn::Compute::CudaPinnedMemoryResource::is_host_accessible = HostAccessible::is_host_accessible |
|
staticconstexpr |
The documentation for this class was generated from the following file: