blob: 1cd8be109ac904d59b603507c9af9940155b7833 [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,
24 const FullyConnectedDescriptor& descriptor);
25
kevmay01e448be32018-09-26 10:21:55 +010026class NeonFullyConnectedWorkload : public BaseWorkload<FullyConnectedQueueDescriptor>
telsoa014fcda012018-03-09 14:13:49 +000027{
28public:
kevmay01e448be32018-09-26 10:21:55 +010029 NeonFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor, const WorkloadInfo& info,
30 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager);
telsoa014fcda012018-03-09 14:13:49 +000031 virtual void Execute() const override;
32
33private:
Matthew Benthamd80a7122019-01-08 17:52:37 +000034 std::unique_ptr<arm_compute::IFunction> m_FullyConnectedLayer;
telsoa01c577f2c2018-08-31 09:22:23 +010035
36 std::unique_ptr<arm_compute::Tensor> m_WeightsTensor;
37 std::unique_ptr<arm_compute::Tensor> m_BiasesTensor;
38
39 void FreeUnusedTensors();
telsoa014fcda012018-03-09 14:13:49 +000040};
41
42} //namespace armnn
43