ArmNN
 20.05
RefTensorHandleFactory.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include "RefTensorHandle.hpp"
8 
10 
11 namespace armnn
12 {
13 
15 
17 {
18  static const FactoryId s_Id(RefTensorHandleFactoryId());
19  return s_Id;
20 }
21 
22 std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateSubTensorHandle(ITensorHandle& parent,
23  TensorShape const& subTensorShape,
24  unsigned int const* subTensorOrigin) const
25 {
26  IgnoreUnused(parent, subTensorShape, subTensorOrigin);
27  return nullptr;
28 }
29 
30 std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const
31 {
32  return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
33 }
34 
35 std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo,
36  DataLayout dataLayout) const
37 {
38  IgnoreUnused(dataLayout);
39  return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
40 }
41 
43 {
44  return GetIdStatic();
45 }
46 
48 {
49  return false;
50 }
51 
53 {
54  return m_ExportFlags;
55 }
56 
58 {
59  return m_ImportFlags;
60 }
61 
62 } // namespace armnn
static const FactoryId & GetIdStatic()
bool SupportsSubTensors() const override
DataLayout
Definition: Types.hpp:49
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, TensorShape const &subTensorShape, unsigned int const *subTensorOrigin) const override
unsigned int MemorySourceFlags
Copyright (c) 2020 ARM Limited.
void IgnoreUnused(Ts &&...)
ITensorHandleFactory::FactoryId FactoryId
MemorySourceFlags GetImportFlags() const override
const FactoryId & GetId() const override
MemorySourceFlags GetExportFlags() const override
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
constexpr const char * RefTensorHandleFactoryId()