Mapping Struct
Scoped read/write window into a TensorBuffer. More...
Declaration
Included Headers
Public Constructors Index
| Mapping ()=default | |
|
Construct an empty (unmapped) Mapping; assignable from a real mapping later. More... | |
| Mapping (const Mapping &)=delete | |
|
Mappings are non-copyable: each Mapping uniquely owns its scope. More... | |
| Mapping (Mapping &&other) noexcept | |
|
Move-construct from another Mapping; the source becomes empty. More... | |
Public Destructor Index
| ~Mapping () | |
|
Destructor; runs unmap if set, releasing the mapping. More... | |
Public Operators Index
| Mapping & | operator= (const Mapping &)=delete |
|
Mappings are non-copy-assignable: each Mapping uniquely owns its scope. More... | |
| Mapping & | operator= (Mapping &&other) noexcept |
|
Move-assign from another Mapping; runs unmap on the prior contents first. More... | |
Public Member Attributes Index
| void * | data = ... |
|
Pointer to mapped memory (CPU-readable for the duration of the Mapping). More... | |
| std::size_t | size_bytes = 0 |
|
Size of the mapped region in bytes. More... | |
| std::function< void()> | unmap |
|
Cleanup callback invoked on destructor (cache flush, refcount decrement). More... | |
| std::shared_ptr< void > | keepalive |
|
Optional lifetime guard; ensures the underlying storage outlives the Mapping. More... | |
Description
Scoped read/write window into a TensorBuffer.
RAII: the destructor calls unmap (handling cache flush/sync). Move-only — a Mapping uniquely owns its mapping. Created by TensorBuffer::map(MapMode). Hold the Mapping while you read/write data; let it go out of scope to release.
Definition at line 350 of file TensorCore.h.
Public Constructors
Mapping()
| default |
Construct an empty (unmapped) Mapping; assignable from a real mapping later.
Definition at line 360 of file TensorCore.h.
Mapping()
| delete |
Mappings are non-copyable: each Mapping uniquely owns its scope.
Definition at line 362 of file TensorCore.h.
Mapping()
Public Operators
operator=()
| delete |
Mappings are non-copy-assignable: each Mapping uniquely owns its scope.
Definition at line 364 of file TensorCore.h.
operator=()
| inline noexcept |
Move-assign from another Mapping; runs unmap on the prior contents first.
Definition at line 370 of file TensorCore.h.
Public Member Attributes
data
|
Pointer to mapped memory (CPU-readable for the duration of the Mapping).
- Initialiser
-
= nullptr
Definition at line 351 of file TensorCore.h.
keepalive
|
Optional lifetime guard; ensures the underlying storage outlives the Mapping.
Definition at line 357 of file TensorCore.h.
size_bytes
|
Size of the mapped region in bytes.
Definition at line 353 of file TensorCore.h.
unmap
|
Cleanup callback invoked on destructor (cache flush, refcount decrement).
Definition at line 355 of file TensorCore.h.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.