blob: 6a4e5126cd044282125aed408e26cbaf5ff7b778 [file] [log] [blame]
Laurent Carlier749294b2020-06-01 09:03:17 +01001//
Francis Murtagh43aec582019-05-27 12:14:10 +01002// Copyright © 2017 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <backendsCommon/Workload.hpp>
9#include <backendsCommon/WorkloadData.hpp>
10#include "BaseIterator.hpp"
11#include "Decoders.hpp"
12#include "Encoders.hpp"
13
14
15namespace armnn
16{
17
18class RefFullyConnectedWorkload : public BaseWorkload<FullyConnectedQueueDescriptor>
19{
20public:
21 explicit RefFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor,
22 const WorkloadInfo& info);
23
24 void PostAllocationConfigure() override;
25
Finn Williamsb8181f72021-04-07 10:23:21 +010026 void Execute() const override;
27 void ExecuteAsync(WorkingMemDescriptor& workingMemDescriptor) override;
Francis Murtagh43aec582019-05-27 12:14:10 +010028
29private:
Finn Williamsb8181f72021-04-07 10:23:21 +010030 void PostAllocationConfigure(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs);
31 void Execute(std::vector<ITensorHandle*> inputs, std::vector<ITensorHandle*> outputs) const;
James Conroy1f58f032021-04-27 17:13:27 +010032 std::unique_ptr<ScopedTensorHandle> m_Weight;
33 std::unique_ptr<ScopedTensorHandle> m_Bias;
Francis Murtagh43aec582019-05-27 12:14:10 +010034
Francis Murtagh43aec582019-05-27 12:14:10 +010035 std::unique_ptr<Decoder<float>> m_WeightDecoder;
36 std::unique_ptr<Decoder<float>> m_BiasDecoder;
37
38 TensorShape m_InputShape;
39 TensorShape m_OutputShape;
40 TensorShape m_WeightShape;
41 unsigned int m_NumActivations;
42};
43
44} //namespace armnn