Skip to content

Commit 6c5ea41

Browse files
edgchen1ashrit-ms
authored andcommitted
Revert "[QNN EP] Clean up correctly from a partial setup (#23320)" (#23420)
### Description <!-- Describe your changes. --> This reverts commit 5d215ff. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> The reverted change causes a packaging pipeline to fail due to a crash in one of the E2E Android tests. Reverting this first to fix the pipeline. We should come up with an alternative way to properly do the necessary clean up.
1 parent e866804 commit 6c5ea41

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc

+10-6
Original file line numberDiff line numberDiff line change
@@ -1097,35 +1097,39 @@ Status QnnBackendManager::TerminateQnnLog() {
10971097
}
10981098

10991099
void QnnBackendManager::ReleaseResources() {
1100+
if (!backend_setup_completed_) {
1101+
return;
1102+
}
1103+
11001104
auto result = ReleaseContext();
11011105
if (Status::OK() != result) {
1102-
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext: " << result.ErrorMessage();
1106+
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext.";
11031107
}
11041108

11051109
result = ReleaseProfilehandle();
11061110
if (Status::OK() != result) {
1107-
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle: " << result.ErrorMessage();
1111+
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle.";
11081112
}
11091113

11101114
result = ReleaseDevice();
11111115
if (Status::OK() != result) {
1112-
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice: " << result.ErrorMessage();
1116+
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice.";
11131117
}
11141118

11151119
result = ShutdownBackend();
11161120
if (Status::OK() != result) {
1117-
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend: " << result.ErrorMessage();
1121+
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend.";
11181122
}
11191123

11201124
result = TerminateQnnLog();
11211125
if (Status::OK() != result) {
1122-
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog: " << result.ErrorMessage();
1126+
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog.";
11231127
}
11241128

11251129
if (backend_lib_handle_) {
11261130
result = UnloadLib(backend_lib_handle_);
11271131
if (Status::OK() != result) {
1128-
LOGS_DEFAULT(ERROR) << "Failed to unload backend library: " << result.ErrorMessage();
1132+
LOGS_DEFAULT(ERROR) << "Failed to unload backend library.";
11291133
}
11301134
}
11311135

0 commit comments

Comments
 (0)