|
Mila 0.13.48
Deep Neural Network Library
|
Type-erased execution context interface. More...

Public Member Functions | |
| virtual | ~IExecutionContext ()=default |
| virtual DeviceId | getDeviceId () const noexcept=0 |
| Get the device identifier. | |
| virtual void | synchronize ()=0 |
| Synchronize all pending operations. | |
Protected Member Functions | |
| IExecutionContext ()=default | |
Type-erased execution context interface.
Provides a minimal virtual interface for execution contexts. Specializations (CPU, CUDA, Metal, ROCm) inherit from this to enable polymorphic usage when the device type is not known at compile time.
For performance-critical code where the device type is known statically, use the templated ExecutionContext<TDeviceType> directly or cast_context<>() to avoid runtime overhead.
|
virtualdefault |
|
protecteddefault |


|
nodiscardpure virtualnoexcept |
Get the device identifier.
Implemented in Mila::Dnn::Compute::ExecutionContext< DeviceType::Cpu >, Mila::Dnn::Compute::ExecutionContext< DeviceType::Cuda >, Mila::Dnn::Compute::ExecutionContext< DeviceType::Metal >, and Mila::Dnn::Compute::ExecutionContext< DeviceType::Vulkan >.

|
pure virtual |
Synchronize all pending operations.
Blocks until all operations submitted to this context complete. For CPU contexts, this is typically a no-op.
Implemented in Mila::Dnn::Compute::ExecutionContext< DeviceType::Cpu >, Mila::Dnn::Compute::ExecutionContext< DeviceType::Cuda >, Mila::Dnn::Compute::ExecutionContext< DeviceType::Metal >, and Mila::Dnn::Compute::ExecutionContext< DeviceType::Vulkan >.

