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