onnxruntime/winml/lib/Api.Ort/OnnxruntimeEngineBuilder.h
Jeff Bloomfield be0c0da9ef Merged PR 4408735: Fix control over metacommands being enabled or disabled
Fix control over metacommands being enabled or disabled

Related work items: #25512218
2020-03-10 17:13:59 +00:00

40 lines
No EOL
1.2 KiB
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "iengine.h"
namespace Windows::AI::MachineLearning {
class OnnxruntimeEngineBuilder : public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
IEngineBuilder> {
public:
HRESULT RuntimeClassInitialize(_In_ OnnxruntimeEngineFactory* engine);
STDMETHOD(SetD3D12Resources)
(ID3D12Device* device, ID3D12CommandQueue* queue);
STDMETHOD(SetMetacommandsEnabled)
(int enabled);
STDMETHOD(GetD3D12Device)
(_Outptr_ ID3D12Device** device);
STDMETHOD(GetID3D12CommandQueue)
(_Outptr_ ID3D12CommandQueue** queue);
STDMETHOD(SetBatchSizeOverride)
(uint32_t batch_size_override);
STDMETHOD(CreateEngine)
(_Outptr_ IEngine** out);
private:
Microsoft::WRL::ComPtr<OnnxruntimeEngineFactory> engine_factory_;
Microsoft::WRL::ComPtr<ID3D12Device> device_ = nullptr;
Microsoft::WRL::ComPtr<ID3D12CommandQueue> queue_ = nullptr;
bool metacommands_enabled_ = true;
std::optional<uint32_t> batch_size_override_;
};
} // namespace Windows::AI::MachineLearning