onnxruntime/winml/lib/Api.Ort/OnnxruntimeEnvironment.h
Ryan Lai 897310f6fb
Add suspend handler with new telemetry event for UWP scenarios (#5907)
* Add suspend handler with new telemetry event

* Fix build warning

* Use cppwinrt from nuget

* Restore nuget packages

* add dependencies

* Add nuget_helpers

* Cleaned up

* Clean up

* Comment

* Add dependencies for the rest

* Remove unused line

* Update activation string

* PR comment to remove ALL
2020-12-01 20:26:18 -08:00

31 lines
No EOL
659 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#pragma warning(push)
#pragma warning(disable : 4505)
namespace _winml {
class OnnxruntimeEnvironment {
public:
OnnxruntimeEnvironment(const OrtApi* ort_api);
~OnnxruntimeEnvironment();
HRESULT GetOrtEnvironment(_Out_ OrtEnv** ert_env);
HRESULT EnableDebugOutput(bool is_enabled);
private:
void RegisterSuspendHandler();
private:
UniqueOrtEnv ort_env_;
winrt::event_token suspend_token_;
};
const OrtApi* GetVersionedOrtApi();
const WinmlAdapterApi* GetVersionedWinmlAdapterApi();
} // namespace _winml
#pragma warning(pop)