Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
ExecutionContext.ixx File Reference

Execution context framework for compute operations and stream management. More...

#include <cassert>
#include <string>
#include <stdexcept>
#include <format>
import Compute.DeviceType;
import Compute.CpuExecutionContext;
import Compute.DeviceId;
import Compute.ExecutionContextTraits.Cpu;
import Compute.ExecutionContextTraits;
import Compute.IExecutionContext;

Namespaces

namespace  Mila
 Mila main API namespace.

Typedefs

template<DeviceType TDeviceType>
using Mila::Dnn::Compute::ExecutionContext = typename ExecutionContextTraits<TDeviceType>::type
 The execution context for a device type.

Functions

template<DeviceType TDeviceType>
const ExecutionContext< TDeviceType > * Mila::Dnn::Compute::cast_context_ (const IExecutionContext *ctx) noexcept
template<DeviceType TDeviceType>
ExecutionContext< TDeviceType > * Mila::Dnn::Compute::cast_context_ (IExecutionContext *ctx) noexcept
template<DeviceType TDeviceType>
ExecutionContext< TDeviceType > * Mila::Dnn::Compute::validateExecutionContext_ (IExecutionContext *context, const std::string &op_name)

Detailed Description

Execution context framework for compute operations and stream management.

ExecutionContext manages execution streams, synchronization, and compute library handles across hardware platforms. Selecting the backend by device type at compile time gives type safety and eliminates runtime dispatch overhead.

Typedef Documentation

◆ ExecutionContext

template<DeviceType TDeviceType>
using Mila::Dnn::Compute::ExecutionContext = typename ExecutionContextTraits<TDeviceType>::type
export

The execution context for a device type.

Resolves to the backend's concrete context class – CpuExecutionContext, CudaExecutionContext – each of which implements IExecutionContext and adds the stream and library handles its backend needs.

Template Parameters
TDeviceTypeThe device type (Cpu, Cuda, ...).
Examples
/home/runner/work/Mila/Mila/Mila/Src/Dnn/Core/ComponentFactory.ixx, and /home/runner/work/Mila/Mila/Mila/Src/Dnn/Core/NetworkFactory.ixx.