From ae050524109f1ce827962665436ef7430f2ac479 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Wed, 22 Mar 2023 16:48:58 +0000 Subject: IVGCVSW-7255 Update Doxygen Documentation and publish on GitHub. * Updating Doxygen documentation for 23.02 release. Signed-off-by: David Monahan Change-Id: I545574ff7664b4595d2fe6a91a3c35d2ad55df82 --- ..._normalization_float_workload_8cpp_source.xhtml | 201 ++++++++++++++++----- 1 file changed, 153 insertions(+), 48 deletions(-) (limited to '23.02/_cl_normalization_float_workload_8cpp_source.xhtml') diff --git a/23.02/_cl_normalization_float_workload_8cpp_source.xhtml b/23.02/_cl_normalization_float_workload_8cpp_source.xhtml index d70eef9ac1..e6270d2bcc 100644 --- a/23.02/_cl_normalization_float_workload_8cpp_source.xhtml +++ b/23.02/_cl_normalization_float_workload_8cpp_source.xhtml @@ -8,7 +8,7 @@ - + ArmNN: src/backends/cl/workloads/ClNormalizationFloatWorkload.cpp Source File @@ -19,9 +19,6 @@ - @@ -30,7 +27,8 @@ extensions: ["tex2jax.js"], jax: ["input/TeX","output/HTML-CSS"], }); - + + @@ -51,18 +49,21 @@ - + +/* @license-end */
@@ -76,7 +77,9 @@ $(function() {
@@ -98,53 +101,155 @@ $(document).ready(function(){initNavTree('_cl_normalization_float_workload_8cpp_
ClNormalizationFloatWorkload.cpp
-Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 #include <cl/ClTensorHandle.hpp>
9 #include <cl/ClLayerSupport.hpp>
12 #include "ClWorkloadUtils.hpp"
13 
14 using namespace armnn::armcomputetensorutils;
15 
16 namespace armnn
17 {
18 
20  const TensorInfo& output,
21  const NormalizationDescriptor& descriptor)
22 {
23  const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.m_DataLayout);
24  const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.m_DataLayout);
25 
26  arm_compute::NormalizationLayerInfo layerInfo = BuildArmComputeNormalizationLayerInfo(descriptor);
27 
28  return arm_compute::CLNormalizationLayer::validate(&aclInputInfo, &aclOutputInfo, layerInfo);
29 }
30 
32  const WorkloadInfo& info,
33  const arm_compute::CLCompileContext& clCompileContext)
34  : FloatWorkload<NormalizationQueueDescriptor>(descriptor, info)
35 {
36  // Report Profiling Details
37  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClNormalizationWorkload_Construct",
38  descriptor.m_Parameters,
39  info,
40  this->GetGuid());
41 
42  m_Data.ValidateInputsOutputs("ClNormalizationFloatWorkload", 1, 1);
43 
44  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
45  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
46 
47  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
48  input.info()->set_data_layout(aclDataLayout);
49  output.info()->set_data_layout(aclDataLayout);
50 
51  arm_compute::NormalizationLayerInfo normalizationInfo = BuildArmComputeNormalizationLayerInfo(m_Data.m_Parameters);
52 
53  {
54  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClNormalizationFloatWorkload_configure");
55  m_NormalizationLayer.configure(clCompileContext, &input, &output, normalizationInfo);
56  }
57 };
58 
60 {
61  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClNormalizationFloatWorkload_Execute", this->GetGuid());
62  RunClFunction(m_NormalizationLayer, CHECK_LOCATION());
63 }
64 
66 {
67  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
68  this->m_Data.m_Inputs[slot] = tensorHandle;
69  try
70  {
71  Reconfigure();
72  }
74  {
75  // Cannot reconfigure, revert the slot back and throw the exception.
76  this->m_Data.m_Inputs[slot] = backupHandle;
77  throw e;
78  }
79 }
80 
81 // Replace output tensor handle with the given TensorHandle
83 {
84  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
85  this->m_Data.m_Inputs[slot] = tensorHandle;
86  try
87  {
88  Reconfigure();
89  }
91  {
92  // Cannot reconfigure, revert the slot back and throw the exception.
93  this->m_Data.m_Inputs[slot] = backupHandle;
94  throw e;
95  }
96 }
97 
98 void ClNormalizationFloatWorkload::Reconfigure()
99 {
100  throw armnn::UnimplementedException("Reconfigure not implemented for this workload");
101 }
102 
103 } //namespace armnn
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
-
DataLayout
Definition: Types.hpp:62
- -
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
- - - -
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
-
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:61
- - - -
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
-
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
-
Copyright (c) 2021 ARM Limited and Contributors.
-
ClNormalizationFloatWorkload(const NormalizationQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
- -
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
-
arm_compute::Status ClNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor)
- -
QueueDescriptor m_Data
Definition: Workload.hpp:83
- -
Status
enumeration
Definition: Types.hpp:42
- -
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
- -
std::vector< ITensorHandle * > m_Outputs
- -
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
- -
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
-
Contains information about TensorInfos of a layer.
-
std::vector< ITensorHandle * > m_Inputs
-
A NormalizationDescriptor for the NormalizationLayer.
- - - - +Go to the documentation of this file.
1 //
+
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
+
3 // SPDX-License-Identifier: MIT
+
4 //
+
5 
+ +
7 #include <cl/ClTensorHandle.hpp>
+ +
9 #include <cl/ClLayerSupport.hpp>
+ + +
12 #include "ClWorkloadUtils.hpp"
+
13 
+
14 using namespace armnn::armcomputetensorutils;
+
15 
+
16 namespace armnn
+
17 {
+
18 
+ +
20  const TensorInfo& output,
+
21  const NormalizationDescriptor& descriptor)
+
22 {
+
23  const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.m_DataLayout);
+
24  const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.m_DataLayout);
+
25 
+
26  arm_compute::NormalizationLayerInfo layerInfo = BuildArmComputeNormalizationLayerInfo(descriptor);
+
27 
+
28  return arm_compute::CLNormalizationLayer::validate(&aclInputInfo, &aclOutputInfo, layerInfo);
+
29 }
+
30 
+ +
32  const WorkloadInfo& info,
+
33  const arm_compute::CLCompileContext& clCompileContext)
+ +
35 {
+
36  // Report Profiling Details
+
37  ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClNormalizationWorkload_Construct",
+
38  descriptor.m_Parameters,
+
39  info,
+
40  this->GetGuid());
+
41 
+
42  m_Data.ValidateInputsOutputs("ClNormalizationFloatWorkload", 1, 1);
+
43 
+
44  arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
+
45  arm_compute::ICLTensor& output = static_cast<IClTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
+
46 
+
47  arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
+
48  input.info()->set_data_layout(aclDataLayout);
+
49  output.info()->set_data_layout(aclDataLayout);
+
50 
+
51  arm_compute::NormalizationLayerInfo normalizationInfo = BuildArmComputeNormalizationLayerInfo(m_Data.m_Parameters);
+
52 
+
53  {
+
54  ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClNormalizationFloatWorkload_configure");
+
55  m_NormalizationLayer.configure(clCompileContext, &input, &output, normalizationInfo);
+
56  }
+
57 };
+
58 
+ +
60 {
+
61  ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClNormalizationFloatWorkload_Execute", this->GetGuid());
+
62  RunClFunction(m_NormalizationLayer, CHECK_LOCATION());
+
63 }
+
64 
+ +
66 {
+
67  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
+
68  this->m_Data.m_Inputs[slot] = tensorHandle;
+
69  try
+
70  {
+
71  Reconfigure();
+
72  }
+ +
74  {
+
75  // Cannot reconfigure, revert the slot back and throw the exception.
+
76  this->m_Data.m_Inputs[slot] = backupHandle;
+
77  throw e;
+
78  }
+
79 }
+
80 
+
81 // Replace output tensor handle with the given TensorHandle
+ +
83 {
+
84  ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot];
+
85  this->m_Data.m_Inputs[slot] = tensorHandle;
+
86  try
+
87  {
+
88  Reconfigure();
+
89  }
+ +
91  {
+
92  // Cannot reconfigure, revert the slot back and throw the exception.
+
93  this->m_Data.m_Inputs[slot] = backupHandle;
+
94  throw e;
+
95  }
+
96 }
+
97 
+
98 void ClNormalizationFloatWorkload::Reconfigure()
+
99 {
+
100  throw armnn::UnimplementedException("Reconfigure not implemented for this workload");
+
101 }
+
102 
+
103 } //namespace armnn
+
A NormalizationDescriptor for the NormalizationLayer.
+
arm::pipe::ProfilingGuid GetGuid() const final
Definition: Workload.hpp:61
+ +
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
+
DataLayout
Definition: Types.hpp:62
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:203
+ +
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
+ + +
QueueDescriptor m_Data
Definition: Workload.hpp:83
+
Copyright (c) 2021 ARM Limited and Contributors.
+
DataLayout m_DataLayout
The data layout to be used (NCHW, NHWC).
+ + + +
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
+ +
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Definition: Profiling.hpp:220
+
arm_compute::Status ClNormalizationWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const NormalizationDescriptor &descriptor)
+ + +
void RunClFunction(arm_compute::IFunction &function, const CheckLocation &location)
+
Status
Definition: Types.hpp:42
+ +
Contains information about TensorInfos of a layer.
+ +
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
Definition: Profiling.hpp:227
+ + +
std::vector< ITensorHandle * > m_Outputs
+ +
#define ARMNN_SCOPED_PROFILING_EVENT_CL_GUID(name, guid)
+ +
std::vector< ITensorHandle * > m_Inputs
+ +
ClNormalizationFloatWorkload(const NormalizationQueueDescriptor &descriptor, const WorkloadInfo &info, const arm_compute::CLCompileContext &clCompileContext)
-- cgit v1.2.1