DML_GRAPH_DESC structure (directml.h)

Describes a graph of DirectML operators used to compile a combined, optimized operator. See IDMLDevice1::CompileGraph.

Syntax

struct DML_GRAPH_DESC {
  UINT                      InputCount;
  UINT                      OutputCount;
  UINT                      NodeCount;
  const DML_GRAPH_NODE_DESC *Nodes;
  UINT                      InputEdgeCount;
  const DML_GRAPH_EDGE_DESC *InputEdges;
  UINT                      OutputEdgeCount;
  const DML_GRAPH_EDGE_DESC *OutputEdges;
  UINT                      IntermediateEdgeCount;
  const DML_GRAPH_EDGE_DESC *IntermediateEdges;
};

Members

InputCount

Type: UINT

The number of inputs of the overall graph. Each graph input may be connected to a variable number of internal nodes, therefore this may be different from InputEdgeCount.

OutputCount

Type: UINT

The number of outputs of the overall graph. Each graph output may be connected to a variable number of internal nodes, therefore this may be different from OutputEdgeCount.

NodeCount

Type: UINT

The number of internal nodes in the graph.

Nodes

Type: _Field_size_(NodeCount) const DML_GRAPH_NODE_DESC*

The internal nodes in the graph.

InputEdgeCount

Type: UINT

The number of connections between graph inputs and inputs of internal nodes in the graph.

InputEdges

Type: _Field_size_(InputEdgeCount) const DML_GRAPH_EDGE_DESC*

An array of connections between graph inputs and inputs of internal nodes in the graph. The Type field within each element should be set to DML_GRAPH_EDGE_TYPE_INPUT.

OutputEdgeCount

Type: UINT

The number of connections between graph outputs and outputs of internal nodes in the graph.

OutputEdges

Type: _Field_size_(OutputEdgeCount) const DML_GRAPH_EDGE_DESC*

An array of connections between graph outputs and outputs of internal nodes in the graph. The Type field within each element should be set to DML_GRAPH_EDGE_TYPE_OUTPUT.

IntermediateEdgeCount

Type: UINT

The number of internal connections between nodes in the graph.

IntermediateEdges

Type: _Field_size_(IntermediateEdgeCount) const DML_GRAPH_EDGE_DESC*

An array of connections between inputs and outputs of internal nodes in the graph. The Type field within each element should be set to DML_GRAPH_EDGE_TYPE_INTERMEDIATE

Remarks

The graph described by this structure must be a directed acyclic graph. You must define a connection for the input and output of each supplied node, except for inputs and outputs that are optional for the associated operator.

Nodes may use operators that were created using the DML_TENSOR_FLAG_OWNED_BY_DML flag for certain inputs. Any operator inputs using this flag must be connected to graph inputs. All operator inputs connected to the same graph input must use or omit this flag equivalently.

It is legal to connect operators whose connected inputs and outputs use different dimension counts, sizes, and data types. This implies that the tensor data blob is interpreted differently by each operator. The TotalTensorSizeInBytes field of connected tensor inputs and outputs must be identical, though. Operators should only read regions of tensors written by earlier operators. Any padding regions in the output of an operation (resulting from the use of strides) are not guaranteed to be read as zero by down-stream operators.

Availability

This API was introduced in DirectML version 1.1.0.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header directml.h

See also