From 6ed43b58e74281cbdde2219962048bc36d560a3b Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 12 Jul 2018 17:34:22 +0100 Subject: COMPMID-1188: Report error on graphs that do not support NHWC Change-Id: I14c6ded780339aa75555ea5f62247c509e64d0b0 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/139797 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- arm_compute/core/Error.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'arm_compute/core/Error.h') diff --git a/arm_compute/core/Error.h b/arm_compute/core/Error.h index e254956ad7..9f51fa234c 100644 --- a/arm_compute/core/Error.h +++ b/arm_compute/core/Error.h @@ -269,6 +269,20 @@ Status create_error(ErrorCode error_code, const char *function, const char *file */ #define ARM_COMPUTE_ERROR_LOC(func, file, line, ...) ::arm_compute::error(func, file, line, __VA_ARGS__) // NOLINT +/** If the condition is true, the given message is printed and program exits + * + * @param[in] cond Condition to evaluate. + * @param[in] ... Message to print if cond is false. + */ +#define ARM_COMPUTE_EXIT_ON_MSG(cond, ...) \ + do \ + { \ + if(cond) \ + { \ + ARM_COMPUTE_ERROR(__VA_ARGS__); \ + } \ + } while(false) + #ifdef ARM_COMPUTE_ASSERTS_ENABLED /** Checks if a status value is valid if not throws an exception with the error * @@ -283,13 +297,7 @@ Status create_error(ErrorCode error_code, const char *function, const char *file * @param[in] ... Message to print if cond is false. */ #define ARM_COMPUTE_ERROR_ON_MSG(cond, ...) \ - do \ - { \ - if(cond) \ - { \ - ARM_COMPUTE_ERROR(__VA_ARGS__); \ - } \ - } while(0) + ARM_COMPUTE_EXIT_ON_MSG(cond, __VA_ARGS__) /** If the condition is true, the given message is printed and an exception is thrown * @@ -306,7 +314,7 @@ Status create_error(ErrorCode error_code, const char *function, const char *file { \ ARM_COMPUTE_ERROR_LOC(func, file, line, __VA_ARGS__); \ } \ - } while(0) + } while(false) /** If the condition is true, the given message is printed and an exception is thrown, otherwise value is returned * -- cgit v1.2.1