mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
41 lines
No EOL
789 B
C++
41 lines
No EOL
789 B
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
#include "WinMLProfiler.h"
|
|
|
|
namespace Windows::AI::MachineLearning::Telemetry {
|
|
|
|
enum class EventCategory {
|
|
kModelLoad = 0,
|
|
kSessionCreation,
|
|
kBinding,
|
|
kEvaluation,
|
|
};
|
|
|
|
class TelemetryEvent {
|
|
public:
|
|
TelemetryEvent(
|
|
EventCategory eventCategory);
|
|
|
|
~TelemetryEvent();
|
|
|
|
private:
|
|
EventCategory category_;
|
|
std::optional<int64_t> event_id_;
|
|
};
|
|
|
|
// Wrapper to telemetry event. if the call throws the destructor is still called
|
|
class PerformanceTelemetryEvent : public TelemetryEvent {
|
|
public:
|
|
PerformanceTelemetryEvent(
|
|
WinMLRuntimePerf mode);
|
|
|
|
~PerformanceTelemetryEvent();
|
|
|
|
private:
|
|
WinMLRuntimePerf mode_;
|
|
};
|
|
|
|
} // namespace Windows::AI::MachineLearning::Telemetry
|