diff --git a/runtime/core/exec_aten/util/tensor_util.h b/runtime/core/exec_aten/util/tensor_util.h index e16fe63e2a2..5ae85b7c8b9 100644 --- a/runtime/core/exec_aten/util/tensor_util.h +++ b/runtime/core/exec_aten/util/tensor_util.h @@ -338,7 +338,7 @@ * * @param[in] cond the condition to check */ -#define ET_LOG_AND_RETURN_IF_FALSE(cond) \ +#define ET_LOG_AND_RETURN_UNLESS(cond) \ do { \ if (!(cond)) { \ ET_LOG(Error, "Check failed (%s): ", #cond); \ @@ -346,6 +346,11 @@ } \ } while (false) +/** + * DEPRECATED: please use ET_LOG_AND_RETURN_UNLESS instead. + */ +#define ET_LOG_AND_RETURN_IF_FALSE ET_LOG_AND_RETURN_UNLESS + /** * A convenience macro to be used in utility functions that check whether input * tensor(s) are valid, which are expected to return a boolean. Checks whether @@ -354,7 +359,7 @@ * @param[in] cond the condition to check * @param[in] message an additional message to log with `cond` */ -#define ET_LOG_MSG_AND_RETURN_IF_FALSE(cond, message, ...) \ +#define ET_LOG_MSG_AND_RETURN_UNLESS(cond, message, ...) \ do { \ if (!(cond)) { \ ET_LOG(Error, "Check failed (%s): " message, #cond, ##__VA_ARGS__); \ @@ -362,6 +367,11 @@ } \ } while (false) +/** + * DEPRECATED: please use ET_LOG_AND_RETURN_UNLESS instead. + */ +#define ET_LOG_MSG_AND_RETURN_IF_FALSE ET_LOG_MSG_AND_RETURN_UNLESS + /** * If `cond` is false, log `cond` and return from the kernel with a failure * state set.