onnxruntime/winml/api/windows.ai.machinelearning.native.idl
Ryan Lai 5ce675c3b9
Expose Onnxruntime Intra Op thread controls through WinML Native API (#4638)
* Register ILearningModelSessionOptionsNate interface

* Threading options exposed

* Add interrogator for Session options

* Add test

* Polish test

* PR comments

* Set intra op threads

* Add adapter api to grab intra op threads

* Add adapter test for getting intraop num threads

* Make ILearningModelSessionNative and update winml api test

* Make it required when building engine to set the intraop num threads

* Make test  more pretty

* Change naming of idl function

* Revert "Change naming of idl function"

This reverts commit c06916aa5bf94e3bf233ed281e508b935fc8638d.

* PR comment on naming

* Skip the test because it's influenced if it's built with openmp

Co-authored-by: Ryan Lai <ryalai96@gamil.com>
2020-07-30 17:55:26 -07:00

44 lines
No EOL
1.9 KiB
Text

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import "oaidl.idl";
import "ocidl.idl";
import "d3d12.idl";
cpp_quote( "#include <winapifamily.h>" )
#pragma region Desktop Family
cpp_quote( "#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)" )
cpp_quote( "struct IMLOperatorRegistry; " )
cpp_quote( "struct __declspec(uuid(\"1adaa23a-eb67-41f3-aad8-5d984e9bacd4\")) __declspec(novtable) ILearningModelOperatorProviderNative : IUnknown " )
cpp_quote( "{ " )
cpp_quote( " STDMETHOD(GetRegistry)(IMLOperatorRegistry** ppOperatorRegistry) PURE; " )
cpp_quote( "}; " )
[uuid(52f547ef-5b03-49b5-82d6-565f1ee0dd49), object, local]
interface ITensorNative : IUnknown
{
HRESULT GetBuffer([out, size_is(, *capacity)] BYTE **value, [out] UINT32 *capacity);
HRESULT GetD3D12Resource([out] ID3D12Resource ** result);
};
[uuid(39d055a4-66f6-4ebc-95d9-7a29ebe7690a), object, local]
interface ITensorStaticsNative : IUnknown
{
HRESULT CreateFromD3D12Resource(ID3D12Resource *value, [size_is(shapeCount)] __int64 *shape, int shapeCount, [out] IUnknown ** result);
};
[uuid(1e9b31a1-662e-4ae0-af67-f63bb337e634), object, local]
interface ILearningModelDeviceFactoryNative : IUnknown
{
HRESULT CreateFromD3D12CommandQueue(ID3D12CommandQueue * value, [out] IUnknown ** result);
};
[uuid(c71e953f-37b4-4564-8658-d8396866db0d), object, local]
interface ILearningModelSessionOptionsNative : IUnknown
{
HRESULT SetIntraOpNumThreadsOverride(UINT32 intraOpNumThreads);
};
cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */")