24.02
|
Go to the documentation of this file.
15 class RefTensorHandleDecorator;
28 virtual void Manage()
override;
37 virtual const void*
Map(
bool )
const override;
40 virtual void Unmap()
const override
67 void CopyOutTo(
void*)
const override;
68 void CopyInFrom(
const void*)
override;
70 void* GetPointer()
const;
77 mutable std::shared_ptr<RefMemoryManager> m_MemoryManager;
79 mutable void* m_UnmanagedMemory;
80 void* m_ImportedMemory;
81 std::vector<std::shared_ptr<RefTensorHandleDecorator>> m_Decorated;
91 virtual void Manage()
override;
100 virtual const void*
Map(
bool )
const override;
131 void*
Map(
bool blocking=
true)
133 return const_cast<void*
>(
static_cast<const ITensorHandle*
>(
this)->
Map(blocking));
void CopyInFrom(const void *) override
virtual ITensorHandle * GetParent() const override
Get the parent tensor if this is a subtensor.
TensorShape GetShape() const override
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
virtual const void * Map(bool) const override
Map the tensor data for access.
virtual bool CanBeImported(void *memory, MemorySource source) override
Implementations must determine if this memory block can be imported.
virtual MemorySourceFlags GetImportFlags() const override
Get flags describing supported import sources.
unsigned int MemorySourceFlags
TensorShape GetUnpaddedTensorStrides(const TensorInfo &tensorInfo)
virtual void Unmap() const override
Unmap the tensor data.
virtual void Manage() override
Indicate to the memory manager that this resource is active.
virtual void Allocate() override
Indicate to the memory manager that this resource is no longer active.
void * Map(bool blocking=true)
Map the tensor data for access.
TensorShape GetShape() const override
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
virtual bool Import(void *memory, MemorySource source) override
Import externally allocated memory.
const TensorInfo & GetTensorInfo() const
virtual std::shared_ptr< ITensorHandle > DecorateTensorHandle(const TensorInfo &tensorInfo) override
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it.
virtual std::shared_ptr< ITensorHandle > DecorateTensorHandle(const TensorInfo &tensorInfo) override
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it.
RefTensorHandle(const TensorInfo &tensorInfo, std::shared_ptr< RefMemoryManager > &memoryManager)
virtual void Unmap() const override
Unmap the tensor data.
void CopyOutTo(void *) const override
Testing support to be able to verify and set tensor data content.
virtual ITensorHandle * GetParent() const override
Get the parent tensor if this is a subtensor.
void Unmap()
Unmap the tensor data that was previously mapped with call to Map().
void Unimport() override
Unimport externally allocated memory.
~RefTensorHandleDecorator()=default
virtual const void * Map(bool) const override
Map the tensor data for access.
const TensorShape & GetShape() const
TensorShape GetStrides() const override
Get the strides for each dimension ordered from largest to smallest where the smallest value is the s...
MemorySource
Define the Memory Source to reduce copies.
const TensorInfo & GetTensorInfo() const
virtual void Allocate() override
Indicate to the memory manager that this resource is no longer active.
Copyright (c) 2021 ARM Limited and Contributors.
virtual bool Import(void *memory, MemorySource source) override
Import externally allocated memory.
virtual void Manage() override
Indicate to the memory manager that this resource is active.
TensorShape GetStrides() const override
Get the strides for each dimension ordered from largest to smallest where the smallest value is the s...
RefTensorHandleDecorator(const TensorInfo &tensorInfo, const RefTensorHandle &parent)
virtual bool CanBeImported(void *memory, MemorySource source) override
Implementations must determine if this memory block can be imported.
virtual MemorySourceFlags GetImportFlags() const override
Get flags describing supported import sources.
virtual const void * Map(bool blocking=true) const =0
Map the tensor data for access.