class nbla::AllocatorMemory
-
class AllocatorMemory
A RAII class for Memory allocated by a Allocator class.Shared pointer of AllocatorMemory.
At a destructor, the borrowed Memory will be returned to a Allocator instance registered at a constructor.
Public Functions
-
inline size_t bytes() const
Get bytes.
See also
-
inline string device_id() const
Get device ID.
See also
-
inline void *pointer()
Get a raw pointer retaining a memory block defined in a Memory implementation class.
Constructor.
This is called from Allocator::alloc to wrap a Memory instance.
- Parameters:
memory – [in] A Memory instance wrapped.
allocator – [in] Used to return the wrapped memory to it when this instance is destroyed.
-
NBLA_API AllocatorMemory()
Constructor.
This is called to create an epmpty instance.
-
inline size_t bytes() const