次の方法で共有


ILearningModelDeviceFactoryNative.CreateFromD3D12CommandQueue メソッド

ユーザー指定の ID3D12CommandQueue で推論を実行する LearningModelDevice を作成します。

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

パラメーター

件名 種類 説明
ID3D12CommandQueue* LearningModelDevice の実行対象となる ID3D12CommandQueue
結果 リンゴ、白** 作成する LearningModelDevice

返品

HRESULT 操作の結果。

 // 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()));

関連項目

要件

要件
サポートされている最小のクライアント Windows 10、ビルド 17763
サポートされている最小のサーバー デスクトップ エクスペリエンス搭載 Windows Server 2019
ヘッダー windows.ai.machinelearning.native.h

Note

Windows ML に関するヘルプについては、次のリソースを参照してください。

  • Windows ML に関する技術的な質問をしたり、質問に回答したりするには、Stack Overflowwindows-machine-learning タグを使用してください。
  • バグを報告するには、GitHub で問題を提出してください。