telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
David Beck | ecb56cd | 2018-09-05 12:52:57 +0100 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
David Beck | ac42efd | 2018-09-26 17:41:13 +0100 | [diff] [blame] | 8 | #include <backends/Workload.hpp> |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 9 | #include <boost/optional.hpp> |
| 10 | |
Matthew Bentham | 14e4669 | 2018-09-20 15:35:30 +0100 | [diff] [blame] | 11 | #include <arm_compute/runtime/CL/CLFunctions.h> |
| 12 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 13 | namespace armnn |
| 14 | { |
| 15 | |
| 16 | arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo& input, |
| 17 | const TensorInfo& output, |
| 18 | const DepthwiseConvolution2dDescriptor& descriptor, |
| 19 | const TensorInfo& weights, |
arovir01 | a682410 | 2018-08-28 17:40:45 +0100 | [diff] [blame] | 20 | const boost::optional<TensorInfo>& biases); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 21 | |
| 22 | template<armnn::DataType... dataTypes> |
| 23 | class ClDepthwiseConvolutionBaseWorkload : public TypedWorkload<DepthwiseConvolution2dQueueDescriptor, dataTypes...> |
| 24 | { |
| 25 | public: |
| 26 | using TypedWorkload<DepthwiseConvolution2dQueueDescriptor, dataTypes...>::m_Data; |
| 27 | |
| 28 | ClDepthwiseConvolutionBaseWorkload(const DepthwiseConvolution2dQueueDescriptor& descriptor, |
| 29 | const WorkloadInfo& info); |
| 30 | |
| 31 | protected: |
| 32 | std::unique_ptr<arm_compute::IFunction> m_DepthwiseConvolutionLayer; |
| 33 | |
| 34 | std::unique_ptr<arm_compute::CLTensor> m_KernelTensor; |
| 35 | std::unique_ptr<arm_compute::CLTensor> m_BiasTensor; |
| 36 | |
| 37 | void FreeUnusedTensors(); |
| 38 | }; |
| 39 | |
| 40 | } //namespace armnn |