ArmNN
 22.08
EthosnRefTensorHandleFactory.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 
11 
12 namespace armnn
13 {
14 
15 constexpr const char * EthosnRefTensorHandleFactoryId() { return "Arm/EthosnRef/TensorHandleFactory"; }
16 
18 {
19 
20 public:
21  // REVISIT: add another TensorHandleFactory - linear which support import - to be used for tensors which go between workloads the backend
22  EthosnRefTensorHandleFactory(std::shared_ptr<EthosnRefMemoryManager> mgr)
23  : m_MemoryManager(mgr),
24  m_ImportFlags(static_cast<MemorySourceFlags>(MemorySource::Undefined)),
25  m_ExportFlags(static_cast<MemorySourceFlags>(MemorySource::Undefined))
26  {}
27 
28  std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
29  TensorShape const& subTensorShape,
30  unsigned int const* subTensorOrigin) const override;
31 
32  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo) const override;
33 
34  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
35  DataLayout dataLayout) const override;
36 
37  static const FactoryId& GetIdStatic();
38 
39  const FactoryId& GetId() const override;
40 
41  bool SupportsSubTensors() const override;
42 
43  MemorySourceFlags GetExportFlags() const override;
44 
45  MemorySourceFlags GetImportFlags() const override;
46 
47 private:
48  mutable std::shared_ptr<EthosnRefMemoryManager> m_MemoryManager;
49  MemorySourceFlags m_ImportFlags;
50  MemorySourceFlags m_ExportFlags;
51 
52 };
53 
54 } // namespace armnn
55 
EthosnRefTensorHandleFactory(std::shared_ptr< EthosnRefMemoryManager > mgr)
DataLayout
Definition: Types.hpp:62
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, TensorShape const &subTensorShape, unsigned int const *subTensorOrigin) const override
unsigned int MemorySourceFlags
Copyright (c) 2021 ARM Limited and Contributors.
MemorySourceFlags GetExportFlags() const override
MemorySourceFlags GetImportFlags() const override
const FactoryId & GetId() const override
constexpr const char * EthosnRefTensorHandleFactoryId()
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
MemorySource
Define the Memory Source to reduce copies.
Definition: Types.hpp:230