IDMLDevice::CreateOperatorInitializer method (directml.h)

Creates an object that can be used to initialize compiled operators.

Once compiled, an operator must be initialized exactly once on the GPU before it can be executed. The operator initializer holds the state necessary for initialization of one or more target compiled operators.

Once instantiated, dispatch of the operator initializer can be recorded in a command list via IDMLCommandRecorder::RecordDispatch. After execution completes on the GPU, all compiled operators that are targets of the initializer enter the initialized state.

An operator initializer can be reused to initialize different sets of compiled operators. See IDMLOperatorInitializer::Reset for more info.

An operator initializer can be created with no target operators. Executing such an initializer is a no-op. Creating an operator initializer with no target operators may be useful if you wish to create an initializer up-front, but don't yet know which operators it will be used to initialize. IDMLOperatorInitializer::Reset can be used to reset which operators to target.

Syntax

HRESULT CreateOperatorInitializer(
                 UINT                 operatorCount,
  [in, optional] IDMLCompiledOperator * const *operators,
                 REFIID               riid,
  [out]          void                 **ppv
);

Parameters

operatorCount

Type: UINT

This parameter determines the number of elements in the array passed in the operators parameter.

[in, optional] operators

Type: IDMLCompiledOperator*

An optional pointer to a constant array of IDMLCompiledOperator pointers containing the set of operators that this initializer will target. Upon execution of the initializer, the target operators become initialized. This array may be null or empty, indicating that the initializer has no target operators.

riid

Type: REFIID

A reference to the globally unique identifier (GUID) of the interface that you wish to be returned in ppv. This is expected to be the GUID of IDMLOperatorInitializer.

[out] ppv

Type: void**

A pointer to a memory block that receives a pointer to the operator initializer. This is the address of a pointer to an IDMLOperatorInitializer, representing the operator initializer created.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Target Platform Windows
Header directml.h
Library DirectML.lib
DLL DirectML.dll

See also

IDMLDevice