Skip to content

Commit 4df1592

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
Print errors in hex (#476)
Summary: Pull Request resolved: #476 Catherine beat me to fixing up the clang errors. Fixed up some places the errors werent getting printed in hex while I was here Reviewed By: cccclai Differential Revision: D49549284 fbshipit-source-id: a053c0e5e3e1e67a13ae6bc9f5a6621de8fa8180
1 parent 9c62249 commit 4df1592

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

runtime/executor/method.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class BackendDelegate final {
101101
if (!handle.ok()) {
102102
ET_LOG(
103103
Error,
104-
"Init failed for backend %s: %" PRIu32,
104+
"Init failed for backend %s: 0x%" PRIx32,
105105
backend_id,
106106
static_cast<uint32_t>(handle.error()));
107107
out->segment_.Free();
@@ -341,7 +341,7 @@ Error Method::parse_values() {
341341
if (!t.ok()) {
342342
ET_LOG(
343343
Error,
344-
"Failed parsing tensor at index %zu: %" PRIu32,
344+
"Failed parsing tensor at index %zu: 0x%" PRIx32,
345345
i,
346346
static_cast<uint32_t>(t.error()));
347347
return t.error();
@@ -358,7 +358,7 @@ Error Method::parse_values() {
358358
if (!tensors.ok()) {
359359
ET_LOG(
360360
Error,
361-
"Failed parsing tensor list at index %zu: %" PRIu32,
361+
"Failed parsing tensor list at index %zu: 0x%" PRIx32,
362362
i,
363363
static_cast<uint32_t>(tensors.error()));
364364
return tensors.error();
@@ -375,7 +375,7 @@ Error Method::parse_values() {
375375
if (!tensors.ok()) {
376376
ET_LOG(
377377
Error,
378-
"Failed parsing optional tensor list at index %zu: %" PRIu32,
378+
"Failed parsing optional tensor list at index %zu: 0x%" PRIx32,
379379
i,
380380
static_cast<uint32_t>(tensors.error()));
381381
return tensors.error();
@@ -687,17 +687,18 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) {
687687
ET_CHECK_OR_RETURN_ERROR(
688688
e.isTensor() || e.isScalar(),
689689
InvalidArgument,
690-
"The %zu-th input in method is expected Tensor or prim, but received %u",
690+
"The %zu-th input in method is expected Tensor or prim, but received %" PRIu32,
691691
input_idx,
692692
static_cast<uint32_t>(e.tag));
693693

694694
ET_CHECK_OR_RETURN_ERROR(
695695
e.tag == input_evalue.tag,
696696
InvalidArgument,
697-
"The %zu-th input of method should have the same type as the input_evalue, but get tag %u and tag %u",
697+
"The %zu-th input of method should have the same type as the input_evalue, but get tag %" PRIu32
698+
" and tag %" PRIu32,
698699
input_idx,
699700
static_cast<uint32_t>(e.tag),
700-
(unsigned int)input_evalue.tag);
701+
static_cast<uint32_t>(input_evalue.tag));
701702

702703
if (e.isTensor()) {
703704
const auto& t_dst = e.toTensor();
@@ -960,7 +961,7 @@ Error Method::execute_instruction() {
960961
if (err != Error::Ok) {
961962
ET_LOG(
962963
Error,
963-
"CALL_DELEGATE execute failed at instruction %zu: %" PRIu32,
964+
"CALL_DELEGATE execute failed at instruction %zu: 0x%" PRIx32,
964965
step_state_.instr_idx,
965966
static_cast<uint32_t>(err));
966967
return err;

0 commit comments

Comments
 (0)