ArmNN
 24.08
TosaRefPreCompiledWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 
10 #include <graph_status.h>
11 #include <model_runner.h>
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 namespace armnn
18 {
19 
20 bool TosaRefPreCompiledWorkloadValidate(std::string* reasonIfUnsupported);
21 
22 class TosaRefPreCompiledWorkload : public BaseWorkload<PreCompiledQueueDescriptor>
23 {
24 public:
26  const WorkloadInfo& info);
27  void Execute() const override;
28 
29 private:
30  bool SupportsTensorHandleReplacement() const override
31  {
32  return true;
33  }
34 
35  void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override
36  {
37  this->m_Data.m_Inputs[slot] = tensorHandle;
38  }
39 
40  void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override
41  {
42  this->m_Data.m_Outputs[slot] = tensorHandle;
43  }
44 
45  template <typename T, typename Trunner>
46  void SetInput(TosaReference::IModelRunner& runner, std::string inputName, uint32_t inputIndex) const;
47 
48  template <typename T>
49  void SetInput(TosaReference::IModelRunner& runner, std::string inputName, uint32_t inputIndex) const;
50 
51  template <typename T, typename Trunner>
52  void GetOutput(TosaReference::IModelRunner& runner, std::string outputName, uint32_t outputIndex) const;
53 
54  template <typename T>
55  void GetOutput(TosaReference::IModelRunner& runner, std::string outputName, uint32_t outputIndex) const;
56 
57  WorkloadInfo m_workloadInfo;
58 };
59 
60 } //namespace armnn
armnn::ITensorHandle
Definition: ITensorHandle.hpp:16
armnn::PreCompiledQueueDescriptor
Definition: WorkloadData.hpp:512
armnn::WorkloadInfo
Contains information about TensorInfos of a layer.
Definition: WorkloadInfo.hpp:16
Workload.hpp
armnn::TosaRefPreCompiledWorkload
Definition: TosaRefPreCompiledWorkload.hpp:22
armnn::TosaRefPreCompiledWorkload::Execute
void Execute() const override
Definition: TosaRefPreCompiledWorkload.cpp:23
armnn::TosaRefPreCompiledWorkload::TosaRefPreCompiledWorkload
TosaRefPreCompiledWorkload(const PreCompiledQueueDescriptor &descriptor, const WorkloadInfo &info)
Definition: TosaRefPreCompiledWorkload.cpp:11
armnn::BoostLogSeverityMapping::info
@ info
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::BaseWorkload
Definition: Workload.hpp:33
armnn::BaseWorkload< PreCompiledQueueDescriptor >::m_Data
PreCompiledQueueDescriptor m_Data
Definition: Workload.hpp:89
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::TosaRefPreCompiledWorkloadValidate
bool TosaRefPreCompiledWorkloadValidate(std::string *)
Definition: TosaRefPreCompiledWorkload.cpp:166
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26