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

Utility functions for device context validation. More...

#include <memory>
#include <stdexcept>
#include <type_traits>
import Compute.DeviceType;
import Compute.DeviceContext;
import Compute.CudaDevice;
import Compute.ComputeDevice;

Namespaces

namespace  Mila
 
namespace  Mila::Dnn
 
namespace  Mila::Dnn::Compute
 

Functions

template<DeviceType TDeviceType>
std::shared_ptr< DeviceContextMila::Dnn::Compute::CreateCompatibleContext ()
 Creates a device context compatible with the specified device type.
 
template<DeviceType TDeviceType>
std::shared_ptr< DeviceContextMila::Dnn::Compute::ValidateContext (std::shared_ptr< DeviceContext > context)
 Validates that the provided context is compatible with the specified device type.
 

Detailed Description

Utility functions for device context validation.

This file defines utility functions for creating and validating device contexts that can be shared across different operation types.