Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
TensorOps-Base.ixx File Reference

The device-dispatched entry point for tensor operations. More...

Namespaces

namespace  Mila
 Mila main API namespace.

Typedefs

template<Compute::DeviceType TDevice>
using Mila::Dnn::TensorOps = typename TensorOpsTraits<TDevice>::type
 Device-dispatched tensor operations.

Detailed Description

The device-dispatched entry point for tensor operations.

Declares the TensorOps alias template that resolves a device type to its backend implementation through Dnn::TensorOpsTraits.

Typedef Documentation

◆ TensorOps

template<Compute::DeviceType TDevice>
using Mila::Dnn::TensorOps = typename TensorOpsTraits<TDevice>::type
export

Device-dispatched tensor operations.

Resolves to the backend implementation for a device – CpuTensorOps, CudaTensorOps – each of which supplies the elementwise, reduction, copy and fill operations the device-neutral entry points in Dnn.TensorOps dispatch to.

A backend is added by defining its operations class and binding it in a traits module of its own: template<> struct TensorOpsTraits<DeviceType::X> { using type = XTensorOps; };. Backends respect host/device accessibility – CPU on host-accessible memory, CUDA on device memory.

Template Parameters
TDeviceCompute device type (DeviceType::Cpu, DeviceType::Cuda, ...)