Revert "[QNN EP] Clean up correctly from a partial setup (#23320)" (#23420)

### Description
<!-- Describe your changes. -->

This reverts commit 5d215ff810.

### 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.
This commit is contained in:
Edward Chen 2025-01-17 14:35:25 -08:00 committed by GitHub
parent ad312d9677
commit db8e10b0b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1097,35 +1097,39 @@ Status QnnBackendManager::TerminateQnnLog() {
}
void QnnBackendManager::ReleaseResources() {
if (!backend_setup_completed_) {
return;
}
auto result = ReleaseContext();
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext.";
}
result = ReleaseProfilehandle();
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle.";
}
result = ReleaseDevice();
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice.";
}
result = ShutdownBackend();
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend.";
}
result = TerminateQnnLog();
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog.";
}
if (backend_lib_handle_) {
result = UnloadLib(backend_lib_handle_);
if (Status::OK() != result) {
LOGS_DEFAULT(ERROR) << "Failed to unload backend library: " << result.ErrorMessage();
LOGS_DEFAULT(ERROR) << "Failed to unload backend library.";
}
}