Skip to content

Commit

Permalink
Fix crash in QNN EP - ResetQnnLogLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
ivberg committed Oct 15, 2024
1 parent 6407d81 commit 23cc588
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,12 @@ QnnLog_Level_t QnnBackendManager::MapOrtSeverityToQNNLogLevel(logging::Severity
}

Status QnnBackendManager::ResetQnnLogLevel() {
auto ort_log_level = logger_->GetSeverity();
LOGS(*logger_, INFO) << "Reset Qnn log level to ORT Logger level: " << (unsigned int)ort_log_level;
return UpdateQnnLogLevel(ort_log_level);
if (logger_ != nullptr && backend_initialized_) {
auto ort_log_level = logger_->GetSeverity();
LOGS(*logger_, INFO) << "Reset Qnn log level to ORT Logger level: " << (unsigned int)ort_log_level;
return UpdateQnnLogLevel(ort_log_level);
}
return Status::OK();
}

Status QnnBackendManager::UpdateQnnLogLevel(logging::Severity ort_log_level) {
Expand Down

0 comments on commit 23cc588

Please sign in to comment.