blob: d5bb932c6ef9a74961abced9555084c496ef3e11 [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
Mike Kellyec67a0f2022-11-25 13:55:24 +00002// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.
David Beckecb56cd2018-09-05 12:52:57 +01003// SPDX-License-Identifier: MIT
telsoa014fcda012018-03-09 14:13:49 +00004//
5
6#pragma once
7
Teresa Charlin588cbdf2022-01-19 15:55:37 +00008#include "NeonBaseWorkload.hpp"
telsoa014fcda012018-03-09 14:13:49 +00009
Matthew Benthamd80a7122019-01-08 17:52:37 +000010#include <arm_compute/core/Error.h>
11#include <arm_compute/runtime/IFunction.h>
David Beck0dbe0ee2018-09-24 15:59:27 +010012#include <arm_compute/runtime/MemoryManagerOnDemand.h>
Matthew Benthamd80a7122019-01-08 17:52:37 +000013#include <arm_compute/runtime/Tensor.h>
surmeh013537c2c2018-05-18 16:31:43 +010014
15#include <memory>
16
telsoa014fcda012018-03-09 14:13:49 +000017namespace armnn
18{
19
telsoa01c577f2c2018-08-31 09:22:23 +010020arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo& input,
21 const TensorInfo& output,
22 const TensorInfo& weights,
Matthew Bentham67d63902022-02-08 15:03:07 +000023 const Optional<TensorInfo>& biases,
Mike Kelly07810fc2020-11-12 10:58:48 +000024 const FullyConnectedDescriptor& descriptor,
25 const ActivationDescriptor* activationDescriptor = nullptr);
telsoa01c577f2c2018-08-31 09:22:23 +010026
Teresa Charlin588cbdf2022-01-19 15:55:37 +000027class NeonFullyConnectedWorkload : public NeonBaseWorkload<FullyConnectedQueueDescriptor>
telsoa014fcda012018-03-09 14:13:49 +000028{
29public:
kevmay01e448be32018-09-26 10:21:55 +010030 NeonFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor, const WorkloadInfo& info,
31 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager);
Mike Kellyec67a0f2022-11-25 13:55:24 +000032
telsoa014fcda012018-03-09 14:13:49 +000033 virtual void Execute() const override;
34
35private:
Matthew Benthamd80a7122019-01-08 17:52:37 +000036 std::unique_ptr<arm_compute::IFunction> m_FullyConnectedLayer;
Mike Kellyec67a0f2022-11-25 13:55:24 +000037 mutable std::unique_ptr<arm_compute::Tensor> m_WeightsTensor;
38 mutable std::unique_ptr<arm_compute::Tensor> m_BiasesTensor;
39 TensorInfo m_WeightsTensorInfo;
40 TensorInfo m_BiasesTensorInfo;
41 mutable bool prepared = false;
telsoa014fcda012018-03-09 14:13:49 +000042};
43
44} //namespace armnn
45