xref: /aosp_15_r20/external/armnn/src/backends/cl/workloads/ClFullyConnectedWorkload.hpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1 //
2 // Copyright © 2017 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "ClBaseWorkload.hpp"
9 
10 #include <arm_compute/runtime/CL/functions/CLFullyConnectedLayer.h>
11 #include <arm_compute/runtime/MemoryManagerOnDemand.h>
12 
13 #include <memory>
14 
15 namespace armnn
16 {
17 
18 arm_compute::Status ClFullyConnectedWorkloadValidate(const TensorInfo& input,
19                                                      const TensorInfo& output,
20                                                      const TensorInfo& weights,
21                                                      const Optional<TensorInfo>& biases,
22                                                      const FullyConnectedDescriptor& descriptor,
23                                                      const ActivationDescriptor* activationDescriptor = nullptr);
24 
25 class ClFullyConnectedWorkload : public ClBaseWorkload<FullyConnectedQueueDescriptor>
26 {
27 public:
28     ClFullyConnectedWorkload(const FullyConnectedQueueDescriptor& descriptor,
29                              const WorkloadInfo& info,
30                              std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager,
31                              const arm_compute::CLCompileContext& clCompileContext);
32 
33     using ClBaseWorkload<FullyConnectedQueueDescriptor>::m_Data;
34     void Execute() const override;
35 
36 private:
37     mutable arm_compute::CLFullyConnectedLayer m_FullyConnectedLayer;
38 };
39 
40 } //namespace armnn
41