2019-08-15 22:27:05 +00:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
|
|
#include "CpuOrtSessionBuilder.h"
|
|
|
|
|
#include "DmlOrtSessionBuilder.h"
|
|
|
|
|
|
|
|
|
|
#include "LearningModelDevice.h"
|
|
|
|
|
|
|
|
|
|
using namespace Windows::AI::MachineLearning;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<IOrtSessionBuilder> Windows::AI::MachineLearning::CreateOrtSessionBuilder(
|
2019-11-08 21:23:44 +00:00
|
|
|
ID3D12Device* device, ID3D12CommandQueue* queue) {
|
2019-08-15 22:27:05 +00:00
|
|
|
|
|
|
|
|
auto session_builder =
|
2019-11-08 21:23:44 +00:00
|
|
|
(device == nullptr)
|
2019-08-15 22:27:05 +00:00
|
|
|
? std::unique_ptr<IOrtSessionBuilder>(new CpuOrtSessionBuilder())
|
2019-11-08 21:23:44 +00:00
|
|
|
: std::unique_ptr<IOrtSessionBuilder>(new DmlOrtSessionBuilder(device, queue));
|
2019-08-15 22:27:05 +00:00
|
|
|
|
|
|
|
|
return session_builder;
|
|
|
|
|
}
|