Skip to content

Commit 7d7d082

Browse files
arfaiancopybara-github
authored andcommitted
Log error if shared library can't be loaded.
LiteRT-PiperOrigin-RevId: 820398912
1 parent 3477cd0 commit 7d7d082

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

litert/vendors/qualcomm/qnn_manager.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <memory>
2525
#include <optional>
2626
#include <string>
27+
#include <utility>
2728
#include <vector>
2829

2930
#include "absl/strings/match.h" // from @com_google_absl
@@ -111,8 +112,12 @@ LiteRtStatus QnnManager::LoadLib(absl::string_view path) {
111112
}
112113

113114
LiteRtStatus QnnManager::LoadSystemLib(absl::string_view path) {
114-
LITERT_ASSIGN_OR_RETURN(lib_system_,
115-
SharedLibrary::Load(path, RtldFlags::Default()));
115+
auto lib_system_or = SharedLibrary::Load(path, RtldFlags::Default());
116+
if (!lib_system_or) {
117+
LITERT_LOG(LITERT_ERROR, "%s", lib_system_or.Error().Message().data());
118+
return lib_system_or.Error().Status();
119+
}
120+
lib_system_ = std::move(lib_system_or.Value());
116121
return kLiteRtStatusOk;
117122
}
118123

0 commit comments

Comments
 (0)