Skip to content

Commit ced983a

Browse files
Jim Meyeringfacebook-github-bot
authored andcommitted
executorch/{kernel,examples}: fix llvm-17-exposed format mismatches (#6350)
Summary: Pull Request resolved: #6350 This avoids the following errors: executorch/examples/portable/custom_ops/custom_ops_1_out.cpp:23:7: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] executorch/examples/portable/custom_ops/custom_ops_1_out.cpp:27:7: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] xplat/executorch/kernels/test/custom_kernel_example/op_relu.cpp:90:11: error: format specifies type 'char' but the argument has type 'ScalarType' [-Werror,-Wformat] Reviewed By: tarun292 Differential Revision: D64577370 fbshipit-source-id: d9e77b2563d21e6e2103467653f9f265a989776f
1 parent b1c94ab commit ced983a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/portable/custom_ops/custom_ops_1_out.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ void check_preconditions(const Tensor& in, Tensor& out) {
2020
ET_CHECK_MSG(
2121
out.scalar_type() == ScalarType::Float,
2222
"Expected out tensor to have dtype Float, but got %hhd instead",
23-
out.scalar_type());
23+
static_cast<int8_t>(out.scalar_type()));
2424
ET_CHECK_MSG(
2525
in.scalar_type() == ScalarType::Float,
2626
"Expected in tensor to have dtype Float, but got %hhd instead",
27-
in.scalar_type());
27+
static_cast<int8_t>(in.scalar_type()));
2828
ET_CHECK_MSG(
2929
out.dim() == in.dim(),
3030
"Number of dims of out tensor is not compatible with inputs");

kernels/test/custom_kernel_example/op_relu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ my_relu_out(KernelRuntimeContext& context, const Tensor& input, Tensor& out) {
8787
InvalidArgument,
8888
out,
8989
"Unhandled dtype %hhd",
90-
input.scalar_type());
90+
static_cast<int8_t>(input.scalar_type()));
9191
}
9292
#undef RELU
9393

0 commit comments

Comments
 (0)