Skip to content

Commit 0659684

Browse files
committed
Revert "[QNN EP] Clean up correctly from a partial setup (#23320)"
This reverts commit 5d215ff.
1 parent ad312d9 commit 0659684

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

Lines changed: 10 additions & 6 deletions
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)