|
Mila
Deep Neural Network Library
|
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. | |
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.
|
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.
| TDevice | Compute device type (DeviceType::Cpu, DeviceType::Cuda, ...) |