diff --git a/onnxruntime/core/platform/telemetry.cc b/onnxruntime/core/platform/telemetry.cc index 4fccbe6943a8b..e6092693c6661 100644 --- a/onnxruntime/core/platform/telemetry.cc +++ b/onnxruntime/core/platform/telemetry.cc @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include #include "core/platform/telemetry.h" #include "core/platform/env.h" @@ -67,7 +66,7 @@ void Telemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_la ORT_UNUSED_PARAMETER(total_run_duration_since_last); } -void Telemetry::LogExecutionProviderEvent(LUID adapterLuid) const { +void Telemetry::LogExecutionProviderEvent(LUID* adapterLuid) const { ORT_UNUSED_PARAMETER(adapterLuid); } diff --git a/onnxruntime/core/platform/telemetry.h b/onnxruntime/core/platform/telemetry.h index 81e80c26fa93f..051fda3c23489 100644 --- a/onnxruntime/core/platform/telemetry.h +++ b/onnxruntime/core/platform/telemetry.h @@ -57,7 +57,7 @@ class Telemetry { virtual void LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last) const; - virtual void LogExecutionProviderEvent(LUID adapterLuid) const; + virtual void LogExecutionProviderEvent(LUID* adapterLuid) const; private: ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(Telemetry); diff --git a/onnxruntime/core/platform/windows/telemetry.cc b/onnxruntime/core/platform/windows/telemetry.cc index 9952f604d8cab..35eae4af068de 100644 --- a/onnxruntime/core/platform/windows/telemetry.cc +++ b/onnxruntime/core/platform/windows/telemetry.cc @@ -216,7 +216,7 @@ void WindowsTelemetry::LogRuntimePerf(uint32_t session_id, uint32_t total_runs_s TraceLoggingInt64(total_run_duration_since_last, "totalRunDuration")); } -void WindowsTelemetry::LogExecutionProviderEvent(LUID adapterLuid) const { +void WindowsTelemetry::LogExecutionProviderEvent(LUID* adapterLuid) const { if (global_register_count_ == 0 || enabled_ == false) return; @@ -225,8 +225,8 @@ void WindowsTelemetry::LogExecutionProviderEvent(LUID adapterLuid) const { TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), // Telemetry info - TraceLoggingUInt32(adapterLuid.LowPart, "adapterLuidLowPart"), - TraceLoggingUInt32(adapterLuid.HighPart, "adapterLuidHighPart")); + TraceLoggingUInt32(adapterLuid->LowPart, "adapterLuidLowPart"), + TraceLoggingUInt32(adapterLuid->HighPart, "adapterLuidHighPart")); } } // namespace onnxruntime diff --git a/onnxruntime/core/platform/windows/telemetry.h b/onnxruntime/core/platform/windows/telemetry.h index ed2ae3973714b..d34b26860308e 100644 --- a/onnxruntime/core/platform/windows/telemetry.h +++ b/onnxruntime/core/platform/windows/telemetry.h @@ -42,7 +42,7 @@ class WindowsTelemetry : public Telemetry { void LogRuntimePerf(uint32_t session_id, uint32_t total_runs_since_last, int64_t total_run_duration_since_last) const override; - void LogExecutionProviderEvent(LUID adapterLuid) const override; + void LogExecutionProviderEvent(LUID* adapterLuid) const override; private: static OrtMutex mutex_; diff --git a/onnxruntime/core/providers/dml/dml_provider_factory.cc b/onnxruntime/core/providers/dml/dml_provider_factory.cc index 2876bc623cd93..00dbab1536e86 100644 --- a/onnxruntime/core/providers/dml/dml_provider_factory.cc +++ b/onnxruntime/core/providers/dml/dml_provider_factory.cc @@ -52,7 +52,7 @@ std::shared_ptr CreateExecutionProviderFactory_DML(ID ComPtr d3d12_device; THROW_IF_FAILED(dml_device->GetParentDevice(IID_PPV_ARGS(&d3d12_device))); const Env& env = Env::Default(); - env.GetTelemetryProvider().LogExecutionProviderEvent(d3d12_device->GetAdapterLuid()); + env.GetTelemetryProvider().LogExecutionProviderEvent(&d3d12_device->GetAdapterLuid()); return std::make_shared(dml_device, cmd_queue); } diff --git a/onnxruntime/core/session/inference_session.cc b/onnxruntime/core/session/inference_session.cc index 6f8c19d586538..49522cab8970a 100644 --- a/onnxruntime/core/session/inference_session.cc +++ b/onnxruntime/core/session/inference_session.cc @@ -752,19 +752,24 @@ static bool ModelUseFP16Helper(const onnx::TypeProto& type_proto) { return true; } } - } break; + break; + } case ::onnx::TypeProto::ValueCase::kSequenceType: { if (type_proto.has_sequence_type()) { auto& sequence_type = type_proto.sequence_type(); return ModelUseFP16Helper(sequence_type.elem_type()); } - } break; + break; + } case ::onnx::TypeProto::ValueCase::kMapType: { if (type_proto.has_map_type()) { auto& map_type = type_proto.map_type(); return ModelUseFP16Helper(map_type.value_type()); } - } break; + break; + } + default: + break; } return false; } diff --git a/winml/adapter/DmlOrtSessionBuilder.cpp b/winml/adapter/DmlOrtSessionBuilder.cpp index b5e647387173e..29da1a6332642 100644 --- a/winml/adapter/DmlOrtSessionBuilder.cpp +++ b/winml/adapter/DmlOrtSessionBuilder.cpp @@ -125,7 +125,8 @@ HRESULT DmlOrtSessionBuilder::CreateSession( auto session = std::make_unique(options->value); const onnxruntime::Env& env = onnxruntime::Env::Default(); - env.GetTelemetryProvider().LogExecutionProviderEvent(p_d3d_device->GetAdapterLuid()); + LUID temp_LUID = p_d3d_device->GetAdapterLuid(); + env.GetTelemetryProvider().LogExecutionProviderEvent(&temp_LUID); // Cache the provider's raw pointer *pp_provider = gpu_provider.get();