TensorBuffer Struct
Storage handle for a tensor — opaque container for one of four backing memory kinds. More...
Declaration
Included Headers
Public Member Functions Index
| Mapping | map (MapMode mode) const |
|
Map the buffer for read/write access; returns a scoped Mapping. More... | |
Public Member Attributes Index
| StorageKind | kind = StorageKind::Unknown |
|
How the storage was acquired (CPU-owned, external, GstSample, device). More... | |
| Device | device {} |
|
Where the buffer is accessible. More... | |
| std::size_t | size_bytes = 0 |
|
Total backing-memory size in bytes. More... | |
| std::shared_ptr< void > | holder |
|
Lifetime guard (shared_ptr that owns/refcounts the underlying memory). More... | |
| void * | data = ... |
|
Optional direct pointer (some storage kinds set this; others rely on map_fn). More... | |
| std::function< Mapping(MapMode)> | map_fn |
|
Custom map function (set for non-trivial storage kinds). More... | |
| std::uint64_t | sima_mem_target_flags = ... |
|
SIMA memory target flags (advanced; for accelerator-aware allocators). More... | |
| std::uint64_t | sima_mem_flags = 0 |
|
SIMA memory flags (cache, alignment, etc.). More... | |
| std::vector< Segment > | sima_segments |
|
Named segments for multi-region buffers (composite formats, packed outputs). More... | |
Description
Storage handle for a tensor — opaque container for one of four backing memory kinds.
TensorBuffer is the abstraction over the four StorageKinds. The map_fn callback unifies the access path: regardless of where the bytes live (CPU heap, GStreamer pool, accelerator scratch), map(mode) returns a Mapping you can read or write. The holder shared_ptr keeps the underlying memory alive for the lifetime of the buffer (and any Mapping derived from it).
Multi-segment buffers (sima_segments) carry several named regions in one allocation — used for composite formats like NV12 (Y + UV) and packed multi-tensor MLA outputs.
Definition at line 503 of file TensorCore.h.