|
|
@ -258,7 +258,12 @@ inline void throw_on_error(T e) {
|
|
|
|
#define PADDLE_THROW(...) \
|
|
|
|
#define PADDLE_THROW(...) \
|
|
|
|
throw ::paddle::platform::EnforceNotMet(__FILE__, __LINE__, __VA_ARGS__)
|
|
|
|
throw ::paddle::platform::EnforceNotMet(__FILE__, __LINE__, __VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
|
|
#define __PADDLE_THROW_ERROR(COND, ...) \
|
|
|
|
#define __PADDLE_THROW_ERROR_I(_, _9, _8, _7, _6, _5, _4, _3, _2, X_, ...) X_;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define __THROW_ON_ERROR_ONE_ARG(COND, ARG) \
|
|
|
|
|
|
|
|
::paddle::platform::throw_on_error(COND, "%s", std::string(ARG));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define __PADDLE_THROW_ON_ERROR(COND, ...) \
|
|
|
|
__PADDLE_THROW_ERROR_I( \
|
|
|
|
__PADDLE_THROW_ERROR_I( \
|
|
|
|
__VA_ARGS__, ::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
__VA_ARGS__, ::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
@ -268,15 +273,13 @@ inline void throw_on_error(T e) {
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND, __VA_ARGS__), \
|
|
|
|
::paddle::platform::throw_on_error(COND))
|
|
|
|
__THROW_ON_ERROR_ONE_ARG(COND, __VA_ARGS__))
|
|
|
|
|
|
|
|
|
|
|
|
#define __PADDLE_THROW_ERROR_I(_, _9, _8, _7, _6, _5, _4, _3, _2, X_, ...) X_;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define __PADDLE_UNARY_COMPARE(COND, ...) \
|
|
|
|
#define __PADDLE_UNARY_COMPARE(COND, ...) \
|
|
|
|
do { \
|
|
|
|
do { \
|
|
|
|
auto __cond = COND; \
|
|
|
|
auto __cond = COND; \
|
|
|
|
if (UNLIKELY(::paddle::platform::is_error(__cond))) { \
|
|
|
|
if (UNLIKELY(::paddle::platform::is_error(__cond))) { \
|
|
|
|
__PADDLE_THROW_ERROR(__cond, __VA_ARGS__); \
|
|
|
|
__PADDLE_THROW_ON_ERROR(__cond, __VA_ARGS__); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
|
|