Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
CudaTensorDataType-Maps.ixx File Reference

CUDA-specific mappings between abstract TensorDataType and concrete CUDA native types. More...

#include <cstdint>
#include <cuda_fp16.h>
#include <cuda_bf16.h>
#include <cuda_fp8.h>
import Dnn.TensorDataType;

Classes

struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TDataType >
 Compile-time mapping from abstract TensorDataType -> CUDA native device type. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::BF16 >
 Maps TensorDataType::BF16 to CUDA __nv_bfloat16. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP16 >
 Maps TensorDataType::FP16 to CUDA __half. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP32 >
 Maps TensorDataType::FP32 to CUDA float. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP4_E2M1 >
 Maps TensorDataType::FP4_E2M1 to std::uint8_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP4_E3M0 >
 Maps TensorDataType::FP4_E3M0 to std::uint8_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP8_E4M3 >
 Maps TensorDataType::FP8_E4M3 to CUDA __nv_fp8_e4m3. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::FP8_E5M2 >
 Maps TensorDataType::FP8_E5M2 to CUDA __nv_fp8_e5m2. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::INT16 >
 Maps TensorDataType::INT16 to std::int16_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::INT32 >
 Maps TensorDataType::INT32 to std::int32_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::INT8 >
 Maps TensorDataType::INT8 to std::int8_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::UINT16 >
 Maps TensorDataType::UINT16 to std::uint16_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::UINT32 >
 Maps TensorDataType::UINT32 to std::uint32_t. More...
struct  Mila::Dnn::Compute::Cuda::TensorDataTypeMap< TensorDataType::UINT8 >
 Maps TensorDataType::UINT8 to std::uint8_t. More...

Namespaces

namespace  Mila
 Mila main API namespace.
namespace  Mila::Dnn
namespace  Mila::Dnn::Compute
namespace  Mila::Dnn::Compute::Cuda

Typedefs

template<TensorDataType TDataType>
using Mila::Dnn::Compute::Cuda::device_type_t = typename TensorDataTypeMap<TDataType>::device_type
 Convenience alias for accessing CUDA native type.

Detailed Description

CUDA-specific mappings between abstract TensorDataType and concrete CUDA native types.

This module provides compile-time mapping utilities used by CUDA tensor implementations:

  • TensorDataTypeMap<TensorDataType>: Maps an abstract tensor data type to the concrete CUDA native type used on-device (for kernel / device code).

The template is intentionally closed via explicit specializations. Instantiating the primary template for an unsupported type produces a readable static assertion.

Notes:

  • This file depends on CUDA headers for native device types (half, bfloat16, FP8).
  • Host type mappings are handled by the centralized TensorHostTypeMap module.