telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [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 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 4 | // |
| 5 | |
surmeh01 | bceff2f | 2018-03-29 16:29:27 +0100 | [diff] [blame] | 6 | #pragma once |
| 7 | |
Aron Virginas-Tar | c9cc804 | 2018-11-01 16:15:57 +0000 | [diff] [blame] | 8 | #include <backendsCommon/Workload.hpp> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 9 | |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 10 | #include <arm_compute/runtime/IFunction.h> |
| 11 | #include <arm_compute/runtime/Tensor.h> |
David Beck | 711fa31 | 2018-09-24 10:46:38 +0100 | [diff] [blame] | 12 | #include <arm_compute/runtime/MemoryManagerOnDemand.h> |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 13 | |
| 14 | #include <memory> |
| 15 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 16 | namespace armnn |
| 17 | { |
| 18 | |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 19 | arm_compute::Status NeonConvolution2dWorkloadValidate(const TensorInfo& input, |
| 20 | const TensorInfo& output, |
| 21 | const Convolution2dDescriptor& descriptor, |
| 22 | const TensorInfo& weights, |
David Beck | 5eec11d | 2018-10-04 15:43:17 +0100 | [diff] [blame] | 23 | const Optional<TensorInfo>& biases); |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 24 | |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 25 | class NeonConvolution2dWorkload : public BaseWorkload<Convolution2dQueueDescriptor> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 26 | { |
| 27 | public: |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 28 | using BaseWorkload<Convolution2dQueueDescriptor>::m_Data; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 29 | |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 30 | NeonConvolution2dWorkload(const Convolution2dQueueDescriptor& descriptor, const WorkloadInfo& info, |
| 31 | std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 32 | |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 33 | void Execute() const override; |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 34 | |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 35 | private: |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 36 | std::unique_ptr<arm_compute::IFunction> m_ConvolutionLayer; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 37 | |
| 38 | std::unique_ptr<arm_compute::Tensor> m_KernelTensor; |
| 39 | std::unique_ptr<arm_compute::Tensor> m_BiasTensor; |
| 40 | |
| 41 | void FreeUnusedTensors(); |
Nattapat Chaimanowong | 974b65f | 2018-10-15 15:07:34 +0100 | [diff] [blame] | 42 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 43 | }; |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 44 | |
| 45 | } //namespace armnn |