mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Fix formatting of DML EP files that was disturbed in an earlier PR. (#22672)
This commit is contained in:
parent
a2070bf091
commit
69fe58b0ef
2 changed files with 21 additions and 16 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<ID3D12Device> device;
|
||||
GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf())));
|
||||
ComPtr<ID3D12Device> device;
|
||||
GRAPHICS_THROW_IF_FAILED(dmlDevice->GetParentDevice(IID_GRAPHICS_PPV_ARGS(device.GetAddressOf())));
|
||||
|
||||
m_impl = wil::MakeOrThrow<ExecutionProviderImpl>(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena);
|
||||
m_impl = wil::MakeOrThrow<ExecutionProviderImpl>(dmlDevice, device.Get(), executionContext, enableMetacommands, enableGraphCapture, enableSyncSpinning, disableMemoryArena);
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<onnxruntime::ComputeCapability>>
|
||||
|
|
|
|||
Loading…
Reference in a new issue