A memory resource that allocates memory on a CUDA device.
More...
|
void * | do_allocate (std::size_t n, std::size_t alignment) override |
| Allocates memory on the CUDA device.
|
|
void | do_deallocate (void *ptr, std::size_t, std::size_t) override |
| Deallocates memory on the CUDA device.
|
|
bool | do_is_equal (const std::pmr::memory_resource &other) const noexcept override |
| Checks if this memory resource is equal to another memory resource.
|
|
A memory resource that allocates memory on a CUDA device.
◆ do_allocate()
void * Mila::Dnn::Compute::CudaMemoryResource::do_allocate |
( |
std::size_t |
n, |
|
|
std::size_t |
alignment |
|
) |
| |
|
inlineoverrideprotected |
Allocates memory on the CUDA device.
- 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::CudaMemoryResource::do_deallocate |
( |
void * |
ptr, |
|
|
std::size_t |
, |
|
|
std::size_t |
|
|
) |
| |
|
inlineoverrideprotected |
Deallocates memory on the CUDA device.
- Parameters
-
ptr | A pointer to the memory to deallocate. |
n | The size of the memory to deallocate. |
alignment | The alignment of the memory to deallocate. |
◆ do_is_equal()
bool Mila::Dnn::Compute::CudaMemoryResource::do_is_equal |
( |
const std::pmr::memory_resource & |
other | ) |
const |
|
inlineoverrideprotectednoexcept |
Checks if this memory resource is equal to another memory resource.
- Parameters
-
other | The other memory resource to compare to. |
- Returns
- true if the other memory resource is a CudaMemoryResource.
-
false otherwise.
◆ is_device_accessible
constexpr bool Mila::Dnn::Compute::CudaMemoryResource::is_device_accessible = DeviceAccessible::is_device_accessible |
|
staticconstexpr |
◆ is_host_accessible
constexpr bool Mila::Dnn::Compute::CudaMemoryResource::is_host_accessible = false |
|
staticconstexpr |
The documentation for this class was generated from the following file: