From 2e8225a03f02ad2ac4018e9c013b5d723716aae0 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Thu, 31 Oct 2024 07:37:28 -0700 Subject: [PATCH] Fix formatting of DML EP files that was disturbed in an earlier PR. (#22672) --- .../src/DmlExternalBufferAllocator.h | 16 +++++++------- .../src/ExecutionProvider.cpp | 21 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlExternalBufferAllocator.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlExternalBufferAllocator.h index 6aae05c999da9..f07b9540ff3fd 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlExternalBufferAllocator.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlExternalBufferAllocator.h @@ -20,13 +20,15 @@ namespace Dml class DmlExternalBufferAllocator : public onnxruntime::IAllocator { public: - DmlExternalBufferAllocator(int device_id) : onnxruntime::IAllocator( - OrtMemoryInfo( - "DML", - OrtAllocatorType::OrtDeviceAllocator, - OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0))) { - m_device = onnxruntime::DMLProviderFactoryCreator::CreateD3D12Device(device_id, false); - } + DmlExternalBufferAllocator(int device_id) : onnxruntime::IAllocator( + OrtMemoryInfo( + "DML", + OrtAllocatorType::OrtDeviceAllocator, + OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0) + )) + { + m_device = onnxruntime::DMLProviderFactoryCreator::CreateD3D12Device(device_id, false); + } void* Alloc(size_t size) final { diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp index 2deb83ec13902..ae9be4ea91c28 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp @@ -73,17 +73,20 @@ namespace Dml bool enableMetacommands, bool enableGraphCapture, bool enableSyncSpinning, - bool disableMemoryArena) : IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)) { - D3D12_COMMAND_LIST_TYPE queueType = executionContext->GetCommandListTypeForQueue(); - if (queueType != D3D12_COMMAND_LIST_TYPE_DIRECT && queueType != D3D12_COMMAND_LIST_TYPE_COMPUTE) { - // DML requires either DIRECT or COMPUTE command queues. - ORT_THROW_HR(E_INVALIDARG); - } + bool disableMemoryArena) : + IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)) + { + D3D12_COMMAND_LIST_TYPE queueType = executionContext->GetCommandListTypeForQueue(); + if (queueType != D3D12_COMMAND_LIST_TYPE_DIRECT && queueType != D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + // DML requires either DIRECT or COMPUTE command queues. + ORT_THROW_HR(E_INVALIDARG); + } - ComPtr device; - GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf()))); + ComPtr device; + GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf()))); - m_impl = wil::MakeOrThrow(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena); + m_impl = wil::MakeOrThrow(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena); } std::vector>