Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Generates a list of adapter objects representing the current adapter state of the system, and meeting the workload and hardware type criteria specified. For programming guidance, and code examples, see Using DXCore to enumerate adapters. With CreateAdapterListByWorkload, DXCore supports neural processing units (NPUs), which process machine-learning (ML) workloads, and media accelerators, for video encode/decode/processing workloads.
You can retrieve MCDM NPUs and media accelerators by calling CreateAdapterList, but the default sorting for that method is based on runtime capabilities and device performance. CreateAdapterListByWorkload allows DXCore to provide an adapter list sorted by what works best for a given workload, based on operating system (OS) policy, that you can easily narrow down by the type of hardware and level of Direct 3D runtime support. The default sorting in CreateAdapterListByWorkload can be thought of as the opposite of CreateAdapterList, where more specialized hardware is prioritized in the ordering that may be less generally capable than a full GPU.
Syntax
virtual HRESULT STDMETHODCALLTYPE CreateAdapterListByWorkload(
DXCoreWorkload workload,
DXCoreRuntimeFilterFlags runtimeFilter,
DXCoreHardwareTypeFilterFlags hardwareTypeFilter,
REFIID riid,
_COM_Outptr_ void **ppvAdapterList) = 0;
template<class T>
HRESULT STDMETHODCALLTYPE CreateAdapterListByWorkload(
DXCoreWorkload workload,
DXCoreRuntimeFilterFlags runtimeFilter,
DXCoreHardwareTypeFilterFlags hardwareTypeFilter,
_COM_Outptr_ T **ppvAdapterList);
Parameters
workload
TBD
runtimeFilter
TBD
hardwareTypeFilter
TBD
riid
Type: REFIID
A reference to the globally unique identifier (GUID) of the interface that you wish to be returned in ppvAdapterList. This is expected to be the interface identifier (IID) of IDXCoreAdapterList.
ppvAdapterList [out]
Type: void**
The address of a pointer to an interface with the IID specified in the riid parameter. Upon successful return, *ppvAdapterList (the dereferenced address) contains a pointer to the adapter list created.
Returns
Type: HRESULT
If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
| Return value | Description |
|---|---|
| E_INVALIDARG | A value was provided outside of the range of the workload, runtimeFilter, or hardwareTypeFilter parameters. |
| E_NOINTERFACE | An invalid value was provided for riid. |
| E_POINTER | nullptr was provided for ppvAdapterList. |
Remarks
Even if no adapters are found, as long as the arguments are valid, CreateAdapterListByWorkload creates a valid IDXCoreAdapterList object, and returns S_OK. Once generated, the adapters in this specific list won't change. But the list will be considered stale if one of the adapters later becomes invalid, or if a new adapter arrives that meets the provided filter criteria. The list returned by CreateAdapterList is not ordered in any particular way, and multiple calls to CreateAdapterList may produce differently ordered lists.
The resulting list is not ordered in any particular way, but the ordering of a list is consistent across multiple calls, and even across operating system restarts. The ordering may change upon system configuration changes, including the addition or removal of an adapter, or a driver update on an existing adapter.
See also
IDXCoreAdapterFactory, DXCore reference, DXCore adapter attribute GUIDs, Using DXCore to enumerate adapters