mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
41 lines
789 B
C
41 lines
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
|