blob: c97a779cb362be4e6191d81e63570c41561f9f67 [file] [log] [blame]
Ferran Balaguerbfeb2712019-08-07 15:14:56 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "RefTensorHandleFactory.hpp"
7#include "RefTensorHandle.hpp"
8
9#include <boost/core/ignore_unused.hpp>
10
11namespace armnn
12{
13
14using FactoryId = ITensorHandleFactory::FactoryId;
15
16const FactoryId& RefTensorHandleFactory::GetIdStatic()
17{
18 static const FactoryId s_Id(RefTensorHandleFactoryId());
19 return s_Id;
20}
21
22std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateSubTensorHandle(ITensorHandle& parent,
23 TensorShape const& subTensorShape,
24 unsigned int const* subTensorOrigin) const
25{
26 boost::ignore_unused(parent, subTensorShape, subTensorOrigin);
27 return nullptr;
28}
29
David Monahanc6e5a6e2019-10-02 09:33:57 +010030std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const
Ferran Balaguerbfeb2712019-08-07 15:14:56 +010031{
32 return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
33}
34
35std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo,
David Monahanc6e5a6e2019-10-02 09:33:57 +010036 DataLayout dataLayout) const
Ferran Balaguerbfeb2712019-08-07 15:14:56 +010037{
David Monahanc6e5a6e2019-10-02 09:33:57 +010038 boost::ignore_unused(dataLayout);
Ferran Balaguerbfeb2712019-08-07 15:14:56 +010039 return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
40}
41
42const FactoryId& RefTensorHandleFactory::GetId() const
43{
44 return GetIdStatic();
45}
46
47bool RefTensorHandleFactory::SupportsSubTensors() const
48{
49 return false;
50}
51
52MemorySourceFlags RefTensorHandleFactory::GetExportFlags() const
53{
54 return m_ExportFlags;
55}
56
57MemorySourceFlags RefTensorHandleFactory::GetImportFlags() const
58{
59 return m_ImportFlags;
60}
61
62} // namespace armnn