22.02
|
#include <MockTensorHandle.hpp>
Public Member Functions | |
MockTensorHandle (const TensorInfo &tensorInfo, std::shared_ptr< MockMemoryManager > &memoryManager) | |
MockTensorHandle (const TensorInfo &tensorInfo, MemorySourceFlags importFlags) | |
~MockTensorHandle () override | |
void | Manage () override |
Indicate to the memory manager that this resource is active. More... | |
void | Allocate () override |
Indicate to the memory manager that this resource is no longer active. More... | |
ITensorHandle * | GetParent () const override |
Get the parent tensor if this is a subtensor. More... | |
const void * | Map (bool) const override |
Map the tensor data for access. More... | |
void | Unmap () const override |
Unmap the tensor data. More... | |
TensorShape | GetStrides () const override |
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... | |
TensorShape | GetShape () const override |
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension. More... | |
const TensorInfo & | GetTensorInfo () const |
MemorySourceFlags | GetImportFlags () const override |
Get flags describing supported import sources. More... | |
bool | Import (void *memory, MemorySource source) override |
Import externally allocated memory. More... | |
bool | CanBeImported (void *memory, MemorySource source) override |
Implementations must determine if this memory block can be imported. More... | |
Public Member Functions inherited from ITensorHandle | |
virtual | ~ITensorHandle () |
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 void | Unimport () |
Unimport externally allocated memory. More... | |
Definition at line 14 of file MockTensorHandle.hpp.
MockTensorHandle | ( | const TensorInfo & | tensorInfo, |
std::shared_ptr< MockMemoryManager > & | memoryManager | ||
) |
Definition at line 11 of file MockTensorHandle.cpp.
Referenced by MockTensorHandle::GetImportFlags().
MockTensorHandle | ( | const TensorInfo & | tensorInfo, |
MemorySourceFlags | importFlags | ||
) |
Definition at line 21 of file MockTensorHandle.cpp.
|
override |
Definition at line 30 of file MockTensorHandle.cpp.
|
overridevirtual |
Indicate to the memory manager that this resource is no longer active.
This is used to compute overlapping lifetimes of resources.
Implements ITensorHandle.
Definition at line 53 of file MockTensorHandle.cpp.
References TensorInfo::GetNumBytes().
|
overridevirtual |
Implementations must determine if this memory block can be imported.
This might be based on alignment or memory source type.
Reimplemented from ITensorHandle.
Definition at line 158 of file MockTensorHandle.cpp.
References TensorInfo::GetDataType(), armnn::GetDataTypeSize(), and armnn::Malloc.
Referenced by MockTensorHandle::GetImportFlags(), and MockTensorHandle::Import().
|
inlineoverridevirtual |
Get flags describing supported import sources.
Reimplemented from ITensorHandle.
Definition at line 53 of file MockTensorHandle.hpp.
References MockTensorHandle::CanBeImported(), MockTensorHandle::Import(), and MockTensorHandle::MockTensorHandle().
|
inlineoverridevirtual |
Get the parent tensor if this is a subtensor.
Implements ITensorHandle.
Definition at line 27 of file MockTensorHandle.hpp.
References MockTensorHandle::Map(), and ITensorHandle::Map().
|
inlineoverridevirtual |
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension.
Implements ITensorHandle.
Definition at line 43 of file MockTensorHandle.hpp.
References TensorInfo::GetShape().
|
inlineoverridevirtual |
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.
Implements ITensorHandle.
Definition at line 38 of file MockTensorHandle.hpp.
References armnn::GetUnpaddedTensorStrides().
|
inline |
Definition at line 48 of file MockTensorHandle.hpp.
|
overridevirtual |
Import externally allocated memory.
memory | base address of the memory being imported. |
source | source of the allocation for the memory being imported. |
Reimplemented from ITensorHandle.
Definition at line 114 of file MockTensorHandle.cpp.
References MockTensorHandle::CanBeImported(), and armnn::Malloc.
Referenced by MockTensorHandle::GetImportFlags().
|
overridevirtual |
Indicate to the memory manager that this resource is active.
This is used to compute overlapping lifetimes of resources.
Implements ITensorHandle.
Definition at line 42 of file MockTensorHandle.cpp.
References ARMNN_ASSERT_MSG, and TensorInfo::GetNumBytes().
|
overridevirtual |
Map the tensor data for access.
blocking | hint to block the calling thread until all other accesses are complete. (backend dependent) |
Implements ITensorHandle.
Definition at line 79 of file MockTensorHandle.cpp.
References ARMNN_ASSERT, and TensorInfo::GetNumBytes().
Referenced by MockTensorHandle::GetParent().
|
inlineoverridevirtual |
Unmap the tensor data.
Implements ITensorHandle.
Definition at line 35 of file MockTensorHandle.hpp.