telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 1 | // |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 2 | // Copyright © 2017 Arm Ltd and Contributors. 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 | |
| 6 | #pragma once |
| 7 | |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 8 | #include "NeonBaseWorkload.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/core/Error.h> |
| 11 | #include <arm_compute/runtime/IFunction.h> |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 12 | #include <arm_compute/runtime/MemoryManagerOnDemand.h> |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 13 | #include <arm_compute/runtime/Tensor.h> |
surmeh01 | 3537c2c | 2018-05-18 16:31:43 +0100 | [diff] [blame] | 14 | |
| 15 | #include <memory> |
| 16 | |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 17 | namespace armnn |
| 18 | { |
| 19 | |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 20 | arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo& input, |
| 21 | const TensorInfo& output, |
| 22 | const TensorInfo& weights, |
| 23 | const TensorInfo& biases, |
Mike Kelly | 07810fc | 2020-11-12 10:58:48 +0000 | [diff] [blame] | 24 | const FullyConnectedDescriptor& descriptor, |
| 25 | const ActivationDescriptor* activationDescriptor = nullptr); |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 26 | |
Teresa Charlin | 588cbdf | 2022-01-19 15:55:37 +0000 | [diff] [blame] | 27 | class NeonFullyConnectedWorkload : public NeonBaseWorkload<FullyConnectedQueueDescriptor> |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 28 | { |
| 29 | public: |
kevmay01 | e448be3 | 2018-09-26 10:21:55 +0100 | [diff] [blame] | 30 | NeonFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor, const WorkloadInfo& info, |
| 31 | std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 32 | virtual void Execute() const override; |
| 33 | |
| 34 | private: |
Matthew Bentham | d80a712 | 2019-01-08 17:52:37 +0000 | [diff] [blame] | 35 | std::unique_ptr<arm_compute::IFunction> m_FullyConnectedLayer; |
telsoa01 | c577f2c | 2018-08-31 09:22:23 +0100 | [diff] [blame] | 36 | |
| 37 | std::unique_ptr<arm_compute::Tensor> m_WeightsTensor; |
| 38 | std::unique_ptr<arm_compute::Tensor> m_BiasesTensor; |
| 39 | |
| 40 | void FreeUnusedTensors(); |
telsoa01 | 4fcda01 | 2018-03-09 14:13:49 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | } //namespace armnn |
| 44 | |