24.02
|
#include <ITensorHandle.hpp>
Public Member Functions | |
virtual | ~ITensorHandle () |
virtual void | Manage ()=0 |
Indicate to the memory manager that this resource is active. More... | |
virtual void | Allocate ()=0 |
Indicate to the memory manager that this resource is no longer active. More... | |
virtual ITensorHandle * | GetParent () const =0 |
Get the parent tensor if this is a subtensor. More... | |
virtual const void * | Map (bool blocking=true) const =0 |
Map the tensor data for access. More... | |
virtual void | Unmap () const =0 |
Unmap the tensor data. More... | |
void * | Map (bool blocking=true) |
Map the tensor data for access. More... | |
void | Unmap () |
Unmap the tensor data that was previously mapped with call to Map(). More... | |
virtual TensorShape | GetStrides () const =0 |
Get the strides for each dimension ordered from largest to smallest where the smallest value is the same as the size of a single element in the tensor. More... | |
virtual TensorShape | GetShape () const =0 |
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension. More... | |
virtual void | CopyOutTo (void *memory) const =0 |
Testing support to be able to verify and set tensor data content. More... | |
virtual void | CopyInFrom (const void *memory)=0 |
virtual unsigned int | GetImportFlags () const |
Get flags describing supported import sources. More... | |
virtual bool | Import (void *memory, MemorySource source) |
Import externally allocated memory. More... | |
virtual bool | CanBeImported (void *memory, MemorySource source) |
Implementations must determine if this memory block can be imported. More... | |
virtual void | Unimport () |
Unimport externally allocated memory. More... | |
virtual std::shared_ptr< ITensorHandle > | DecorateTensorHandle (const TensorInfo &tensorInfo) |
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it. More... | |
Definition at line 16 of file ITensorHandle.hpp.
|
inlinevirtual |
Definition at line 19 of file ITensorHandle.hpp.
|
pure virtual |
Indicate to the memory manager that this resource is no longer active.
This is used to compute overlapping lifetimes of resources.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, ConstPassthroughTensorHandle, PassthroughTensorHandle, ScopedTensorHandle, RefTensorHandleDecorator, NeonTensorHandle, ClTensorHandle, ClImportTensorHandle, GpuFsaTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by AllocateAndCopyDataToITensorHandle(), and Graph::AllocateDynamicBuffers().
|
inlinevirtual |
Implementations must determine if this memory block can be imported.
This might be based on alignment or memory source type.
Reimplemented in ClTensorHandle, RefTensorHandleDecorator, NeonTensorHandle, RefTensorHandle, TosaRefTensorHandle, GpuFsaTensorHandle, and ClImportTensorHandle.
Definition at line 86 of file ITensorHandle.hpp.
References armnn::IgnoreUnused().
|
pure virtual |
Implemented in RefTensorHandleDecorator.
Referenced by CopyDataToITensorHandle().
|
pure virtual |
Testing support to be able to verify and set tensor data content.
Implemented in RefTensorHandleDecorator.
Referenced by CopyDataFromITensorHandle().
|
inlinevirtual |
Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it.
tensorInfo | the overidden TensorInfo. |
Reimplemented in NeonTensorHandle, ClTensorHandle, RefTensorHandleDecorator, RefTensorHandle, NeonTensorHandleDecorator, and NeonSubTensorHandle.
Definition at line 98 of file ITensorHandle.hpp.
References armnn::IgnoreUnused().
|
inlinevirtual |
Get flags describing supported import sources.
Reimplemented in RefTensorHandleDecorator, ClTensorHandle, GpuFsaTensorHandle, NeonTensorHandle, ClImportTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Definition at line 70 of file ITensorHandle.hpp.
Referenced by LoadedNetwork::ImportInputs(), and LoadedNetwork::ImportOutputs().
|
pure virtual |
Get the parent tensor if this is a subtensor.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, RefTensorHandleDecorator, ClTensorHandle, GpuFsaTensorHandle, NeonTensorHandle, ClImportTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by Graph::AllocateDynamicBuffers().
|
pure virtual |
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, RefTensorHandleDecorator, ClTensorHandle, GpuFsaTensorHandle, NeonTensorHandle, ClImportTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by armnn::CopyTensorContentsGeneric(), and armnnUtils::FindMinMax().
|
pure virtual |
Get the strides for each dimension ordered from largest to smallest where the smallest value is the same as the size of a single element in the tensor.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, RefTensorHandleDecorator, ClTensorHandle, GpuFsaTensorHandle, NeonTensorHandle, ClImportTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by armnn::CopyTensorContentsGeneric().
|
inlinevirtual |
Import externally allocated memory.
memory | base address of the memory being imported. |
source | source of the allocation for the memory being imported. |
Reimplemented in NeonTensorHandle, ClTensorHandle, RefTensorHandleDecorator, ClImportTensorHandle, RefTensorHandle, TosaRefTensorHandle, SampleTensorHandle, and GpuFsaTensorHandle.
Definition at line 76 of file ITensorHandle.hpp.
References armnn::IgnoreUnused().
Referenced by LoadedNetwork::ImportInputs(), and LoadedNetwork::ImportOutputs().
|
pure virtual |
Indicate to the memory manager that this resource is active.
This is used to compute overlapping lifetimes of resources.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, RefTensorHandleDecorator, NeonTensorHandle, ClTensorHandle, GpuFsaTensorHandle, ClImportTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by Graph::AllocateDynamicBuffers().
|
inline |
Map the tensor data for access.
Must be paired with call to Unmap().
blocking | hint to block the calling thread until all other accesses are complete. (backend dependent) |
Definition at line 44 of file ITensorHandle.hpp.
References ITensorHandle::Map().
|
pure virtual |
Map the tensor data for access.
blocking | hint to block the calling thread until all other accesses are complete. (backend dependent) |
Implemented in NeonTensorHandleDecorator, NeonSubTensorHandle, RefTensorHandleDecorator, NeonTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, SampleTensorHandle, ClTensorHandleDecorator, ClImportSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, ClTensorHandle, GpuFsaTensorHandle, and ClImportTensorHandle.
Referenced by armnn::CopyTensorContentsGeneric(), SyncMemGenericWorkload::Execute(), armnnUtils::FindMinMax(), sdb::GetInputTensorData(), armnn::GetInputTensorData(), sdb::GetOutputTensorData(), armnn::GetOutputTensorData(), armnn::InitializeArmComputeTensorData(), ITensorHandle::Map(), armnn::MirrorPad(), and armnn::Pad().
|
inlinevirtual |
Unimport externally allocated memory.
Reimplemented in RefTensorHandleDecorator.
Definition at line 93 of file ITensorHandle.hpp.
|
inline |
Unmap the tensor data that was previously mapped with call to Map().
Definition at line 50 of file ITensorHandle.hpp.
References ITensorHandle::Unmap().
|
pure virtual |
Unmap the tensor data.
Implemented in NeonTensorHandleDecorator, ClTensorHandleDecorator, ClImportSubTensorHandle, NeonSubTensorHandle, ClSubTensorHandle, GpuFsaSubTensorHandle, RefTensorHandleDecorator, NeonTensorHandle, ClTensorHandle, GpuFsaTensorHandle, ClImportTensorHandle, ConstTensorHandle, RefTensorHandle, TosaRefTensorHandle, and SampleTensorHandle.
Referenced by armnn::CopyTensorContentsGeneric(), SyncMemGenericWorkload::Execute(), armnnUtils::FindMinMax(), and ITensorHandle::Unmap().