blob: 8dc7fdcd6c6b37005a87decd315c658a965341ec [file] [log] [blame]
telsoa014fcda012018-03-09 14:13:49 +00001//
2// Copyright © 2017 Arm Ltd. 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
Matthew Benthamd80a7122019-01-08 17:52:37 +00008#include <backendsCommon/Workload.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,
23 const 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
kevmay01e448be32018-09-26 10:21:55 +010027class NeonFullyConnectedWorkload : public BaseWorkload<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);
telsoa014fcda012018-03-09 14:13:49 +000032 virtual void Execute() const override;
33
34private:
Matthew Benthamd80a7122019-01-08 17:52:37 +000035 std::unique_ptr<arm_compute::IFunction> m_FullyConnectedLayer;
telsoa01c577f2c2018-08-31 09:22:23 +010036
37 std::unique_ptr<arm_compute::Tensor> m_WeightsTensor;
38 std::unique_ptr<arm_compute::Tensor> m_BiasesTensor;
39
40 void FreeUnusedTensors();
telsoa014fcda012018-03-09 14:13:49 +000041};
42
43} //namespace armnn
44