Polish code

test=develop
revert-15207-remove_op_handle_lock_and_fix_var
minqiyang 6 years ago
parent bc66401566
commit 41b81293ab

@ -260,24 +260,24 @@ inline void throw_on_error(T e) {
#define PADDLE_JUDGE
#define __PADDLE_UNARY_COMPARE(COND, ...) \
do { \
auto __cond = COND; \
if (UNLIKELY(::paddle::platform::is_error(__cond))) { \
::paddle::platform::throw_on_error(__cond, ##__VA_ARGS__); /* NOLINT */ \
} \
} while (0)
#define __PADDLE_UNARY_COMPARE(COND, ...) \
do { \
auto __cond = COND; \
if (UNLIKELY(::paddle::platform::is_error(__cond))) { \
::paddle::platform::throw_on_error(__cond, ##__VA_ARGS__); \
} \
} while (0) // NOLINT
#ifndef REPLACE_ENFORCE_GLOG
#define PADDLE_ENFORCE(COND, ...) \
do { \
try { \
__PADDLE_UNARY_COMPARE(COND, ##__VA_ARGS__); /* NOLINT */ \
__PADDLE_UNARY_COMPARE(COND, ##__VA_ARGS__); \
} catch (...) { \
throw ::paddle::platform::EnforceNotMet(std::current_exception(), \
__FILE__, __LINE__); \
} \
} while (false)
} while (0) // NOLINT
#else
#define PADDLE_ENFORCE(COND, ...) __PADDLE_UNARY_COMPARE(COND, ##__VA_ARGS__);

Loading…
Cancel
Save