ArmNN
 24.02
NeonConvolution2dWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "NeonBaseWorkload.hpp"
9 
10 #include <arm_compute/runtime/IFunction.h>
11 #include <arm_compute/runtime/Tensor.h>
12 #include <arm_compute/runtime/MemoryManagerOnDemand.h>
13 
14 #include <memory>
15 
16 namespace armnn
17 {
18 
20  const TensorInfo& output,
21  const Convolution2dDescriptor& descriptor,
22  const TensorInfo& weights,
23  const Optional<TensorInfo>& biases,
24  bool isFastMathEnabled = false,
25  const ActivationDescriptor* activationDescriptor = nullptr);
26 
27 class NeonConvolution2dWorkload : public NeonBaseWorkload<Convolution2dQueueDescriptor>
28 {
29 public:
31 
33  const WorkloadInfo& info,
34  std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
35  const bool isFastMathENabled = false);
36 
37  void Execute() const override;
38 
39  arm_compute::ConvolutionMethod GetConvolutionMethod() const;
40 
41 private:
42  std::unique_ptr<arm_compute::IFunction> m_ConvolutionLayer;
43 
44  mutable std::unique_ptr<arm_compute::Tensor> m_KernelTensor;
45  mutable std::unique_ptr<arm_compute::Tensor> m_BiasTensor;
46  TensorInfo m_KernelTensorInfo;
47  TensorInfo m_BiasTensorInfo;
48  arm_compute::ConvolutionMethod m_ConvolutionMethod;
49  mutable bool prepared = false;
50 };
51 
52 } //namespace armnn
armnn::NeonConvolution2dWorkload::NeonConvolution2dWorkload
NeonConvolution2dWorkload(const Convolution2dQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const bool isFastMathENabled=false)
Definition: NeonConvolution2dWorkload.cpp:71
armnn::NeonConvolution2dWorkload
Definition: NeonConvolution2dWorkload.hpp:27
armnn::TensorInfo
Definition: Tensor.hpp:152
NeonBaseWorkload.hpp
armnn::Convolution2dQueueDescriptor
Definition: WorkloadData.hpp:210
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
armnn::BoostLogSeverityMapping::info
@ info
armnn::BaseWorkload
Definition: Workload.hpp:33
armnn::NeonConvolution2dWorkload::GetConvolutionMethod
arm_compute::ConvolutionMethod GetConvolutionMethod() const
Definition: NeonConvolution2dWorkload.cpp:174
armnn::Status
Status
Definition: Types.hpp:42
armnn::NeonConvolution2dWorkloadValidate
arm_compute::Status NeonConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
Definition: NeonConvolution2dWorkload.cpp:24
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::NeonConvolution2dWorkload::Execute
void Execute() const override
Definition: NeonConvolution2dWorkload.cpp:154
armnn::NeonBaseWorkload
Definition: NeonBaseWorkload.hpp:13