aboutsummaryrefslogtreecommitdiff
path: root/src/backends/neon/workloads
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends/neon/workloads')
-rw-r--r--src/backends/neon/workloads/CMakeLists.txt2
-rw-r--r--src/backends/neon/workloads/NeonPooling3dWorkload.cpp64
-rw-r--r--src/backends/neon/workloads/NeonPooling3dWorkload.hpp33
-rw-r--r--src/backends/neon/workloads/NeonWorkloads.hpp1
4 files changed, 100 insertions, 0 deletions
diff --git a/src/backends/neon/workloads/CMakeLists.txt b/src/backends/neon/workloads/CMakeLists.txt
index 16fae69029..2209bf47e2 100644
--- a/src/backends/neon/workloads/CMakeLists.txt
+++ b/src/backends/neon/workloads/CMakeLists.txt
@@ -94,6 +94,8 @@ list(APPEND armnnNeonBackendWorkloads_sources
NeonPermuteWorkload.hpp
NeonPooling2dWorkload.cpp
NeonPooling2dWorkload.hpp
+ NeonPooling3dWorkload.hpp
+ NeonPooling3dWorkload.cpp
NeonPreluWorkload.cpp
NeonPreluWorkload.hpp
NeonQLstmWorkload.cpp
diff --git a/src/backends/neon/workloads/NeonPooling3dWorkload.cpp b/src/backends/neon/workloads/NeonPooling3dWorkload.cpp
new file mode 100644
index 0000000000..4bc4f986c3
--- /dev/null
+++ b/src/backends/neon/workloads/NeonPooling3dWorkload.cpp
@@ -0,0 +1,64 @@
+//
+// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#include "NeonPooling3dWorkload.hpp"
+#include "NeonWorkloadUtils.hpp"
+#include <neon/NeonLayerSupport.hpp>
+#include <neon/NeonTensorHandle.hpp>
+#include <aclCommon/ArmComputeUtils.hpp>
+#include <aclCommon/ArmComputeTensorUtils.hpp>
+
+namespace armnn
+{
+ using namespace armcomputetensorutils;
+ arm_compute::Status NeonPooling3dWorkloadValidate(const TensorInfo& input,
+ const TensorInfo& output,
+ const Pooling3dDescriptor& descriptor)
+ {
+ const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.m_DataLayout);
+ const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.m_DataLayout);
+ arm_compute::Pooling3dLayerInfo layerInfo = BuildArmComputePooling3dLayerInfo(descriptor);
+ return arm_compute::NEPooling3dLayer::validate(&aclInputInfo, &aclOutputInfo, layerInfo);
+ }
+
+ NeonPooling3dWorkload::NeonPooling3dWorkload( const Pooling3dQueueDescriptor& descriptor,
+ const WorkloadInfo& info)
+ : NeonBaseWorkload<Pooling3dQueueDescriptor>(descriptor, info)
+ {
+ // Report Profiling Details
+ ARMNN_REPORT_PROFILING_WORKLOAD_DESC("NeonPooling3dWorkload_Construct",
+ descriptor.m_Parameters,
+ info,
+ this->GetGuid());
+
+ m_Data.ValidateInputsOutputs("NeonPooling3dWorkload", 1, 1);
+
+ arm_compute::ITensor& input = static_cast<IAclTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
+ arm_compute::ITensor& output = static_cast<IAclTensorHandle*>(m_Data.m_Outputs[0])->GetTensor();
+
+ arm_compute::DataLayout aclDataLayout = ConvertDataLayout(m_Data.m_Parameters.m_DataLayout);
+ input.info()->set_data_layout(aclDataLayout);
+ output.info()->set_data_layout(aclDataLayout);
+
+ // flag to use wider accumulators (32 bit instead of 16 for FP16) to improve accuracy
+ // enable fp_mixed_precision for the the FP16 cases that
+ // accumulation reaches a limit beyond which there is no more increment of the value
+ bool fpMixedPrecision = false;
+
+ arm_compute::Pooling3dLayerInfo layerInfo = BuildArmComputePooling3dLayerInfo(m_Data.m_Parameters,
+ fpMixedPrecision);
+ {
+ ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "NeonPooling3dWorkload_configure");
+
+ auto layer = std::make_unique<arm_compute::NEPooling3dLayer>();
+ layer->configure(&input, &output, layerInfo);
+ m_PoolingLayer.reset(layer.release());
+ }
+ }
+ void NeonPooling3dWorkload::Execute() const
+ {
+ ARMNN_SCOPED_PROFILING_EVENT_NEON_GUID("NeonPooling3dWorkload_Execute", this->GetGuid());
+ m_PoolingLayer->run();
+ }
+}
diff --git a/src/backends/neon/workloads/NeonPooling3dWorkload.hpp b/src/backends/neon/workloads/NeonPooling3dWorkload.hpp
new file mode 100644
index 0000000000..03453f1eee
--- /dev/null
+++ b/src/backends/neon/workloads/NeonPooling3dWorkload.hpp
@@ -0,0 +1,33 @@
+//
+// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include "NeonBaseWorkload.hpp"
+
+#include <arm_compute/runtime/NEON/functions/NEPooling3dLayer.h>
+
+namespace armnn
+{
+
+ arm_compute::Status NeonPooling3dWorkloadValidate(const TensorInfo& input,
+ const TensorInfo& output,
+ const Pooling3dDescriptor& descriptor);
+
+ class NeonPooling3dWorkload : public NeonBaseWorkload<Pooling3dQueueDescriptor>
+ {
+ public:
+ using BaseWorkload<Pooling3dQueueDescriptor>::m_Data;
+
+ NeonPooling3dWorkload(const Pooling3dQueueDescriptor& descriptor,
+ const WorkloadInfo& info);
+
+ void Execute() const override;
+
+ private:
+ std::unique_ptr<arm_compute::IFunction> m_PoolingLayer;
+ };
+
+} //namespace armnn
diff --git a/src/backends/neon/workloads/NeonWorkloads.hpp b/src/backends/neon/workloads/NeonWorkloads.hpp
index d486a1d988..8f83674950 100644
--- a/src/backends/neon/workloads/NeonWorkloads.hpp
+++ b/src/backends/neon/workloads/NeonWorkloads.hpp
@@ -49,6 +49,7 @@
#include "NeonPadWorkload.hpp"
#include "NeonPermuteWorkload.hpp"
#include "NeonPooling2dWorkload.hpp"
+#include "NeonPooling3dWorkload.hpp"
#include "NeonPreluWorkload.hpp"
#include "NeonQLstmWorkload.hpp"
#include "NeonQuantizedLstmWorkload.hpp"