Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Compute::IExecutionContext Class Referenceabstractexport

Type-erased execution context interface. More...

Inheritance diagram for Mila::Dnn::Compute::IExecutionContext:

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

Detailed Description

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.

Examples
/__w/Mila/Mila/Mila/Src/Dnn/Components/Activations/Gelu/Gelu.ixx.

Constructor & Destructor Documentation

◆ ~IExecutionContext()

virtual Mila::Dnn::Compute::IExecutionContext::~IExecutionContext ( )
virtualdefault

◆ IExecutionContext()

Mila::Dnn::Compute::IExecutionContext::IExecutionContext ( )
protecteddefault
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ getDeviceId()

virtual DeviceId Mila::Dnn::Compute::IExecutionContext::getDeviceId ( ) const
nodiscardpure virtualnoexcept

◆ synchronize()

virtual void Mila::Dnn::Compute::IExecutionContext::synchronize ( )
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 >.

Examples
/__w/Mila/Mila/Mila/Src/Dnn/Components/Activations/Gelu/Gelu.ixx, and /__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/Softmax.ixx.
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: