File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
runtime/core/exec_aten/util Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 338
338
*
339
339
* @param[in] cond the condition to check
340
340
*/
341
- #define ET_LOG_AND_RETURN_IF_FALSE (cond ) \
341
+ #define ET_LOG_AND_RETURN_UNLESS (cond ) \
342
342
do { \
343
343
if (!(cond)) { \
344
344
ET_LOG (Error, " Check failed (%s): " , #cond); \
345
345
return false ; \
346
346
} \
347
347
} while (false )
348
348
349
+ /* *
350
+ * Backward compatibility shim for the old name of ET_LOG_AND_RETURN_UNLESS.
351
+ */
352
+ #define ET_LOG_AND_RETURN_IF_FALSE ET_LOG_AND_RETURN_UNLESS
353
+
349
354
/* *
350
355
* A convenience macro to be used in utility functions that check whether input
351
356
* tensor(s) are valid, which are expected to return a boolean. Checks whether
354
359
* @param[in] cond the condition to check
355
360
* @param[in] message an additional message to log with `cond`
356
361
*/
357
- #define ET_LOG_MSG_AND_RETURN_IF_FALSE (cond, message, ...) \
362
+ #define ET_LOG_MSG_AND_RETURN_UNLESS (cond, message, ...) \
358
363
do { \
359
364
if (!(cond)) { \
360
365
ET_LOG (Error, " Check failed (%s): " message, #cond, ##__VA_ARGS__); \
361
366
return false ; \
362
367
} \
363
368
} while (false )
364
369
370
+ /* *
371
+ * Backward compatibility shim for the old name of ET_LOG_MSG_AND_RETURN_UNLESS
372
+ */
373
+ #define ET_LOG_MSG_AND_RETURN_IF_FALSE ET_LOG_MSG_AND_RETURN_UNLESS
374
+
365
375
/* *
366
376
* If `cond` is false, log `cond` and return from the kernel with a failure
367
377
* state set.
You can’t perform that action at this time.
0 commit comments