Skip to content

Commit 4c99948

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Fix formatting data types in executorch/extension/pybindings/pybindings.cpp
Summary: Required for LLVM-17 Reviewed By: palmje Differential Revision: D54837754 fbshipit-source-id: b1e9c12cd2c4cdbf709b433dd6ce9a9b928df05c
1 parent 913e122 commit 4c99948

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

extension/pybindings/pybindings.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Module final {
9393
THROW_IF_ERROR(
9494
program.error(),
9595
"loading program failed with error: 0x%" PRIx32,
96-
program.error());
96+
static_cast<uint32_t>(program.error()));
9797
program_ = std::make_unique<Program>(std::move(program.get()));
9898

9999
// Figure out the size of each non_const layer we need to support every
@@ -137,7 +137,7 @@ class Module final {
137137
method.error(),
138138
"loading method %s failed with error 0x%" PRIx32,
139139
name,
140-
method.error());
140+
static_cast<uint32_t>(method.error()));
141141
methods_.insert(
142142
{std::string(name),
143143
std::make_unique<Method>(std::move(method.get()))});
@@ -164,7 +164,7 @@ class Module final {
164164
set_inputs_status,
165165
"method->set_inputs() for method '%s' failed with error 0x%" PRIx32,
166166
method_name.c_str(),
167-
set_inputs_status);
167+
static_cast<uint32_t>(set_inputs_status));
168168

169169
#ifdef USE_ATEN_LIB
170170
// [TLS handling] This is to workaround an assertion failure
@@ -196,15 +196,15 @@ class Module final {
196196
ET_LOG(
197197
Error,
198198
"ignoring error from set_output_data_ptr(): 0x%" PRIx32,
199-
output_status);
199+
static_cast<uint32_t>(output_status));
200200
}
201201
}
202202
}
203203
Error execute_status = method->execute();
204204
THROW_IF_ERROR(
205205
execute_status,
206206
"method->execute() failed with error 0x%" PRIx32,
207-
execute_status);
207+
static_cast<uint32_t>(execute_status));
208208
// process outputs
209209
std::vector<EValue> result(method->outputs_size());
210210

@@ -214,7 +214,7 @@ class Module final {
214214
get_outputs_status,
215215
"method->get_outputs() for method '%s' failed with error 0x%" PRIx32,
216216
method_name.c_str(),
217-
get_outputs_status);
217+
static_cast<uint32_t>(get_outputs_status));
218218

219219
return result;
220220
}
@@ -312,7 +312,7 @@ inline std::unique_ptr<Module> load_from_file(
312312
res.error(),
313313
"Failed to create MmapDataLoader from file %s, error: 0x:%" PRIx32,
314314
path.c_str(),
315-
res.error());
315+
static_cast<uint32_t>(res.error()));
316316

317317
auto loader = std::make_unique<MmapDataLoader>(std::move(res.get()));
318318
return std::make_unique<Module>(
@@ -502,7 +502,7 @@ struct PyModule final {
502502
"Tensor meta doesn't exist for output %zu, error is 0x%" PRIx32
503503
", skipping allocating storage",
504504
i,
505-
output_tensor_meta.error());
505+
static_cast<uint32_t>(output_tensor_meta.error()));
506506
output_storage_spans[i] = Span<uint8_t>();
507507
continue;
508508
}
@@ -586,7 +586,9 @@ struct PyModule final {
586586
Error status = bundled_program::LoadBundledInput(
587587
module_->get_method(method_name), bundled_program_ptr, testset_idx);
588588
THROW_IF_ERROR(
589-
status, "LoadBundledInput failed with status %" PRIu32, status);
589+
status,
590+
"LoadBundledInput failed with status %" PRIu32,
591+
static_cast<uint32_t>(status));
590592
}
591593

592594
void verify_result_with_bundled_expected_output(
@@ -603,15 +605,17 @@ struct PyModule final {
603605
rtol,
604606
atol);
605607
THROW_IF_ERROR(
606-
status, "Result verification failed with status %" PRIu32, status);
608+
status,
609+
"Result verification failed with status %" PRIu32,
610+
static_cast<uint32_t>(status));
607611
}
608612

609613
void plan_execute(const string method_name) {
610614
auto status = module_->get_method(method_name).execute();
611615
THROW_IF_ERROR(
612616
status,
613617
"executing execution plan for method 'forward' failed with error: 0x%" PRIx32,
614-
status);
618+
static_cast<uint32_t>(status));
615619
}
616620

617621
private:

0 commit comments

Comments
 (0)