diff options
Diffstat (limited to 'src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp')
-rw-r--r-- | src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp b/src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp index 017fcaf454..d4ae925d9f 100644 --- a/src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp +++ b/src/backends/cl/workloads/ClConvertFp32ToFp16Workload.cpp @@ -57,5 +57,42 @@ arm_compute::Status ClConvertFp32ToFp16WorkloadValidate(const TensorInfo& input, return aclStatus; } +void ClConvertFp32ToFp16Workload::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 ClConvertFp32ToFp16Workload::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 ClConvertFp32ToFp16Workload::Reconfigure() +{ + throw armnn::UnimplementedException("Reconfigure not implemented for this workload"); +} } //namespace armnn |