|
Mila 0.13.48
Deep Neural Network Library
|
Stub implementation for platforms without Vulkan support. More...


Public Types | |
| enum class | AllocationStrategy { DEVICE_LOCAL , HOST_VISIBLE , HOST_COHERENT , STAGING_OPTIMAL } |
| enum class | DevicePreference { DISCRETE_GPU , INTEGRATED_GPU , ANY_GPU , HIGHEST_MEMORY } |
Public Member Functions | |
| VulkanMemoryResource (DevicePreference=DevicePreference::DISCRETE_GPU, AllocationStrategy=AllocationStrategy::DEVICE_LOCAL) | |
| std::string | getDeviceInfo () const |
| Public Member Functions inherited from Mila::Dnn::Compute::MemoryResource | |
| virtual | ~MemoryResource ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Static Public Attributes | |
| static constexpr bool | is_device_accessible = false |
| static constexpr bool | is_host_accessible = false |
| Static Public Attributes inherited from Mila::Dnn::Compute::MemoryResource | |
| 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. | |
Protected Member Functions | |
| 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.
|
strong |
|
strong |
|
inlineexplicit |
|
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.
| bytes | Number of bytes to allocate |
| alignment | Memory alignment requirement |
| std::bad_alloc | If allocation fails |
Implements Mila::Dnn::Compute::MemoryResource.
|
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.
| 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.
|
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.
| other | The other memory resource to compare with |
Implements Mila::Dnn::Compute::MemoryResource.
|
inline |
|
staticconstexpr |
|
staticconstexpr |