mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
Remove uwp onsuspending winrt call because logruntimeperf is getting removed (#2630)
This commit is contained in:
parent
352c58d1b9
commit
75fbaa7255
1 changed files with 0 additions and 21 deletions
|
|
@ -43,15 +43,6 @@ inline onnxruntime::logging::LoggingManager& DefaultLoggingManager() {
|
|||
return default_logging_manager;
|
||||
}
|
||||
|
||||
static void OnSuspending(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::ApplicationModel::SuspendingEventArgs const& args) {
|
||||
#ifdef LAYERING_DONE
|
||||
if (!profiler.IsStillReset()) //If profiler is still reset, then don't log RuntimePerf
|
||||
{
|
||||
telemetry_helper.LogRuntimePerf(profiler, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
class LotusEnvironment {
|
||||
public:
|
||||
LotusEnvironment() {
|
||||
|
|
@ -74,14 +65,10 @@ class LotusEnvironment {
|
|||
[](int) { return std::make_unique<onnxruntime::CPUAllocator>(); },
|
||||
std::numeric_limits<size_t>::max());
|
||||
}
|
||||
RegisterSuspendHandler();
|
||||
}
|
||||
|
||||
~LotusEnvironment() {
|
||||
TraceLoggingUnregister(winmla::winml_trace_logging_provider);
|
||||
if (suspend_token_) {
|
||||
winrt::Windows::ApplicationModel::Core::CoreApplication::Suspending(suspend_token_);
|
||||
}
|
||||
}
|
||||
|
||||
const onnxruntime::logging::Logger* GetDefaultLogger() {
|
||||
|
|
@ -89,15 +76,7 @@ class LotusEnvironment {
|
|||
}
|
||||
|
||||
private:
|
||||
void RegisterSuspendHandler() {
|
||||
try {
|
||||
suspend_token_ = winrt::Windows::ApplicationModel::Core::CoreApplication::Suspending(
|
||||
winrt::Windows::Foundation::EventHandler<winrt::Windows::ApplicationModel::SuspendingEventArgs>(&OnSuspending));
|
||||
} catch (...) {}//Catch in case CoreApplication cannot be found for non-UWP executions
|
||||
}
|
||||
|
||||
std::unique_ptr<onnxruntime::Environment> lotus_environment_;
|
||||
winrt::event_token suspend_token_;
|
||||
onnxruntime::logging::LoggingManager* default_logging_manager_;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue