diff options
author | Ferran Balaguer <ferran.balaguer@arm.com> | 2019-08-07 15:14:56 +0100 |
---|---|---|
committer | Ferran Balaguer Arm <ferran.balaguer@arm.com> | 2019-08-20 14:31:07 +0000 |
commit | bfeb2711da172b26931c58af7b15d434ef49e24e (patch) | |
tree | 3516b24857effe4c98737f48026dabf75d1f360a /src/backends/reference/RefTensorHandleFactory.cpp | |
parent | aec942c3f258db46e0fb8054d39c0e7c3c411728 (diff) | |
download | armnn-bfeb2711da172b26931c58af7b15d434ef49e24e.tar.gz |
IVGCVSW-3606 Support memory import for Reference backend
Signed-off-by: Ferran Balaguer <ferran.balaguer@arm.com>
Change-Id: I94bd191f88e0911ad4e4727610e81cd7afa95512
Diffstat (limited to 'src/backends/reference/RefTensorHandleFactory.cpp')
-rw-r--r-- | src/backends/reference/RefTensorHandleFactory.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/backends/reference/RefTensorHandleFactory.cpp b/src/backends/reference/RefTensorHandleFactory.cpp new file mode 100644 index 0000000000..c97a779cb3 --- /dev/null +++ b/src/backends/reference/RefTensorHandleFactory.cpp @@ -0,0 +1,62 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "RefTensorHandleFactory.hpp" +#include "RefTensorHandle.hpp" + +#include <boost/core/ignore_unused.hpp> + +namespace armnn +{ + +using FactoryId = ITensorHandleFactory::FactoryId; + +const FactoryId& RefTensorHandleFactory::GetIdStatic() +{ + static const FactoryId s_Id(RefTensorHandleFactoryId()); + return s_Id; +} + +std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateSubTensorHandle(ITensorHandle& parent, + TensorShape const& subTensorShape, + unsigned int const* subTensorOrigin) const +{ + boost::ignore_unused(parent, subTensorShape, subTensorOrigin); + return nullptr; +} + +std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const +{ + return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags); +} + +std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo, + DataLayout dataLayout) const +{ + boost::ignore_unused(dataLayout); + return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags); +} + +const FactoryId& RefTensorHandleFactory::GetId() const +{ + return GetIdStatic(); +} + +bool RefTensorHandleFactory::SupportsSubTensors() const +{ + return false; +} + +MemorySourceFlags RefTensorHandleFactory::GetExportFlags() const +{ + return m_ExportFlags; +} + +MemorySourceFlags RefTensorHandleFactory::GetImportFlags() const +{ + return m_ImportFlags; +} + +} // namespace armnn
\ No newline at end of file |