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

Device-agnostic memory management layer for tensor data using abstract data types. More...

#include <memory>
#include <limits>
#include <iostream>
#include <stdexcept>
#include <type_traits>
#include <cstring>
#include <cstddef>
#include <cassert>
#include <string>
import Compute.MemoryResourceTracker;
import Compute.MemoryResource;
import Compute.CpuMemoryResource;
import Dnn.TensorDataTypeTraits;
import Dnn.TensorDataTypeMap;
import Dnn.TensorDataType;

Classes

class  Mila::Dnn::TensorBuffer< TDataType, TMemoryResource, TrackMemory >
 Device-agnostic buffer for storing tensor data with abstract type system. More...

Namespaces

namespace  Mila
 Mila main API namespace.

Detailed Description

Device-agnostic memory management layer for tensor data using abstract data types.

This module provides a sophisticated memory management system for tensor data that operates across heterogeneous compute environments (CPU, CUDA, Metal, Rocm) using abstract TensorDataType enumeration. The system handles device-specific alignment optimization and automatic memory resource selection based on data type compatibility constraints.

Key architectural features:

  • Abstract data type system eliminates device-specific compilation dependencies
  • Automatic memory alignment optimization for target hardware (SIMD, CUDA warps)
  • Device-agnostic memory operations with compile-time dispatch
  • Optional memory allocation tracking and profiling capabilities
  • Exception-safe memory management with strong guarantees