Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,7 @@ void QnnLogging(const char* format,
}
}

Status QnnBackendManager::InitializeQnnLog(const logging::Logger& logger) {
logger_ = &logger;

Status QnnBackendManager::InitializeQnnLog() {
// Set Qnn log level align with Ort log level
auto ort_log_level = logger_->GetSeverity();
QnnLog_Level_t qnn_log_level = MapOrtSeverityToQNNLogLevel(ort_log_level);
Expand Down Expand Up @@ -1564,6 +1562,8 @@ Status QnnBackendManager::SetupBackend(const logging::Logger& logger,
std::unordered_map<std::string, std::unique_ptr<std::vector<std::string>>>& context_bin_map,
bool enable_htp_extended_udma_mode) {
std::lock_guard<std::recursive_mutex> lock(logger_recursive_mutex_);
if (logger_ != &logger)
logger_ = &logger;
Comment thread
edgchen1 marked this conversation as resolved.
if (backend_setup_completed_) {
LOGS(logger, VERBOSE) << "Backend setup already!";

Expand Down Expand Up @@ -1630,7 +1630,7 @@ Status QnnBackendManager::SetupBackend(const logging::Logger& logger,
}

if (status.IsOK()) {
status = InitializeQnnLog(logger);
status = InitializeQnnLog();
}
if (status.IsOK()) {
LOGS(logger, VERBOSE) << "SetLogger succeed.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class QnnBackendManager : public std::enable_shared_from_this<QnnBackendManager>

// Sets the ORT logger and creates a corresponding QNN logger with the same log level.
// NOTE: caller must lock the `logger_recursive_mutex_` before calling this function.
Status InitializeQnnLog(const logging::Logger& logger);
Status InitializeQnnLog();

// Terminate logging in the backend
// NOTE: This function locks the internal `logger_recursive_mutex_`.
Expand Down
Loading