Release 18.08
[platform/upstream/armnn.git] / src / armnn / backends / ClWorkloads / ClDepthwiseConvolutionBaseWorkload.hpp
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // See LICENSE file in the project root for full license information.
4 //
5
6 #pragma once
7
8 #include "backends/ClWorkloadUtils.hpp"
9
10 namespace armnn
11 {
12
13 arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo& input,
14                                                            const TensorInfo& output,
15                                                            const DepthwiseConvolution2dDescriptor& descriptor,
16                                                            const TensorInfo& weights,
17                                                            const TensorInfo& biases);
18
19 template<armnn::DataType... dataTypes>
20 class ClDepthwiseConvolutionBaseWorkload : public TypedWorkload<DepthwiseConvolution2dQueueDescriptor, dataTypes...>
21 {
22 public:
23     using TypedWorkload<DepthwiseConvolution2dQueueDescriptor, dataTypes...>::m_Data;
24
25     ClDepthwiseConvolutionBaseWorkload(const DepthwiseConvolution2dQueueDescriptor& descriptor,
26                                        const WorkloadInfo& info);
27
28 protected:
29     std::unique_ptr<arm_compute::IFunction> m_DepthwiseConvolutionLayer;
30
31     std::unique_ptr<arm_compute::CLTensor> m_KernelTensor;
32     std::unique_ptr<arm_compute::CLTensor> m_BiasTensor;
33
34     void FreeUnusedTensors();
35 };
36
37 } //namespace armnn