From 8f6429de4c278d79f076ddcea3fe1495e28fb75e Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Tue, 1 Oct 2019 13:10:15 +0100 Subject: IVGCVSW-3818 Support Group convolution from Android Signed-off-by: Teresa Charlin Change-Id: Ie98688175203563ae08019c0c3c876d9c5eae24c --- ConversionUtils.hpp | 55 ++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) (limited to 'ConversionUtils.hpp') diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp index 2e4cadd7..de255803 100644 --- a/ConversionUtils.hpp +++ b/ConversionUtils.hpp @@ -125,43 +125,46 @@ static bool Fail(const char* formatStr, Args&&... args) // Convenience macro to call an Is*Supported function and log caller name together with reason for lack of support. // Called as: FORWARD_LAYER_SUPPORT_FUNC(__func__, Is*Supported, backends, a, b, c, d, e) #define FORWARD_LAYER_SUPPORT_FUNC(funcName, func, backends, supported, ...) \ - std::string reasonIfUnsupported; \ - try { \ - for (auto&& backendId : backends) \ +try \ +{ \ + for (auto&& backendId : backends) \ + { \ + auto layerSupportObject = armnn::GetILayerSupportByBackendId(backendId); \ + if (layerSupportObject) \ { \ - auto layerSupportObject = armnn::GetILayerSupportByBackendId(backendId); \ - if (layerSupportObject) \ + std::string reasonIfUnsupported; \ + supported = \ + layerSupportObject->func(__VA_ARGS__, armnn::Optional(reasonIfUnsupported)); \ + if (supported) \ { \ - supported = \ - layerSupportObject->func(__VA_ARGS__, armnn::Optional(reasonIfUnsupported)); \ - if (supported) \ + break; \ + } \ + else \ + { \ + if (reasonIfUnsupported.size() > 0) \ { \ - break; \ + ALOGD("%s: not supported by armnn: %s", funcName, reasonIfUnsupported.c_str()); \ } \ else \ { \ - if (reasonIfUnsupported.size() > 0) \ - { \ - ALOGD("%s: not supported by armnn: %s", funcName, reasonIfUnsupported.c_str()); \ - } \ - else \ - { \ - ALOGD("%s: not supported by armnn", funcName); \ - } \ + ALOGD("%s: not supported by armnn", funcName); \ } \ } \ - else \ - { \ - ALOGD("%s: backend not registered: %s", funcName, backendId.Get().c_str()); \ - } \ } \ - if (!supported) \ + else \ { \ - ALOGD("%s: not supported by any specified backend", funcName); \ + ALOGD("%s: backend not registered: %s", funcName, backendId.Get().c_str()); \ } \ - } catch (const armnn::InvalidArgumentException &e) { \ - throw armnn::InvalidArgumentException(e, "Failed to check layer support", CHECK_LOCATION()); \ - } + } \ + if (!supported) \ + { \ + ALOGD("%s: not supported by any specified backend", funcName); \ + } \ +} \ +catch (const armnn::InvalidArgumentException &e) \ +{ \ + throw armnn::InvalidArgumentException(e, "Failed to check layer support", CHECK_LOCATION()); \ +} template armnn::TensorShape GetTensorShapeForOperand(const Operand& operand) -- cgit v1.2.1