blob: af672c8e70a74e970531b204877bbf78c26f3a41 [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
Aron Virginas-Tarc9cc8042018-11-01 16:15:57 +00008#include <backendsCommon/Workload.hpp>
telsoa014fcda012018-03-09 14:13:49 +00009
Matthew Bentham14e46692018-09-20 15:35:30 +010010#include <arm_compute/runtime/CL/CLFunctions.h>
11#include <arm_compute/runtime/MemoryManagerOnDemand.h>
surmeh013537c2c2018-05-18 16:31:43 +010012
13#include <memory>
telsoa014fcda012018-03-09 14:13:49 +000014
15namespace armnn
16{
17
telsoa01c577f2c2018-08-31 09:22:23 +010018arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo& input,
19 const TensorInfo& output,
20 const TensorInfo& weights,
21 const TensorInfo& biases,
22 const FullyConnectedDescriptor& descriptor);
23
Matthew Benthamab8cdc12018-09-17 11:17:41 +010024class ClFullyConnectedWorkload : public armnn::BaseWorkload<armnn::FullyConnectedQueueDescriptor>
telsoa014fcda012018-03-09 14:13:49 +000025{
26public:
Matthew Benthamab8cdc12018-09-17 11:17:41 +010027 ClFullyConnectedWorkload(const armnn::FullyConnectedQueueDescriptor& descriptor,
28 const armnn::WorkloadInfo& info,
29 std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager);
telsoa014fcda012018-03-09 14:13:49 +000030
Matthew Benthamab8cdc12018-09-17 11:17:41 +010031 using armnn::BaseWorkload<armnn::FullyConnectedQueueDescriptor>::m_Data;
telsoa014fcda012018-03-09 14:13:49 +000032 void Execute() const override;
33
34private:
telsoa01c577f2c2018-08-31 09:22:23 +010035 mutable arm_compute::CLFullyConnectedLayer m_FullyConnectedLayer;
36
37 std::unique_ptr<arm_compute::CLTensor> m_WeightsTensor;
38 std::unique_ptr<arm_compute::CLTensor> m_BiasesTensor;
39
40 void FreeUnusedTensors();
telsoa014fcda012018-03-09 14:13:49 +000041};
42
43} //namespace armnn