From ec81999c4f41380b8181672cb73b5bf6bf08e5c3 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Thu, 10 Feb 2022 14:47:13 +0000 Subject: IVGCVSW-6700 Add override functions to all typed Neon/CL workloads * Neon and CL workloads which inherit from TypedWorkload instead of the BaseWorklod for their backend do not contain the correct ReplaceInputTensorHandle/ReplaceOutputTensorHandle and Reconfigure functions. So they have been added directly. * Removed the Profiling call from ClConvolution2dWorkload::Reconfigure() to avoid a segfault Signed-off-by: David Monahan Change-Id: I7b9d1b48fdb17db1662dc03c22acc746340ce73f --- .../workloads/NeonConvertFp16ToFp32Workload.cpp | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/backends/neon/workloads/NeonConvertFp16ToFp32Workload.cpp') diff --git a/src/backends/neon/workloads/NeonConvertFp16ToFp32Workload.cpp b/src/backends/neon/workloads/NeonConvertFp16ToFp32Workload.cpp index 1b9e1bcfb5..ce6c785329 100644 --- a/src/backends/neon/workloads/NeonConvertFp16ToFp32Workload.cpp +++ b/src/backends/neon/workloads/NeonConvertFp16ToFp32Workload.cpp @@ -40,4 +40,42 @@ void NeonConvertFp16ToFp32Workload::Execute() const } } +void NeonConvertFp16ToFp32Workload::ReplaceInputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) +{ + ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot]; + this->m_Data.m_Inputs[slot] = tensorHandle; + try + { + Reconfigure(); + } + catch(armnn::UnimplementedException& e) + { + // Cannot reconfigure, revert the slot back and throw the exception. + this->m_Data.m_Inputs[slot] = backupHandle; + throw e; + } +} + +// Replace output tensor handle with the given TensorHandle +void NeonConvertFp16ToFp32Workload::ReplaceOutputTensorHandle(ITensorHandle* tensorHandle, unsigned int slot) +{ + ITensorHandle* backupHandle = this->m_Data.m_Inputs[slot]; + this->m_Data.m_Inputs[slot] = tensorHandle; + try + { + Reconfigure(); + } + catch(armnn::UnimplementedException& e) + { + // Cannot reconfigure, revert the slot back and throw the exception. + this->m_Data.m_Inputs[slot] = backupHandle; + throw e; + } +} + +void NeonConvertFp16ToFp32Workload::Reconfigure() +{ + throw armnn::UnimplementedException("Reconfigure not implemented for this workload"); +} + } //namespace armnn -- cgit v1.2.1