Skip to content

Commit 69fe58b

Browse files
author
Pranav Sharma
authored
Fix formatting of DML EP files that was disturbed in an earlier PR. (microsoft#22672)
1 parent a2070bf commit 69fe58b

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

onnxruntime/core/providers/dml/DmlExecutionProvider/src/DmlExternalBufferAllocator.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ namespace Dml
2020
class DmlExternalBufferAllocator : public onnxruntime::IAllocator
2121
{
2222
public:
23-
DmlExternalBufferAllocator(int device_id) : onnxruntime::IAllocator(
24-
OrtMemoryInfo(
25-
"DML",
26-
OrtAllocatorType::OrtDeviceAllocator,
27-
OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0))) {
28-
m_device = onnxruntime::DMLProviderFactoryCreator::CreateD3D12Device(device_id, false);
29-
}
23+
DmlExternalBufferAllocator(int device_id) : onnxruntime::IAllocator(
24+
OrtMemoryInfo(
25+
"DML",
26+
OrtAllocatorType::OrtDeviceAllocator,
27+
OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)
28+
))
29+
{
30+
m_device = onnxruntime::DMLProviderFactoryCreator::CreateD3D12Device(device_id, false);
31+
}
3032

3133
void* Alloc(size_t size) final
3234
{

onnxruntime/core/providers/dml/DmlExecutionProvider/src/ExecutionProvider.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,20 @@ namespace Dml
7373
bool enableMetacommands,
7474
bool enableGraphCapture,
7575
bool enableSyncSpinning,
76-
bool disableMemoryArena) : IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)) {
77-
D3D12_COMMAND_LIST_TYPE queueType = executionContext->GetCommandListTypeForQueue();
78-
if (queueType != D3D12_COMMAND_LIST_TYPE_DIRECT && queueType != D3D12_COMMAND_LIST_TYPE_COMPUTE) {
79-
// DML requires either DIRECT or COMPUTE command queues.
80-
ORT_THROW_HR(E_INVALIDARG);
81-
}
76+
bool disableMemoryArena) :
77+
IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0))
78+
{
79+
D3D12_COMMAND_LIST_TYPE queueType = executionContext->GetCommandListTypeForQueue();
80+
if (queueType != D3D12_COMMAND_LIST_TYPE_DIRECT && queueType != D3D12_COMMAND_LIST_TYPE_COMPUTE)
81+
{
82+
// DML requires either DIRECT or COMPUTE command queues.
83+
ORT_THROW_HR(E_INVALIDARG);
84+
}
8285

83-
ComPtr<ID3D12Device> device;
84-
GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf())));
86+
ComPtr<ID3D12Device> device;
87+
GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf())));
8588

86-
m_impl = wil::MakeOrThrow<ExecutionProviderImpl>(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena);
89+
m_impl = wil::MakeOrThrow<ExecutionProviderImpl>(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena);
8790
}
8891

8992
std::vector<std::unique_ptr<onnxruntime::ComputeCapability>>

0 commit comments

Comments
 (0)