From bfa767ca56f9776e7dd3eecb4025cfeed87f9936 Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Wed, 9 Feb 2022 14:58:03 +0000 Subject: MLCE-754 'Improve operator support error/warning from Arm NN Delegate' * Improved error reporting on armnn_delegate Signed-off-by: Sadik Armagan Change-Id: I1bd131fb56d64b32b1fafad0465256178720226c --- delegate/src/DelegateUtils.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'delegate/src/DelegateUtils.hpp') diff --git a/delegate/src/DelegateUtils.hpp b/delegate/src/DelegateUtils.hpp index 678a3db002..e0ba1cf4e7 100644 --- a/delegate/src/DelegateUtils.hpp +++ b/delegate/src/DelegateUtils.hpp @@ -25,7 +25,7 @@ namespace { // Macro to call an IsSupported function and log caller name together with reason for lack of support -#define FORWARD_LAYER_SUPPORT_FUNC(funcName, tfLiteContext, func, backends, supported, ...) \ +#define FORWARD_LAYER_SUPPORT_FUNC(opName, tfLiteContext, func, backends, supported, ...) \ try \ { \ for (auto&& backendId : backends) \ @@ -45,23 +45,23 @@ try \ if (reasonIfUnsupported.size() > 0) \ { \ TFLITE_LOG_PROD(tflite::TFLITE_LOG_WARNING, \ - "%s: not supported by armnn: %s", funcName, reasonIfUnsupported.c_str()); \ + "%s: not supported by armnn: %s", opName, reasonIfUnsupported.c_str()); \ } \ else \ { \ TFLITE_LOG_PROD(tflite::TFLITE_LOG_WARNING, \ - "%s: not supported by armnn", funcName); \ + "%s: not supported by armnn", opName); \ } \ } \ } \ else \ { \ - TF_LITE_KERNEL_LOG(tfLiteContext, "%s: backend not registered: %s", funcName, backendId.Get().c_str()); \ + TF_LITE_KERNEL_LOG(tfLiteContext, "%s: backend not registered: %s", opName, backendId.Get().c_str()); \ } \ } \ if (!supported) \ { \ - TF_LITE_KERNEL_LOG(tfLiteContext, "%s: not supported by any specified backend", funcName); \ + TF_LITE_KERNEL_LOG(tfLiteContext, "%s: not supported by any specified backend", opName); \ } \ } \ catch (const armnn::InvalidArgumentException &e) \ @@ -224,7 +224,7 @@ armnn::IConnectableLayer* BroadcastTensor(const armnn::TensorInfo& inputInfo0, armnn::ReshapeDescriptor reshapeDescriptor; reshapeDescriptor.m_TargetShape = reshapedInfo.GetShape(); bool isSupported = false; - FORWARD_LAYER_SUPPORT_FUNC(__func__, + FORWARD_LAYER_SUPPORT_FUNC("RESHAPE", tfLiteContext, IsReshapeSupported, delegateData.m_Backends, @@ -331,7 +331,7 @@ TfLiteStatus FusedActivation(TfLiteContext* tfLiteContext, } bool isSupported = false; - FORWARD_LAYER_SUPPORT_FUNC(__func__, + FORWARD_LAYER_SUPPORT_FUNC("ACTIVATION", tfLiteContext, IsActivationSupported, data.m_Backends, @@ -561,7 +561,7 @@ TfLiteStatus ConnectConstant(armnn::IConnectableLayer* layer, { IgnoreUnused(layer); bool isSupported = false; - FORWARD_LAYER_SUPPORT_FUNC(__func__, + FORWARD_LAYER_SUPPORT_FUNC("CONSTANT", tfLiteContext, IsConstantSupported, data.m_Backends, @@ -608,7 +608,7 @@ TfLiteStatus ProcessInputs(armnn::IConnectableLayer* layer, { armnn::TensorInfo inputTensorInfo = GetTensorInfoForTfLiteTensor(tfLiteInputTensor); bool isSupported = false; - FORWARD_LAYER_SUPPORT_FUNC(__func__, + FORWARD_LAYER_SUPPORT_FUNC("CONSTANT", tfLiteContext, IsConstantSupported, delegateData.m_Backends, -- cgit v1.2.1