34 return reinterpret_cast<const T*
>(m_Memory);
46 virtual const void*
Map(
bool )
const override {
return m_Memory; }
47 virtual void Unmap()
const override {}
62 void CopyOutTo(
void *)
const override {
ARMNN_ASSERT_MSG(
false,
"Unimplemented"); }
63 void CopyInFrom(
const void*)
override {
ARMNN_ASSERT_MSG(
false,
"Unimplemented"); }
73 const void* ConstTensorHandle::GetConstTensor<void>()
const;
83 return reinterpret_cast<T*
>(m_MutableMemory);
91 m_MutableMemory = mem;
99 void* m_MutableMemory;
103 void* TensorHandle::GetTensor<void>()
const;
125 void CopyOutTo(
void* memory)
const override;
126 void CopyInFrom(
const void* memory)
override;
129 void CopyFrom(
const void* srcMemory,
unsigned int numBytes);
184 , m_TensorHandle(
std::move(ptr)) {};
187 const void*
Map(
bool blocking =
true)
191 auto pRet = m_TensorHandle->Map(blocking);
223 if (m_Mapped && m_TensorHandle)
225 m_TensorHandle->Unmap();
232 return m_TensorHandle->GetTensorInfo();
242 std::shared_ptr<ConstTensorHandle> m_TensorHandle;
251 using PassthroughCpuTensorHandle
ARMNN_DEPRECATED_MSG(
"PassthroughCpuTensorHandle is deprecated, use " 253 using ConstPassthroughCpuTensorHandle
ARMNN_DEPRECATED_MSG(
"ConstPassthroughCpuTensorHandle is " 254 "deprecated, use ConstPassthroughTensorHandle "
virtual const void * Map(bool) const override
Map the tensor data for access.
const TensorShape & GetShape() const
ConstPassthroughTensorHandle(const TensorInfo &tensorInfo, const void *mem)
void SetMemory(void *mem)
virtual void Allocate()=0
Indicate to the memory manager that this resource is no longer active.
void SetConstMemory(const void *mem)
TensorShape GetShape() const override
Get the number of elements for each dimension ordered from slowest iterating dimension to fastest ite...
const TensorInfo & GetTensorInfo() const
Copyright (c) 2021 ARM Limited and Contributors.
const TensorInfo & GetTensorInfo() const
ConstTensorHandle(const TensorInfo &tensorInfo)
#define ARMNN_ASSERT_MSG(COND, MSG)
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
#define ARMNN_ASSERT(COND)
ManagedConstTensorHandle(std::shared_ptr< ConstTensorHandle > ptr)
TensorShape GetUnpaddedTensorStrides(const TensorInfo &tensorInfo)
virtual void Manage() override
Indicate to the memory manager that this resource is active.
~ManagedConstTensorHandle()
virtual void Unmap() const override
Unmap the tensor data.
Base class for all ArmNN exceptions so that users can filter to just those.
TensorShape GetStrides() const override
Get the strides for each dimension ordered from largest to smallest where the smallest value is the s...
PassthroughTensorHandle(const TensorInfo &tensorInfo, void *mem)
#define ARMNN_DEPRECATED_MSG(message)
virtual ITensorHandle * GetParent() const override
Get the parent tensor if this is a subtensor.
const void * Map(bool blocking=true)
RAII Managed resource Unmaps MemoryArea once out of scope.
const T * GetConstTensor() const