diff options
Diffstat (limited to 'include/armnn')
-rw-r--r-- | include/armnn/backends/IWorkload.hpp | 4 | ||||
-rw-r--r-- | include/armnn/backends/Workload.hpp | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/armnn/backends/IWorkload.hpp b/include/armnn/backends/IWorkload.hpp index d63e0acc72..ce3914bc5a 100644 --- a/include/armnn/backends/IWorkload.hpp +++ b/include/armnn/backends/IWorkload.hpp @@ -31,6 +31,10 @@ public: virtual profiling::ProfilingGuid GetGuid() const = 0; + // SupportsTensorHandleReplacement signals that a given workload is capable of + // replacing any of its I/O tensors via ReplaceInput/OutputTensorHandle + virtual bool SupportsTensorHandleReplacement() const = 0; + // Replace input tensor handle with the given TensorHandle virtual void ReplaceInputTensorHandle(ITensorHandle* /*input*/, unsigned int /*slot*/) = 0; diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp index 07e1abb392..21109480dc 100644 --- a/include/armnn/backends/Workload.hpp +++ b/include/armnn/backends/Workload.hpp @@ -54,16 +54,23 @@ public: profiling::ProfilingGuid GetGuid() const final { return m_Guid; } + virtual bool SupportsTensorHandleReplacement() const override + { + return false; + } + // Replace input tensor handle with the given TensorHandle void ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override { - m_Data.m_Inputs[slot] = tensorHandle; + armnn::IgnoreUnused(tensorHandle, slot); + throw armnn::UnimplementedException("ReplaceInputTensorHandle not implemented for this workload"); } // Replace output tensor handle with the given TensorHandle void ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) override { - m_Data.m_Outputs[slot] = tensorHandle; + armnn::IgnoreUnused(tensorHandle, slot); + throw armnn::UnimplementedException("ReplaceOutputTensorHandle not implemented for this workload"); } protected: |