Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::TensorHostTypeMap< TDataType > Struct Template Referenceexport

Maps abstract TensorDataType to host-compatible C++ type and TensorDataType. More...

Detailed Description

template<TensorDataType TDataType>
struct Mila::Dnn::TensorHostTypeMap< TDataType >

Maps abstract TensorDataType to host-compatible C++ type and TensorDataType.

Defines the preferred host-side type and corresponding TensorDataType for each abstract tensor data type, used for host-device conversions, fill operations, and host-side processing. This mapping preserves type characteristics where possible while ensuring host compatibility.

Design decisions:

  • Floating-point device types (FP16, BF16, FP8) map to float for host compatibility
  • Integer types map to their corresponding fixed-width standard types
  • Maintains precision and signedness characteristics of original types
  • Provides direct host representation for device-agnostic operations
Template Parameters
TDataTypeAbstract tensor data type from TensorDataType enumeration
Note
This is a closed template - only explicit specializations are valid
Host types are device-agnostic and consistent across all compute backends
Instantiating the primary template produces a clear compile-time error

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