Condividi tramite


Metodo ILearningModelDeviceFactoryNative.CreateFromD3D12CommandQueue

Crea un LearningModelDevice che eseguirà l'inferenza su ID3D12CommandQueue specificato dall'utente.

HRESULT CreateFromD3D12CommandQueue(
    ID3D12CommandQueue * value,
    [out] IUnknown ** result);

Parametri

Nome TIPO Descrizione
valore ID3D12CommandQueue* La ID3D12CommandQueue contro cui verrà eseguito il LearningModelDevice.
risultato IUnknown** Il LearningModelDevice da creare.

Restituzioni

HRESULT Risultato dell'operazione.

Esempi

 // 1. create the d3d device.
com_ptr<ID3D12Device> pD3D12Device = nullptr;
CHECK_HRESULT(D3D12CreateDevice(
    nullptr,
    D3D_FEATURE_LEVEL::D3D_FEATURE_LEVEL_11_0,
    __uuidof(ID3D12Device),
    reinterpret_cast<void**>(&pD3D12Device)));

// 2. create the command queue.
com_ptr<ID3D12CommandQueue> dxQueue = nullptr;
D3D12_COMMAND_QUEUE_DESC commandQueueDesc = {};
commandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;
CHECK_HRESULT(pD3D12Device->CreateCommandQueue(
    &commandQueueDesc,
    __uuidof(ID3D12CommandQueue),
    reinterpret_cast<void**>(&dxQueue)));
com_ptr<ILearningModelDeviceFactoryNative> devicefactory =
    get_activation_factory<LearningModelDevice, ILearningModelDeviceFactoryNative>();
com_ptr<::IUnknown> spUnk;
CHECK_HRESULT(devicefactory->CreateFromD3D12CommandQueue(dxQueue.get(), spUnk.put()));

Vedere anche

Requisiti

Requisito
Client minimo supportato Windows 10, build 17763
server minimo supportato Windows Server 2019 con Esperienza Desktop
Intestazione windows.ai.machinelearning.native.h

Annotazioni

Usare le risorse seguenti per assistenza con Windows ML:

  • Per porre o rispondere a domande tecniche su Windows ML, usare il tag windows-machine-learning in Stack Overflow.
  • Per segnalare un bug, segnalare un problema in GitHub.