Skip to content

Commit 93f1f65

Browse files
hsharma35facebook-github-bot
authored andcommitted
Print non-zero error code returned by nnlib calls. (#15435)
Summary: Print the actual returned code for debugging. Differential Revision: D85720366
1 parent 30d7cae commit 93f1f65

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

backends/cadence/common/xt_macros.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010

1111
#include <executorch/runtime/core/exec_aten/util/tensor_util.h>
1212

13-
#define XT_KERNEL_CHECK(ctx, out, kernel, ...) \
14-
{ \
15-
const auto ret = kernel(__VA_ARGS__); \
16-
ET_KERNEL_CHECK_MSG( \
17-
ctx, \
18-
ret == 0, \
19-
InvalidArgument, \
20-
out, \
21-
"Failed to run kernel: " #kernel "(" #__VA_ARGS__ ")"); \
13+
#define XT_KERNEL_CHECK(ctx, out, kernel, ...) \
14+
{ \
15+
const auto ret = kernel(__VA_ARGS__); \
16+
ET_KERNEL_CHECK_MSG( \
17+
ctx, \
18+
ret == 0, \
19+
InvalidArgument, \
20+
out, \
21+
"Failed to run kernel: " #kernel "(" #__VA_ARGS__ \
22+
"). Returned code %d", \
23+
static_cast<int>(ret)); \
2224
}

0 commit comments

Comments
 (0)