blob: acb190f384cdb4ffa22ddae7a2c53fb73e527a1a [file] [log] [blame]
Nattapat Chaimanowong77140882018-10-17 11:12:19 +01001//
2// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Colm Donelan0c479742021-12-10 12:43:54 +00008#include <armnn/backends/Workload.hpp>
Matthew Benthamd80a7122019-01-08 17:52:37 +00009
10#include <arm_compute/runtime/IFunction.h>
11#include <arm_compute/runtime/Tensor.h>
12
13#include <memory>
Nattapat Chaimanowong77140882018-10-17 11:12:19 +010014
15namespace armnn
16{
17
18arm_compute::Status NeonDepthwiseConvolutionWorkloadValidate(const TensorInfo& input,
19 const TensorInfo& output,
20 const DepthwiseConvolution2dDescriptor& descriptor,
21 const TensorInfo& weights,
Mike Kelly07810fc2020-11-12 10:58:48 +000022 const Optional<TensorInfo>& biases,
23 const ActivationDescriptor* activationDescriptor
24 = nullptr);
Nattapat Chaimanowong77140882018-10-17 11:12:19 +010025
26class NeonDepthwiseConvolutionWorkload : public BaseWorkload<DepthwiseConvolution2dQueueDescriptor>
27{
28public:
29 NeonDepthwiseConvolutionWorkload(const DepthwiseConvolution2dQueueDescriptor& descriptor,
30 const WorkloadInfo& info);
31
32 virtual void Execute() const override;
33
34private:
35 mutable std::unique_ptr<arm_compute::IFunction> m_pDepthwiseConvolutionLayer;
36
37 std::unique_ptr<arm_compute::Tensor> m_KernelTensor;
38 std::unique_ptr<arm_compute::Tensor> m_BiasTensor;
39
40 void FreeUnusedTensors();
41};
42
43} // namespace armnn