blob: 9ffac96a869248b7d0b4570291ca213309df1af2 [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
David Beck0dbe0ee2018-09-24 15:59:27 +01008#include <backends/neon/workloads/NeonWorkloadUtils.hpp>
telsoa014fcda012018-03-09 14:13:49 +00009
David Beck0dbe0ee2018-09-24 15:59:27 +010010#include <arm_compute/runtime/MemoryManagerOnDemand.h>
surmeh013537c2c2018-05-18 16:31:43 +010011
12#include <memory>
13
telsoa014fcda012018-03-09 14:13:49 +000014namespace armnn
15{
16
telsoa01c577f2c2018-08-31 09:22:23 +010017arm_compute::Status NeonFullyConnectedWorkloadValidate(const TensorInfo& input,
18 const TensorInfo& output,
19 const TensorInfo& weights,
20 const TensorInfo& biases,
21 const FullyConnectedDescriptor& descriptor);
22
kevmay01e448be32018-09-26 10:21:55 +010023class NeonFullyConnectedWorkload : public BaseWorkload<FullyConnectedQueueDescriptor>
telsoa014fcda012018-03-09 14:13:49 +000024{
25public:
kevmay01e448be32018-09-26 10:21:55 +010026 NeonFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor, const WorkloadInfo& info,
27 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager);
telsoa014fcda012018-03-09 14:13:49 +000028 virtual void Execute() const override;
29
30private:
31 mutable arm_compute::NEFullyConnectedLayer m_FullyConnectedLayer;
telsoa01c577f2c2018-08-31 09:22:23 +010032
33 std::unique_ptr<arm_compute::Tensor> m_WeightsTensor;
34 std::unique_ptr<arm_compute::Tensor> m_BiasesTensor;
35
36 void FreeUnusedTensors();
telsoa014fcda012018-03-09 14:13:49 +000037};
38
39} //namespace armnn
40