ArmNN
 24.02
ClTensorHandleFactory.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
11 
12 namespace armnn
13 {
14 
15 constexpr const char* ClTensorHandleFactoryId()
16 {
17  return "Arm/Cl/TensorHandleFactory";
18 }
19 
21 {
22 public:
23  static const FactoryId m_Id;
24 
25  ClTensorHandleFactory(std::shared_ptr<ClMemoryManager> mgr)
26  : m_MemoryManager(mgr)
27  {}
28 
29  std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
30  const TensorShape& subTensorShape,
31  const unsigned int* subTensorOrigin) const override;
32 
33  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo) const override;
34 
35  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
36  DataLayout dataLayout) const override;
37 
38  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
39  const bool IsMemoryManaged) const override;
40 
41  std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
42  DataLayout dataLayout,
43  const bool IsMemoryManaged) const override;
44 
45  static const FactoryId& GetIdStatic();
46 
47  const FactoryId& GetId() const override;
48 
49  bool SupportsSubTensors() const override;
50 
51  MemorySourceFlags GetExportFlags() const override;
52 
53  MemorySourceFlags GetImportFlags() const override;
54 
55 private:
56  mutable std::shared_ptr<ClMemoryManager> m_MemoryManager;
57 };
58 
59 } // namespace armnn
armnn::ClTensorHandleFactoryId
constexpr const char * ClTensorHandleFactoryId()
Definition: ClTensorHandleFactory.hpp:15
armnn::ClTensorHandleFactory::SupportsSubTensors
bool SupportsSubTensors() const override
Definition: ClTensorHandleFactory.cpp:104
armnn::ClTensorHandleFactory::GetImportFlags
MemorySourceFlags GetImportFlags() const override
Definition: ClTensorHandleFactory.cpp:114
armnn::DataLayout
DataLayout
Definition: Types.hpp:62
armnn::ClTensorHandleFactory::ClTensorHandleFactory
ClTensorHandleFactory(std::shared_ptr< ClMemoryManager > mgr)
Definition: ClTensorHandleFactory.hpp:25
armnn::ClTensorHandleFactory::GetIdStatic
static const FactoryId & GetIdStatic()
Definition: ClTensorHandleFactory.cpp:93
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::ClTensorHandleFactory::GetExportFlags
MemorySourceFlags GetExportFlags() const override
Definition: ClTensorHandleFactory.cpp:109
armnn::MemorySourceFlags
unsigned int MemorySourceFlags
Definition: MemorySources.hpp:15
ITensorHandleFactory.hpp
BaseMemoryManager.hpp
armnn::ITensorHandle
Definition: ITensorHandle.hpp:16
armnn::ClTensorHandleFactory::CreateTensorHandle
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
Definition: ClTensorHandleFactory.cpp:57
armnn::ClTensorHandleFactory::CreateSubTensorHandle
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
Definition: ClTensorHandleFactory.cpp:21
armnn::ClTensorHandleFactory::GetId
const FactoryId & GetId() const override
Definition: ClTensorHandleFactory.cpp:99
armnn::TensorShape
Definition: Tensor.hpp:20
armnn::FactoryId
ITensorHandleFactory::FactoryId FactoryId
Definition: MockTensorHandleFactory.cpp:12
armnn::ITensorHandleFactory
Definition: ITensorHandleFactory.hpp:46
armnn::ClTensorHandleFactory
Definition: ClTensorHandleFactory.hpp:20
armnn::ClTensorHandleFactory::m_Id
static const FactoryId m_Id
Definition: ClTensorHandleFactory.hpp:23
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
MemorySources.hpp
IMemoryManager.hpp