From 03c7ff3f6188240baaeaeb405a357a0c58195fec Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Tue, 22 Aug 2023 12:00:04 +0100 Subject: IVGCVSW-7702 Update Doxygen Docu for 23.08 Signed-off-by: Nikhil Raj Change-Id: I357a9f7e47614589327c1ac5d95b6224ff77103d --- ...sarmnn_1_1_cl_import_tensor_handle_factory.html | 815 +++++++++++++++++++++ 1 file changed, 815 insertions(+) create mode 100644 latest/classarmnn_1_1_cl_import_tensor_handle_factory.html (limited to 'latest/classarmnn_1_1_cl_import_tensor_handle_factory.html') diff --git a/latest/classarmnn_1_1_cl_import_tensor_handle_factory.html b/latest/classarmnn_1_1_cl_import_tensor_handle_factory.html new file mode 100644 index 0000000000..44fc5ff7d9 --- /dev/null +++ b/latest/classarmnn_1_1_cl_import_tensor_handle_factory.html @@ -0,0 +1,815 @@ + + + + + + + + +Arm NN: ClImportTensorHandleFactory Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  23.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ClImportTensorHandleFactory Class Reference
+
+
+ +

This factory creates ClImportTensorHandles that refer to imported memory tensors. + More...

+ +

#include <ClImportTensorHandleFactory.hpp>

+
+Inheritance diagram for ClImportTensorHandleFactory:
+
+
+
+
[legend]
+
+Collaboration diagram for ClImportTensorHandleFactory:
+
+
+
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ClImportTensorHandleFactory (MemorySourceFlags importFlags, MemorySourceFlags exportFlags)
 Create a tensor handle factory for tensors that will be imported or exported. More...
 
std::unique_ptr< ITensorHandleCreateSubTensorHandle (ITensorHandle &parent, const TensorShape &subTensorShape, const unsigned int *subTensorOrigin) const override
 
std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo) const override
 
std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, DataLayout dataLayout) const override
 
std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, const bool IsMemoryManaged) const override
 Utility Functions for backends which require TensorHandles to have unmanaged memory. More...
 
std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, DataLayout dataLayout, const bool IsMemoryManaged) const override
 
const FactoryIdGetId () const override
 
bool SupportsSubTensors () const override
 
bool SupportsMapUnmap () const override
 
MemorySourceFlags GetExportFlags () const override
 
MemorySourceFlags GetImportFlags () const override
 
std::vector< CapabilityGetCapabilities (const IConnectableLayer *layer, const IConnectableLayer *connectedLayer, CapabilityClass capabilityClass) override
 
- Public Member Functions inherited from ITensorHandleFactory
virtual ~ITensorHandleFactory ()
 Some TensorHandleFactory decisions are deferred to run-time. More...
 
virtual bool SupportsInPlaceComputation () const
 
+ + + +

+Static Public Member Functions

static const FactoryIdGetIdStatic ()
 
+ + + + + + + + + +

+Static Public Attributes

static const FactoryId m_Id
 
- Static Public Attributes inherited from ITensorHandleFactory
static const FactoryId LegacyFactoryId = "armnn_legacy_factory"
 
static const FactoryId DeferredFactoryId = "armnn_deferred_factory"
 Use the workload factory to create the tensor handle. More...
 
+ + + + +

+Additional Inherited Members

- Public Types inherited from ITensorHandleFactory
using FactoryId = std::string
 
+

Detailed Description

+

This factory creates ClImportTensorHandles that refer to imported memory tensors.

+ +

Definition at line 23 of file ClImportTensorHandleFactory.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ClImportTensorHandleFactory()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
ClImportTensorHandleFactory (MemorySourceFlags importFlags,
MemorySourceFlags exportFlags 
)
+
+inline
+
+ +

Create a tensor handle factory for tensors that will be imported or exported.

+
Parameters
+ + + +
importFlags
exportFlags
+
+
+ +

Definition at line 34 of file ClImportTensorHandleFactory.hpp.

+
35  : m_ImportFlags(importFlags)
+
36  , m_ExportFlags(exportFlags)
+
37  {}
+
+
+
+

Member Function Documentation

+ +

◆ CreateSubTensorHandle()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::unique_ptr< ITensorHandle > CreateSubTensorHandle (ITensorHandleparent,
const TensorShapesubTensorShape,
const unsigned int * subTensorOrigin 
) const
+
+overridevirtual
+
+ +

Implements ITensorHandleFactory.

+ +

Definition at line 20 of file ClImportTensorHandleFactory.cpp.

+
22 {
+ +
24  arm_compute::TensorShape shape = armcomputetensorutils::BuildArmComputeTensorShape(subTensorShape);
+
25 
+
26  coords.set_num_dimensions(subTensorShape.GetNumDimensions());
+
27  for (unsigned int i = 0; i < subTensorShape.GetNumDimensions(); ++i)
+
28  {
+
29  // Arm compute indexes tensor coords in reverse order.
+
30  unsigned int revertedIndex = subTensorShape.GetNumDimensions() - i - 1;
+
31  coords.set(i, armnn::numeric_cast<int>(subTensorOrigin[revertedIndex]));
+
32  }
+
33 
+
34  const arm_compute::TensorShape parentShape = armcomputetensorutils::BuildArmComputeTensorShape(parent.GetShape());
+
35 
+
36  // In order for ACL to support subtensors the concat axis cannot be on x or y and the values of x and y
+
37  // must match the parent shapes
+
38  if (coords.x() != 0 || coords.y() != 0)
+
39  {
+
40  return nullptr;
+
41  }
+
42  if ((parentShape.x() != shape.x()) || (parentShape.y() != shape.y()))
+
43  {
+
44  return nullptr;
+
45  }
+
46 
+
47  if (!::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, parentShape, coords, shape))
+
48  {
+
49  return nullptr;
+
50  }
+
51 
+
52  return std::make_unique<ClImportSubTensorHandle>(
+
53  PolymorphicDowncast<IClTensorHandle*>(&parent), shape, coords);
+
54 }
+
+
+
+ +

◆ CreateTensorHandle() [1/4]

+ +
+
+ + + + + +
+ + + + + + + + +
std::unique_ptr< ITensorHandle > CreateTensorHandle (const TensorInfotensorInfo) const
+
+overridevirtual
+
+ +

Implements ITensorHandleFactory.

+ +

Definition at line 56 of file ClImportTensorHandleFactory.cpp.

+
57 {
+
58  std::unique_ptr<ClImportTensorHandle> tensorHandle = std::make_unique<ClImportTensorHandle>(tensorInfo,
+
59  GetImportFlags());
+
60  return tensorHandle;
+
61 }
+
+

References ClImportTensorHandleFactory::GetImportFlags().

+ +

Referenced by ClImportTensorHandleFactory::CreateTensorHandle().

+ +
+
+ +

◆ CreateTensorHandle() [2/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::unique_ptr< ITensorHandle > CreateTensorHandle (const TensorInfotensorInfo,
const bool IsMemoryManaged 
) const
+
+overridevirtual
+
+ +

Utility Functions for backends which require TensorHandles to have unmanaged memory.

+

These should be overloaded if required to facilitate direct import of input tensors and direct export of output tensors.

+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 72 of file ClImportTensorHandleFactory.cpp.

+
74 {
+
75  if (IsMemoryManaged)
+
76  {
+
77  throw InvalidArgumentException("ClImportTensorHandleFactory does not support memory managed tensors.");
+
78  }
+
79  return CreateTensorHandle(tensorInfo);
+
80 }
+
+

References ClImportTensorHandleFactory::CreateTensorHandle().

+ +
+
+ +

◆ CreateTensorHandle() [3/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::unique_ptr< ITensorHandle > CreateTensorHandle (const TensorInfotensorInfo,
DataLayout dataLayout 
) const
+
+overridevirtual
+
+ +

Implements ITensorHandleFactory.

+ +

Definition at line 63 of file ClImportTensorHandleFactory.cpp.

+
65 {
+
66  std::unique_ptr<ClImportTensorHandle> tensorHandle = std::make_unique<ClImportTensorHandle>(tensorInfo,
+
67  dataLayout,
+
68  GetImportFlags());
+
69  return tensorHandle;
+
70 }
+
+

References ClImportTensorHandleFactory::GetImportFlags().

+ +
+
+ +

◆ CreateTensorHandle() [4/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::unique_ptr< ITensorHandle > CreateTensorHandle (const TensorInfotensorInfo,
DataLayout dataLayout,
const bool IsMemoryManaged 
) const
+
+overridevirtual
+
+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 82 of file ClImportTensorHandleFactory.cpp.

+
85 {
+
86  if (IsMemoryManaged)
+
87  {
+
88  throw InvalidArgumentException("ClImportTensorHandleFactory does not support memory managed tensors.");
+
89  }
+
90  return CreateTensorHandle(tensorInfo, dataLayout);
+
91 }
+
+

References ClImportTensorHandleFactory::CreateTensorHandle().

+ +
+
+ +

◆ GetCapabilities()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::vector< Capability > GetCapabilities (const IConnectableLayerlayer,
const IConnectableLayerconnectedLayer,
CapabilityClass capabilityClass 
)
+
+overridevirtual
+
+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 124 of file ClImportTensorHandleFactory.cpp.

+
127 {
+
128  IgnoreUnused(layer);
+
129  IgnoreUnused(connectedLayer);
+
130  std::vector<Capability> capabilities;
+
131  if (capabilityClass == CapabilityClass::FallbackImportDisabled)
+
132  {
+
133  Capability paddingCapability(CapabilityClass::FallbackImportDisabled, true);
+
134  capabilities.push_back(paddingCapability);
+
135  }
+
136  return capabilities;
+
137 }
+
+

References armnn::FallbackImportDisabled, and armnn::IgnoreUnused().

+ +
+
+ +

◆ GetExportFlags()

+ +
+
+ + + + + +
+ + + + + + + +
MemorySourceFlags GetExportFlags () const
+
+overridevirtual
+
+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 114 of file ClImportTensorHandleFactory.cpp.

+
115 {
+
116  return m_ExportFlags;
+
117 }
+
+
+
+ +

◆ GetId()

+ +
+
+ + + + + +
+ + + + + + + +
const FactoryId & GetId () const
+
+overridevirtual
+
+ +

Implements ITensorHandleFactory.

+ +

Definition at line 99 of file ClImportTensorHandleFactory.cpp.

+
100 {
+
101  return GetIdStatic();
+
102 }
+
+

References ClImportTensorHandleFactory::GetIdStatic().

+ +
+
+ +

◆ GetIdStatic()

+ +
+
+ + + + + +
+ + + + + + + +
const FactoryId & GetIdStatic ()
+
+static
+
+ +

Definition at line 93 of file ClImportTensorHandleFactory.cpp.

+
94 {
+
95  static const FactoryId s_Id(ClImportTensorHandleFactoryId());
+
96  return s_Id;
+
97 }
+
+

References armnn::ClImportTensorHandleFactoryId().

+ +

Referenced by ClBackend::GetHandleFactoryPreferences(), and ClImportTensorHandleFactory::GetId().

+ +
+
+ +

◆ GetImportFlags()

+ +
+
+ + + + + +
+ + + + + + + +
MemorySourceFlags GetImportFlags () const
+
+overridevirtual
+
+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 119 of file ClImportTensorHandleFactory.cpp.

+
120 {
+
121  return m_ImportFlags;
+
122 }
+
+

Referenced by ClImportTensorHandleFactory::CreateTensorHandle().

+ +
+
+ +

◆ SupportsMapUnmap()

+ +
+
+ + + + + +
+ + + + + + + +
bool SupportsMapUnmap () const
+
+overridevirtual
+
+ +

Reimplemented from ITensorHandleFactory.

+ +

Definition at line 109 of file ClImportTensorHandleFactory.cpp.

+
110 {
+
111  return false;
+
112 }
+
+
+
+ +

◆ SupportsSubTensors()

+ +
+
+ + + + + +
+ + + + + + + +
bool SupportsSubTensors () const
+
+overridevirtual
+
+ +

Implements ITensorHandleFactory.

+ +

Definition at line 104 of file ClImportTensorHandleFactory.cpp.

+
105 {
+
106  return true;
+
107 }
+
+
+
+

Member Data Documentation

+ +

◆ m_Id

+ +
+
+ + + + + +
+ + + + +
const FactoryId m_Id
+
+static
+
+ +

Definition at line 26 of file ClImportTensorHandleFactory.hpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ +
constexpr const char * ClImportTensorHandleFactoryId()
+
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
+
std::array< unsigned int, MaxNumOfTensorDimensions > Coordinates
+
MemorySourceFlags GetImportFlags() const override
+ +
void IgnoreUnused(Ts &&...)
+ + + + + -- cgit v1.2.1