From 01d9bd27dd7b368edc17012de4fe2262b9f08127 Mon Sep 17 00:00:00 2001 From: Patrice Vignola Date: Wed, 16 Aug 2023 07:02:39 -0700 Subject: [PATCH] Fix lint issues --- winml/adapter/winml_adapter_dml.cpp | 2 +- .../Api.Ort/OnnxruntimeDmlSessionBuilder.cpp | 4 +-- .../Api.Ort/OnnxruntimeDmlSessionBuilder.h | 2 +- .../lib/Api.Ort/OnnxruntimeEngineBuilder.cpp | 2 +- winml/lib/Api/LearningModelSession.cpp | 28 +++++++++---------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/winml/adapter/winml_adapter_dml.cpp b/winml/adapter/winml_adapter_dml.cpp index 18efff94c60c8..0c4c451f4ed39 100644 --- a/winml/adapter/winml_adapter_dml.cpp +++ b/winml/adapter/winml_adapter_dml.cpp @@ -70,7 +70,7 @@ Microsoft::WRL::ComPtr CreateDmlDevice(ID3D12Device* d3d12Device) { namespace onnxruntime { void DmlConfigureProviderFactoryMetacommandsEnabled(IExecutionProviderFactory* factory, bool metacommandsEnabled); void DmlConfigureProviderFactoryBfcAllocatorEnabled(IExecutionProviderFactory* factory, bool bfc_allocator_enabled); -} // namespace onnxruntime +} // namespace onnxruntime #endif // USE_DML diff --git a/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.cpp b/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.cpp index d9f8880349755..9de5585e4ba78 100644 --- a/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.cpp +++ b/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.cpp @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT License. +// Licensed under the MIT License. #include "lib/Api.Ort/pch.h" @@ -64,7 +64,7 @@ OnnxruntimeDmlSessionBuilder::CreateSessionOptions(OrtSessionOptions** options) winml_adapter_api->OrtSessionOptionsAppendExecutionProvider_CPU(session_options.get(), use_arena), ort_api ); - // call release() so the underlying OrtSessionOptions object isn't freed + // call release() so the underlying OrtSessionOptions object isn't freed *options = session_options.release(); return S_OK; diff --git a/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.h b/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.h index 659f936cbcfff..3b1ade796d80f 100644 --- a/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.h +++ b/winml/lib/Api.Ort/OnnxruntimeDmlSessionBuilder.h @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT License. +// Licensed under the MIT License. #pragma once diff --git a/winml/lib/Api.Ort/OnnxruntimeEngineBuilder.cpp b/winml/lib/Api.Ort/OnnxruntimeEngineBuilder.cpp index e21f6836e7c4a..a055b1b02ef64 100644 --- a/winml/lib/Api.Ort/OnnxruntimeEngineBuilder.cpp +++ b/winml/lib/Api.Ort/OnnxruntimeEngineBuilder.cpp @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT License. +// Licensed under the MIT License. #include "lib/Api.Ort/pch.h" diff --git a/winml/lib/Api/LearningModelSession.cpp b/winml/lib/Api/LearningModelSession.cpp index f362dbcded26f..922420d997f6e 100644 --- a/winml/lib/Api/LearningModelSession.cpp +++ b/winml/lib/Api/LearningModelSession.cpp @@ -1,5 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. - // Licensed under the MIT License. +// Licensed under the MIT License. #include "lib/Api/pch/pch.h" @@ -20,8 +20,8 @@ static const auto c_enable_debug_output = L"EnableDebugOutput"; namespace guid_details { - // This GUID is to be used for delimiting ML-related categories of capturable work. - // {D113B493-BBA2-4993-8608-D706A73B91CE} +// This GUID is to be used for delimiting ML-related categories of capturable work. +// {D113B493-BBA2-4993-8608-D706A73B91CE} struct __declspec(uuid("D113B493-BBA2-4993-8608-D706A73B91CE")) __declspec(novtable ) WINML_PIX_EVAL_CAPTURABLE_WORK_GUID {}; } // namespace guid_details @@ -61,7 +61,7 @@ LearningModelSession::LearningModelSession( WINML_CATCH_ALL _winml::IModel* LearningModelSession::GetOptimizedModel() { - // Get the model proto + // Get the model proto auto should_close_model = session_options_ != nullptr && session_options_.CloseModelOnSessionCreation(); @@ -72,18 +72,18 @@ _winml::IModel* LearningModelSession::GetOptimizedModel(bool should_close_model) com_ptr<_winml::IModel> model; { - // Lock the model detach/copy since multiple threads can access concurrently + // Lock the model detach/copy since multiple threads can access concurrently CWinMLAutoLock lock(&session_creation_lock_); - // Throw if the model has been disposed and is not capable of creating - // new sessions. + // Throw if the model has been disposed and is not capable of creating + // new sessions. auto model_impl = model_.as(); WINML_THROW_HR_IF_TRUE_MSG(E_INVALIDARG, model_impl->IsDisposed(), "The model has been disposed."); model.attach(should_close_model ? model_impl->DetachModel() : model_impl->CloneModel()); } - // Ensure that the model is runnable on the device + // Ensure that the model is runnable on the device auto isFloat16Supported = device_.as()->GetD3DDeviceCache()->IsFloat16Supported(); if (!isFloat16Supported) { WINML_THROW_IF_FAILED(model->ModelEnsureNoFloat16()); @@ -92,13 +92,13 @@ _winml::IModel* LearningModelSession::GetOptimizedModel(bool should_close_model) } void LearningModelSession::Initialize() { - // Begin recording session creation telemetry + // Begin recording session creation telemetry _winmlt::TelemetryEvent session_creation_event(_winmlt::EventCategory::kSessionCreation); - // Get the optimized model proto from the learning model + // Get the optimized model proto from the learning model com_ptr<_winml::IModel> model; model.attach(GetOptimizedModel()); - // Create the session builder + // Create the session builder auto device_impl = device_.as(); auto model_impl = model_.as(); @@ -121,7 +121,7 @@ void LearningModelSession::Initialize() { auto num_intra_op_threads = device_impl->NumberOfIntraOpThreads(); auto allow_spinning = device_impl->AllowSpinning(); - // Make onnxruntime apply the batch size override, if any + // Make onnxruntime apply the batch size override, if any if (session_options_) { if (session_options_.BatchSizeOverride() != 0) { WINML_THROW_IF_FAILED(engine_builder->SetBatchSizeOverride(session_options_.BatchSizeOverride())); @@ -130,7 +130,7 @@ void LearningModelSession::Initialize() { com_ptr session_options_impl = session_options_.as(); - // Make onnxruntime apply named dimension overrides, if any + // Make onnxruntime apply named dimension overrides, if any if (session_options_impl && session_options_impl->NamedDimensionOverrides().Size() > 0) { WINML_THROW_IF_FAILED(engine_builder->SetNamedDimensionOverrides(session_options_impl->NamedDimensionOverrides()) ); @@ -164,7 +164,7 @@ void LearningModelSession::Initialize() { com_ptr<_winml::IEngine> engine; WINML_THROW_IF_FAILED(engine_builder->CreateEngine(engine.put())); - // Register the custom operator registry + // Register the custom operator registry operator_registry_ = MLOperatorRegistry(model_impl->GetOperatorRegistry(), [](auto registry) { registry->Release(); }); WINML_THROW_IF_FAILED(engine->RegisterCustomRegistry(operator_registry_.get()));