Skip to content

Latest commit

 

History

History
116 lines (92 loc) · 6.33 KB

nf-directml-idmlcommandrecorder-recorddispatch.md

File metadata and controls

116 lines (92 loc) · 6.33 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:directml.IDMLCommandRecorder.RecordDispatch
IDMLCommandRecorder::RecordDispatch
Records execution of a dispatchable object (an operator initializer, or a compiled operator) onto a command list.
IDMLCommandRecorder interface
RecordDispatch method
IDMLCommandRecorder.RecordDispatch
IDMLCommandRecorder::RecordDispatch
RecordDispatch
RecordDispatch method
RecordDispatch method
IDMLCommandRecorder interface
direct3d12.idmlcommandrecorder_recorddispatch
directml/IDMLCommandRecorder::RecordDispatch
direct3d12\idmlcommandrecorder_recorddispatch.htm
directml
E76A4CD7-A6A9-4B3F-9E81-3C1BAEB32657
12/5/2018
IDMLCommandRecorder interface,RecordDispatch method, IDMLCommandRecorder.RecordDispatch, IDMLCommandRecorder::RecordDispatch, RecordDispatch, RecordDispatch method, RecordDispatch method,IDMLCommandRecorder interface, direct3d12.idmlcommandrecorder_recorddispatch, directml/IDMLCommandRecorder::RecordDispatch
directml.h
Windows
DirectML.lib
DirectML.dll
Windows
19H1
IDMLCommandRecorder::RecordDispatch
directml/IDMLCommandRecorder::RecordDispatch
c++
APIRef
kbSyntax
COM
DirectML.dll
IDMLCommandRecorder.RecordDispatch

IDMLCommandRecorder::RecordDispatch

-description

Records execution of a dispatchable object (an operator initializer, or a compiled operator) onto a command list.

This method doesn't submit the execution to the GPU; it merely records it onto the command list. You are responsible for closing the command list and submitting it to the Direct3D 12 command queue.

Prior to execution of this call on the GPU, all resources bound must be in the D3D12_RESOURCE_STATE_UNORDERED_ACCESS state, or a state implicitly promotable to D3D12_RESOURCE_STATE_UNORDERED_ACCESS, such as D3D12_RESOURCE_STATE_COMMON. After this call completes, the resources remain in the D3D12_RESOURCE_STATE_UNORDERED_ACCESS state. The only exception to this is for upload heaps bound when executing an operator initializer and while one or more tensors has the DML_TENSOR_FLAG_OWNED_BY_DML flag set. In that case, any upload heaps bound for input must be in the D3D12_RESOURCE_STATE_GENERIC_READ state and will remain in that state, as required by all upload heaps.

This method resets the following state on the command list.

  • Compute root signature
  • Pipeline state
No other command list state is modified.

Although this method takes a binding table representing the resources to bind to the pipeline, it doesn't set the descriptor heaps containing the descriptors themselves. Therefore, your application is responsible for calling ID3D12GraphicsCommandList::SetDescriptorHeaps to bind the correct descriptor heaps to the pipeline.

If DML_EXECUTION_FLAG_DESCRIPTORS_VOLATILE was not set when compiling the operator, then all bindings must be set on the binding table before RecordDispatch is called, otherwise the behavior is undefined. Otherwise, if the _DESCRIPTORS_VOLATILE flag is set, binding of resources may be deferred until the Direct3D 12 command list is submitted to the command queue for execution.

This method acts logically like a call to ID3D12GraphicsCommandList::Dispatch. As such, unordered access view (UAV) barriers are necessary to ensure correct ordering if there are data dependencies between dispatches. This method does not insert UAV barriers on input nor output resources. Your application must ensure that the correct UAV barriers are performed on any inputs if their contents depend on an upstream dispatch, and on any outputs if there are downstream dispatches that depend on those outputs.

This method doesn't hold references to any of the interfaces passed in. It is your responsibility to ensure that the IDMLDispatchable object is not released until all dispatches using it have completed execution on the GPU.

-parameters

-param commandList

Type: ID3D12CommandList*

A pointer to an ID3D12CommandList interface representing the command list to record the execution into. The command list must be open and must have type D3D12_COMMAND_LIST_TYPE_DIRECT or D3D12_COMMAND_LIST_TYPE_COMPUTE.

-param dispatchable

Type: IDMLDispatchable*

A pointer to an IDMLDispatchable interface representing the object (an operator initializer, or a compiled operator) whose execution will be recorded into the command list.

-param bindings

Type: IDMLBindingTable*

A pointer to an IDMLBindingTable interface representing the bindings to use for executing the dispatchable object. If the DML_EXECUTION_FLAG_DESCRIPTORS_VOLATILE flag was not set, then you must fill out all required bindings, otherwise an error will result.

-see-also

Binding in DirectML

IDMLCommandRecorder