ArmNN
 21.08
ClConvolution2dWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/Tensor.hpp>
9 #include <armnn/Descriptors.hpp>
10 
12 
13 #include <arm_compute/runtime/CL/functions/CLConvolutionLayer.h>
14 #include <arm_compute/runtime/MemoryManagerOnDemand.h>
15 
16 #include <memory>
17 
18 namespace armnn
19 {
20 
22  const TensorInfo& output,
23  const Convolution2dDescriptor& descriptor,
24  const TensorInfo& weights,
25  const Optional<TensorInfo>& biases,
26  bool isFastMathEnabled = false,
27  const ActivationDescriptor* activationDescriptor = nullptr);
28 
29 class ClConvolution2dWorkload : public BaseWorkload<Convolution2dQueueDescriptor>
30 {
31 public:
33  const WorkloadInfo& info,
34  std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
35  const arm_compute::CLCompileContext& clCompileContext,
36  const bool isFastMathEnabled = false);
37  void Execute() const override;
38 
39  arm_compute::ConvolutionMethod GetConvolutionMethod() const;
40 
41 private:
42  mutable arm_compute::CLConvolutionLayer m_ConvolutionLayer;
43 
44  std::unique_ptr<arm_compute::CLTensor> m_KernelTensor;
45  std::unique_ptr<arm_compute::CLTensor> m_BiasTensor;
46 
47  arm_compute::ConvolutionMethod m_ConvolutionMethod;
48 
49  void FreeUnusedTensors();
50 };
51 
52 } //namespace armnn
53 
Copyright (c) 2021 ARM Limited and Contributors.
arm_compute::Status ClConvolution2dWorkloadValidate(const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, bool isFastMathEnabled, const ActivationDescriptor *activationDescriptor)
arm_compute::ConvolutionMethod GetConvolutionMethod() const
ClConvolution2dWorkload(const Convolution2dQueueDescriptor &descriptor, const WorkloadInfo &info, std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager, const arm_compute::CLCompileContext &clCompileContext, const bool isFastMathEnabled=false)
Status
enumeration
Definition: Types.hpp:29
Contains information about TensorInfos of a layer.