ArmNN
 25.11
Loading...
Searching...
No Matches
ClImportTensorHandleFactory.hpp
Go to the documentation of this file.
1//
2// Copyright © 2021 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5#pragma once
6
10
11namespace armnn
12{
13
14constexpr const char* ClImportTensorHandleFactoryId()
15{
16 return "Arm/Cl/ImportTensorHandleFactory";
17}
18
19/**
20 * This factory creates ClImportTensorHandles that refer to imported memory tensors.
21 */
23{
24public:
25 static const FactoryId m_Id;
26
27 /**
28 * Create a tensor handle factory for tensors that will be imported or exported.
29 *
30 * @param importFlags
31 * @param exportFlags
32 */
34 : m_ImportFlags(importFlags)
35 , m_ExportFlags(exportFlags)
36 {}
37
38 std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& parent,
39 const TensorShape& subTensorShape,
40 const unsigned int* subTensorOrigin) const override;
41
42 std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo) const override;
43
44 std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
45 DataLayout dataLayout) const override;
46
47 std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
48 const bool IsMemoryManaged) const override;
49
50 std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& tensorInfo,
51 DataLayout dataLayout,
52 const bool IsMemoryManaged) const override;
53
54 static const FactoryId& GetIdStatic();
55
56 const FactoryId& GetId() const override;
57
58 bool SupportsSubTensors() const override;
59
60 bool SupportsMapUnmap() const override;
61
62 MemorySourceFlags GetExportFlags() const override;
63
64 MemorySourceFlags GetImportFlags() const override;
65
66 std::vector<Capability> GetCapabilities(const IConnectableLayer* layer,
67 const IConnectableLayer* connectedLayer,
68 CapabilityClass capabilityClass) override;
69
70private:
71 MemorySourceFlags m_ImportFlags;
72 MemorySourceFlags m_ExportFlags;
73};
74
75} // namespace armnn
const FactoryId & GetId() const override
std::vector< Capability > GetCapabilities(const IConnectableLayer *layer, const IConnectableLayer *connectedLayer, CapabilityClass capabilityClass) override
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
MemorySourceFlags GetExportFlags() const override
ClImportTensorHandleFactory(MemorySourceFlags importFlags, MemorySourceFlags exportFlags)
Create a tensor handle factory for tensors that will be imported or exported.
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
MemorySourceFlags GetImportFlags() const override
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition INetwork.hpp:81
Copyright (c) 2021 ARM Limited and Contributors.
CapabilityClass
Capability class to calculate in the GetCapabilities function so that only the capability in the scop...
unsigned int MemorySourceFlags
ITensorHandleFactory::FactoryId FactoryId
constexpr const char * ClImportTensorHandleFactoryId()
DataLayout
Definition Types.hpp:63