Matthew Bentham | d806792 | 2018-10-03 17:18:04 +0100 | [diff] [blame^] | 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 | |
| 11 | #include <backends/Workload.hpp> |
| 12 | |
| 13 | #include <arm_compute/runtime/CL/functions/CLConvolutionLayer.h> |
| 14 | #include <arm_compute/runtime/MemoryManagerOnDemand.h> |
| 15 | |
| 16 | #include <boost/optional.hpp> |
| 17 | |
| 18 | #include <memory> |
| 19 | |
| 20 | namespace armnn |
| 21 | { |
| 22 | |
| 23 | arm_compute::Status ClConvolution2dWorkloadValidate(const TensorInfo& input, |
| 24 | const TensorInfo& output, |
| 25 | const Convolution2dDescriptor& descriptor, |
| 26 | const TensorInfo& weights, |
| 27 | const boost::optional<TensorInfo>& biases); |
| 28 | |
| 29 | class ClConvolution2dWorkload : public BaseWorkload<Convolution2dQueueDescriptor> |
| 30 | { |
| 31 | public: |
| 32 | ClConvolution2dWorkload(const Convolution2dQueueDescriptor& descriptor, const WorkloadInfo& info, |
| 33 | std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager); |
| 34 | void Execute() const override; |
| 35 | |
| 36 | private: |
| 37 | mutable arm_compute::CLConvolutionLayer m_ConvolutionLayer; |
| 38 | |
| 39 | std::unique_ptr<arm_compute::CLTensor> m_KernelTensor; |
| 40 | std::unique_ptr<arm_compute::CLTensor> m_BiasTensor; |
| 41 | |
| 42 | void FreeUnusedTensors(); |
| 43 | }; |
| 44 | |
| 45 | } //namespace armnn |
| 46 | |