Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QNN EP] Include QNN error handle value in fallback error message. #23756

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions onnxruntime/core/providers/qnn/builder/qnn_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1034,13 +1034,12 @@ Status QuantizeData(gsl::span<const float> data, gsl::span<const uint32_t> shape
return Status::OK();
}

std::string_view GetQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface, Qnn_ErrorHandle_t qnn_error_handle) {
// From QNN SDK: The memory is statically owned and should not be freed by the caller.
std::string GetQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface, Qnn_ErrorHandle_t qnn_error_handle) {
const char* error_msg = nullptr;
if (qnn_interface.errorGetMessage(qnn_error_handle, &error_msg) == QNN_SUCCESS) {
return error_msg;
}
return "Unknown error.";
return MakeString("Unknown error. QNN error handle: ", qnn_error_handle);
}

std::string GetVerboseQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface,
Expand All @@ -1052,7 +1051,7 @@ std::string GetVerboseQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interfac
});
return error_msg;
}
return "Unknown error.";
return MakeString("Unknown error. QNN error handle: ", qnn_error_handle);
}

TensorShape GetTensorProtoShape(const ONNX_NAMESPACE::TensorShapeProto& tensor_shape_proto) {
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/qnn/builder/qnn_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ Status PermuteShape(gsl::span<const T> input_shape, gsl::span<const P> perm, gsl
}

// Gets error message associated with QNN error handle value.
std::string_view GetQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface,
Qnn_ErrorHandle_t qnn_error_handle);
std::string GetQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface,
Qnn_ErrorHandle_t qnn_error_handle);

// Gets verbose error message associated with QNN error handle value.
std::string GetVerboseQnnErrorMessage(const QNN_INTERFACE_VER_TYPE& qnn_interface,
Expand Down
Loading