Class MemoryManager

Class Documentation

class MemoryManager

Centralized allocator + transfer engine.

Features

  • allocate<T>(n) – aligned host allocation; may also create a device mirror.

  • to_device(ptr, bytes, stream) / to_host(ptr, bytes, stream) – async transfer or prefetch.

  • device_ptr(host_ptr) – returns device mirror when using explicit mirrors.

  • host_ptr(maybe_device) – returns owning host pointer for a device mirror.

  • release(ptr) – frees host/device memory and unregisters the block.

  • using_unified_memory() – compile‑time/runtime policy check.

Warning

Pointers are invalid after release. Views must not outlive the block.