David Monahan | bd73808 | 2023-12-08 12:50:02 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2024 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include "armnn/backends/Workload.hpp" |
| 9 | |
| 10 | #include <arm_compute/core/ITensorInfo.h> |
| 11 | #include <arm_compute/core/TensorInfo.h> |
| 12 | #include <arm_compute/core/TensorShape.h> |
| 13 | #include <arm_compute/core/CL/CLKernelLibrary.h> |
| 14 | #include <arm_compute/core/CL/CLCompileContext.h> |
| 15 | |
| 16 | #include <arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h> |
| 17 | #include <arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h> |
| 18 | #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h> |
| 19 | #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuOutput.h> |
| 20 | |
| 21 | #include <memory> |
| 22 | #include <string> |
| 23 | #include <vector> |
| 24 | |
| 25 | namespace armnn |
| 26 | { |
| 27 | |
| 28 | bool GpuFsaPreCompiledWorkloadValidate(std::string* reasonIfUnsupported); |
| 29 | |
| 30 | class GpuFsaPreCompiledWorkload : public BaseWorkload<PreCompiledQueueDescriptor> |
| 31 | { |
| 32 | public: |
| 33 | GpuFsaPreCompiledWorkload(const PreCompiledQueueDescriptor& descriptor, |
| 34 | const WorkloadInfo& info); |
| 35 | void Execute() const override; |
| 36 | |
| 37 | private: |
| 38 | bool SupportsTensorHandleReplacement() const override |
| 39 | { |
| 40 | return true; |
| 41 | } |
| 42 | |
| 43 | void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override |
| 44 | { |
| 45 | this->m_Data.m_Inputs[slot] = tensorHandle; |
| 46 | } |
| 47 | |
| 48 | void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override |
| 49 | { |
| 50 | this->m_Data.m_Outputs[slot] = tensorHandle; |
| 51 | } |
| 52 | |
| 53 | WorkloadInfo m_workloadInfo; |
| 54 | }; |
| 55 | |
| 56 | } //namespace armnn |