Stub implementation for platforms without Vulkan support.
More...
|
| enum class | AllocationStrategy { DEVICE_LOCAL
, HOST_VISIBLE
, HOST_COHERENT
, STAGING_OPTIMAL
} |
| enum class | DevicePreference { DISCRETE_GPU
, INTEGRATED_GPU
, ANY_GPU
, HIGHEST_MEMORY
} |
|
|
| VulkanMemoryResource (DevicePreference=DevicePreference::DISCRETE_GPU, AllocationStrategy=AllocationStrategy::DEVICE_LOCAL) |
|
std::string | getDeviceInfo () const |
|
virtual | ~MemoryResource ()=default |
| | Virtual destructor for proper cleanup of derived classes.
|
|
|
static constexpr bool | is_device_accessible = false |
|
static constexpr bool | is_host_accessible = false |
| static constexpr bool | is_device_accessible = false |
| | Checks if the memory is accessible from device code.
|
| static constexpr bool | is_host_accessible = true |
| | Checks if the memory is accessible from host code.
|
|
| void * | do_allocate (std::size_t, std::size_t) override |
| | Allocates memory with specified size and alignment.
|
| void | do_deallocate (void *, std::size_t, std::size_t) override |
| | Deallocates previously allocated memory.
|
| bool | do_is_equal (const std::pmr::memory_resource &) const noexcept override |
| | Compares this memory resource with another for equality.
|
Stub implementation for platforms without Vulkan support.
◆ do_allocate()
| void * Mila::Dnn::Compute::VulkanMemoryResource::do_allocate |
( |
std::size_t | bytes, |
|
|
std::size_t | alignment ) |
|
inlineoverrideprotectedvirtual |
Allocates memory with specified size and alignment.
Pure virtual function that must be implemented by derived classes to provide device-specific memory allocation. Implementation should handle device-specific allocation strategies and error conditions.
- Parameters
-
| bytes | Number of bytes to allocate |
| alignment | Memory alignment requirement |
- Returns
- Pointer to allocated memory
- Exceptions
-
| std::bad_alloc | If allocation fails |
Implements Mila::Dnn::Compute::MemoryResource.
◆ do_deallocate()
| void Mila::Dnn::Compute::VulkanMemoryResource::do_deallocate |
( |
void * | ptr, |
|
|
std::size_t | bytes, |
|
|
std::size_t | alignment ) |
|
inlineoverrideprotectedvirtual |
Deallocates previously allocated memory.
Pure virtual function that must be implemented by derived classes to provide device-specific memory deallocation. Implementation should handle proper cleanup and device synchronization if necessary.
- Parameters
-
| ptr | Pointer to memory to deallocate |
| bytes | Size of memory block (may be used for debugging/validation) |
| alignment | Alignment that was used during allocation |
Implements Mila::Dnn::Compute::MemoryResource.
◆ do_is_equal()
| bool Mila::Dnn::Compute::VulkanMemoryResource::do_is_equal |
( |
const std::pmr::memory_resource & | other | ) |
const |
|
inlineoverrideprotectedvirtualnoexcept |
Compares this memory resource with another for equality.
Two memory resources are equal if they can be used interchangeably for allocation and deallocation. Typically this means they are the same type and manage the same underlying memory pool or device.
- Parameters
-
| other | The other memory resource to compare with |
- Returns
- true if the memory resources are equivalent
Implements Mila::Dnn::Compute::MemoryResource.
The documentation for this class was generated from the following file: