diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp index 3c6d1bcf4a..f1ef0ed1df 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/FusedGraphKernel.cpp @@ -331,21 +331,17 @@ namespace Dml ORT_THROW_IF_FAILED(device->CreateBindingTable(&bindingTableDesc, IID_PPV_ARGS(&m_bindingTable))); - ComPtr allocator; ORT_THROW_IF_FAILED(d3dDevice->CreateCommandAllocator( m_provider->GetCommandListTypeForQueue(), - IID_GRAPHICS_PPV_ARGS(allocator.ReleaseAndGetAddressOf()))); + IID_GRAPHICS_PPV_ARGS(m_commandAllocator.ReleaseAndGetAddressOf()))); - ComPtr commandList; ORT_THROW_IF_FAILED(d3dDevice->CreateCommandList( 0, m_provider->GetCommandListTypeForQueue(), - allocator.Get(), + m_commandAllocator.Get(), nullptr, - IID_GRAPHICS_PPV_ARGS(commandList.ReleaseAndGetAddressOf()))); + IID_GRAPHICS_PPV_ARGS(m_graphicsCommandList.ReleaseAndGetAddressOf()))); - ORT_THROW_IF_FAILED(commandList.As(&m_graphicsCommandList)); - if (m_persistentResource) { DML_BINDING_DESC persistentResourceBindingDesc = @@ -359,7 +355,7 @@ namespace Dml ComPtr recorder; ORT_THROW_IF_FAILED(device->CreateCommandRecorder(IID_PPV_ARGS(recorder.GetAddressOf()))); - recorder->RecordDispatch(commandList.Get(), m_compiledExecutionPlanOperator.Get(), m_bindingTable.Get()); + recorder->RecordDispatch(m_graphicsCommandList.Get(), m_compiledExecutionPlanOperator.Get(), m_bindingTable.Get()); ORT_THROW_IF_FAILED(m_graphicsCommandList->Close()); } @@ -496,6 +492,7 @@ namespace Dml // Re-usable command list, supporting descriptor heap, and DML binding table to update that heap. ComPtr m_graphicsCommandList; + ComPtr m_commandAllocator; ComPtr m_heap; ComPtr m_bindingTable; std::optional m_persistentResourceBinding; diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp index fcc63fae94..cadcf0c8d0 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/GraphDescBuilder.cpp @@ -95,11 +95,6 @@ namespace Dml::GraphDescBuilder reuseCommandList = true; } -#ifdef _GAMING_XBOX - // #40265989 - reuseCommandList = false; -#endif - auto constantCpuGraphInputGetter = [&transferredInitializerMap](const std::string& argName) { ComPtr tensorWrapper;