SDL annotation fixes (#6448)
Co-authored-by: Ori Levari <orlevari@microsoft.com>
This commit is contained in:
Родитель
21b4842c34
Коммит
3b1227c5ce
|
@ -36,7 +36,7 @@ ORT_API_STATUS(ModelGetOutputDescription, _In_ const OrtModel* model, _In_ size_
|
|||
ORT_API_STATUS(ModelGetInputTypeInfo, _In_ const OrtModel* model, _In_ size_t index, _Outptr_ OrtTypeInfo** type_info);
|
||||
ORT_API_STATUS(ModelGetOutputTypeInfo, _In_ const OrtModel* model, _In_ size_t index, _Outptr_ OrtTypeInfo** type_info);
|
||||
ORT_API_STATUS(ModelGetMetadataCount, _In_ const OrtModel* model, _Out_ size_t* count);
|
||||
ORT_API_STATUS(ModelGetMetadata, _In_ const OrtModel* model, _Out_ size_t count, _Out_ const char** const key, _Out_ size_t* key_len, _Out_ const char** const value, _Out_ size_t* value_len);
|
||||
ORT_API_STATUS(ModelGetMetadata, _In_ const OrtModel* model, _In_ size_t count, _Out_ const char** const key, _Out_ size_t* key_len, _Out_ const char** const value, _Out_ size_t* value_len);
|
||||
ORT_API_STATUS(ModelEnsureNoFloat16, _In_ const OrtModel* model);
|
||||
|
||||
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProviderEx_DML, _In_ OrtSessionOptions* options, _In_ ID3D12Device* d3d_device, _In_ ID3D12CommandQueue* cmd_queue, bool metacommands_enabled);
|
||||
|
@ -45,7 +45,7 @@ ORT_API_STATUS(OrtSessionOptionsAppendExecutionProviderEx_DML, _In_ OrtSessionOp
|
|||
ORT_API_STATUS(CreateSessionWithoutModel, _In_ OrtEnv* env, _In_ const OrtSessionOptions* options, _Outptr_ OrtSession** session);
|
||||
|
||||
//Do not release provider... as there is no release method available
|
||||
ORT_API_STATUS(SessionGetExecutionProvider, _In_ OrtSession* session, size_t index, _Out_ OrtExecutionProvider** provider);
|
||||
ORT_API_STATUS(SessionGetExecutionProvider, _In_ OrtSession* session, _In_ size_t index, _Out_ OrtExecutionProvider** provider);
|
||||
ORT_API_STATUS(SessionInitialize, _In_ OrtSession* session);
|
||||
ORT_API_STATUS(SessionLoadAndPurloinModel, _In_ OrtSession* session, _In_ OrtModel* model);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ static constexpr WinmlAdapterApi winml_adapter_api_1 = {
|
|||
&winmla::ReleaseModel
|
||||
};
|
||||
|
||||
const WinmlAdapterApi* ORT_API_CALL OrtGetWinMLAdapter(const OrtApi* ort_api) NO_EXCEPTION {
|
||||
const WinmlAdapterApi* ORT_API_CALL OrtGetWinMLAdapter(_In_ const OrtApi* ort_api) NO_EXCEPTION {
|
||||
if (OrtApis::GetApi(2) == ort_api) {
|
||||
return &winml_adapter_api_1;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ void DmlConfigureProviderFactoryMetacommandsEnabled(IExecutionProviderFactory* f
|
|||
#endif // USE_DML
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::OrtSessionOptionsAppendExecutionProviderEx_DML, _In_ OrtSessionOptions* options,
|
||||
ID3D12Device* d3d_device, ID3D12CommandQueue* queue, bool metacommands_enabled) {
|
||||
_In_ ID3D12Device* d3d_device, _In_ ID3D12CommandQueue* queue, bool metacommands_enabled) {
|
||||
API_IMPL_BEGIN
|
||||
#ifdef USE_DML
|
||||
auto dml_device = CreateDmlDevice(d3d_device);
|
||||
|
|
|
@ -200,7 +200,7 @@ std::unique_ptr<onnx::ModelProto> OrtModel::DetachModelProto() {
|
|||
return std::move(model_proto_);
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::CreateModelFromPath, const char* model_path, size_t size, OrtModel** out) {
|
||||
ORT_API_STATUS_IMPL(winmla::CreateModelFromPath, _In_ const char* model_path, _In_ size_t size, _Outptr_ OrtModel** out) {
|
||||
API_IMPL_BEGIN
|
||||
if (auto status = OrtModel::CreateOrtModelFromPath(model_path, size, out)) {
|
||||
return status;
|
||||
|
@ -209,7 +209,7 @@ ORT_API_STATUS_IMPL(winmla::CreateModelFromPath, const char* model_path, size_t
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::CreateModelFromData, void* data, size_t size, OrtModel** out) {
|
||||
ORT_API_STATUS_IMPL(winmla::CreateModelFromData, _In_ void* data, _In_ size_t size, _Outptr_ OrtModel** out) {
|
||||
API_IMPL_BEGIN
|
||||
if (auto status = OrtModel::CreateOrtModelFromData(data, size, out)) {
|
||||
return status;
|
||||
|
@ -218,7 +218,7 @@ ORT_API_STATUS_IMPL(winmla::CreateModelFromData, void* data, size_t size, OrtMod
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::CloneModel, const OrtModel* in, OrtModel** out) {
|
||||
ORT_API_STATUS_IMPL(winmla::CloneModel, _In_ const OrtModel* in, _Outptr_ OrtModel** out) {
|
||||
API_IMPL_BEGIN
|
||||
auto model_proto_copy = std::make_unique<onnx::ModelProto>(*in->UseModelProto());
|
||||
if (auto status = OrtModel::CreateOrtModelFromProto(std::move(model_proto_copy), out)) {
|
||||
|
@ -228,7 +228,7 @@ ORT_API_STATUS_IMPL(winmla::CloneModel, const OrtModel* in, OrtModel** out) {
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetAuthor, const OrtModel* model, const char** const author, size_t* len) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetAuthor, _In_ const OrtModel* model, _Out_ const char** const author, _Out_ size_t* len) {
|
||||
API_IMPL_BEGIN
|
||||
*author = model->UseModelInfo()->author_.c_str();
|
||||
*len = model->UseModelInfo()->author_.size();
|
||||
|
@ -236,7 +236,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetAuthor, const OrtModel* model, const char**
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetName, const OrtModel* model, const char** const name, size_t* len) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetName, _In_ const OrtModel* model, _Out_ const char** const name, _Out_ size_t* len) {
|
||||
API_IMPL_BEGIN
|
||||
*name = model->UseModelInfo()->name_.c_str();
|
||||
*len = model->UseModelInfo()->name_.size();
|
||||
|
@ -244,7 +244,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetName, const OrtModel* model, const char** co
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetDomain, const OrtModel* model, const char** const domain, size_t* len) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetDomain, _In_ const OrtModel* model, _Out_ const char** const domain, _Out_ size_t* len) {
|
||||
API_IMPL_BEGIN
|
||||
*domain = model->UseModelInfo()->domain_.c_str();
|
||||
*len = model->UseModelInfo()->domain_.size();
|
||||
|
@ -252,7 +252,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetDomain, const OrtModel* model, const char**
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetDescription, const OrtModel* model, const char** const description, size_t* len) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetDescription, _In_ const OrtModel* model, _Out_ const char** const description, _Out_ size_t* len) {
|
||||
API_IMPL_BEGIN
|
||||
*description = model->UseModelInfo()->description_.c_str();
|
||||
*len = model->UseModelInfo()->description_.size();
|
||||
|
@ -260,22 +260,22 @@ ORT_API_STATUS_IMPL(winmla::ModelGetDescription, const OrtModel* model, const ch
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetVersion, const OrtModel* model, int64_t* version) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetVersion, _In_ const OrtModel* model, _Out_ int64_t* version) {
|
||||
API_IMPL_BEGIN
|
||||
*version = model->UseModelInfo()->version_;
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetMetadataCount, const OrtModel* model, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetMetadataCount, _In_ const OrtModel* model, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*count = model->UseModelInfo()->model_metadata_.size();
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetMetadata, const OrtModel* model, size_t count, const char** const key,
|
||||
size_t* key_len, const char** const value, size_t* value_len) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetMetadata, _In_ const OrtModel* model, _In_ size_t count, _Out_ const char** const key,
|
||||
_Out_ size_t* key_len, _Out_ const char** const value, _Out_ size_t* value_len) {
|
||||
API_IMPL_BEGIN
|
||||
*key = model->UseModelInfo()->model_metadata_[count].first.c_str();
|
||||
*key_len = model->UseModelInfo()->model_metadata_[count].first.size();
|
||||
|
@ -285,22 +285,22 @@ ORT_API_STATUS_IMPL(winmla::ModelGetMetadata, const OrtModel* model, size_t coun
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputCount, const OrtModel* model, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputCount, _In_ const OrtModel* model, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*count = model->UseModelInfo()->input_features_.size();
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputCount, const OrtModel* model, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputCount, _In_ const OrtModel* model, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*count = model->UseModelInfo()->output_features_.size();
|
||||
return nullptr;
|
||||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputName, const OrtModel* model, size_t index,
|
||||
const char** input_name, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputName, _In_ const OrtModel* model, _In_ size_t index,
|
||||
_Out_ const char** input_name, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*input_name = model->UseModelInfo()->input_features_[index]->name().c_str();
|
||||
*count = model->UseModelInfo()->input_features_[index]->name().size();
|
||||
|
@ -308,8 +308,8 @@ ORT_API_STATUS_IMPL(winmla::ModelGetInputName, const OrtModel* model, size_t ind
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputName, const OrtModel* model, size_t index,
|
||||
const char** output_name, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputName, _In_ const OrtModel* model, _In_ size_t index,
|
||||
_Out_ const char** output_name, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*output_name = model->UseModelInfo()->output_features_[index]->name().c_str();
|
||||
*count = model->UseModelInfo()->output_features_[index]->name().size();
|
||||
|
@ -317,8 +317,8 @@ ORT_API_STATUS_IMPL(winmla::ModelGetOutputName, const OrtModel* model, size_t in
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputDescription, const OrtModel* model, size_t index,
|
||||
const char** input_description, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputDescription, _In_ const OrtModel* model, _In_ size_t index,
|
||||
_Out_ const char** input_description, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*input_description = model->UseModelInfo()->input_features_[index]->doc_string().c_str();
|
||||
*count = model->UseModelInfo()->input_features_[index]->doc_string().size();
|
||||
|
@ -326,8 +326,8 @@ ORT_API_STATUS_IMPL(winmla::ModelGetInputDescription, const OrtModel* model, siz
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputDescription, const OrtModel* model, size_t index,
|
||||
const char** output_description, size_t* count) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputDescription, _In_ const OrtModel* model, _In_ size_t index,
|
||||
_Out_ const char** output_description, _Out_ size_t* count) {
|
||||
API_IMPL_BEGIN
|
||||
*output_description = model->UseModelInfo()->output_features_[index]->doc_string().c_str();
|
||||
*count = model->UseModelInfo()->output_features_[index]->doc_string().size();
|
||||
|
@ -335,7 +335,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetOutputDescription, const OrtModel* model, si
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputTypeInfo, const OrtModel* model, size_t index, OrtTypeInfo** type_info) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetInputTypeInfo, _In_ const OrtModel* model, _In_ size_t index, _Outptr_ OrtTypeInfo** type_info) {
|
||||
API_IMPL_BEGIN
|
||||
if (auto status = OrtTypeInfo::FromTypeProto(&model->UseModelInfo()->input_features_[index]->type(), type_info)) {
|
||||
return status;
|
||||
|
@ -344,7 +344,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetInputTypeInfo, const OrtModel* model, size_t
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputTypeInfo, const OrtModel* model, size_t index, OrtTypeInfo** type_info) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelGetOutputTypeInfo, _In_ const OrtModel* model, _In_ size_t index, _Outptr_ OrtTypeInfo** type_info) {
|
||||
API_IMPL_BEGIN
|
||||
if (auto status = OrtTypeInfo::FromTypeProto(&model->UseModelInfo()->output_features_[index]->type(), type_info)) {
|
||||
return status;
|
||||
|
@ -353,7 +353,7 @@ ORT_API_STATUS_IMPL(winmla::ModelGetOutputTypeInfo, const OrtModel* model, size_
|
|||
API_IMPL_END
|
||||
}
|
||||
|
||||
ORT_API_STATUS_IMPL(winmla::ModelEnsureNoFloat16, const OrtModel* model) {
|
||||
ORT_API_STATUS_IMPL(winmla::ModelEnsureNoFloat16, _In_ const OrtModel* model) {
|
||||
API_IMPL_BEGIN
|
||||
auto model_info = model->UseModelInfo();
|
||||
auto model_proto = model->UseModelProto();
|
||||
|
|
|
@ -74,6 +74,7 @@ extern "C" HRESULT WINAPI MLCreateOperatorRegistry(_COM_Outptr_ IMLOperatorRegis
|
|||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
__control_entrypoint(DllExport)
|
||||
STDAPI DllCanUnloadNow() {
|
||||
// This dll should not be freed by
|
||||
// CoFreeUnusedLibraries since there can be outstanding COM object
|
||||
|
|
|
@ -25,7 +25,7 @@ HRESULT IsWarpAdapter(IDXGIAdapter1* pAdapter, bool* isWarpAdapter) {
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT _winml::GetDXGIHardwareAdapterWithPreference(DXGI_GPU_PREFERENCE preference, IDXGIAdapter1** ppAdapter) {
|
||||
HRESULT _winml::GetDXGIHardwareAdapterWithPreference(DXGI_GPU_PREFERENCE preference, _COM_Outptr_ IDXGIAdapter1** ppAdapter) {
|
||||
|
||||
winrt::com_ptr<IDXGIAdapter1> spAdapter;
|
||||
UINT i = 0;
|
||||
|
@ -67,7 +67,7 @@ HRESULT _winml::GetDXGIHardwareAdapterWithPreference(DXGI_GPU_PREFERENCE prefere
|
|||
// Return the first adapter that matches the preference:
|
||||
// DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE => DXCoreAdapterProperty::IsDetachable
|
||||
// DXGI_GPU_PREFERENCE_MINIMUM_POWER => DXCoreAdapterProperty::IsIntegrated
|
||||
HRESULT _winml::GetDXCoreHardwareAdapterWithPreference(DXGI_GPU_PREFERENCE preference, IDXCoreAdapter** ppAdapter) {
|
||||
HRESULT _winml::GetDXCoreHardwareAdapterWithPreference(DXGI_GPU_PREFERENCE preference, _COM_Outptr_ IDXCoreAdapter** ppAdapter) {
|
||||
winrt::com_ptr<IDXCoreAdapterFactory> spFactory;
|
||||
RETURN_IF_FAILED(DXCoreCreateAdapterFactory(IID_PPV_ARGS(spFactory.put())));
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@ wgdx::DirectXPixelFormat _winmli::GetDirectXPixelFormatFromDXGIFormat(DXGI_FORMA
|
|||
WINML_THROW_HR(E_INVALIDARG);
|
||||
}
|
||||
|
||||
DXGI_FORMAT _winmli::GetDXGIFormatFromDirectXPixelFormat(wgdx::DirectXPixelFormat directXPixelFormat) {
|
||||
DXGI_FORMAT _winmli::GetDXGIFormatFromDirectXPixelFormat(_In_ wgdx::DirectXPixelFormat directXPixelFormat) {
|
||||
switch (directXPixelFormat) {
|
||||
case wgdx::DirectXPixelFormat::B8G8R8A8UIntNormalized:
|
||||
return DXGI_FORMAT_B8G8R8A8_UNORM;
|
||||
|
@ -256,7 +256,7 @@ DXGI_FORMAT _winmli::GetDXGIFormatFromDirectXPixelFormat(wgdx::DirectXPixelForma
|
|||
WINML_THROW_HR(E_INVALIDARG);
|
||||
}
|
||||
|
||||
wgdx::DirectXPixelFormat _winmli::GetDirectXPixelFormatFromChannelType(_winml::ImageTensorChannelType channelType) {
|
||||
wgdx::DirectXPixelFormat _winmli::GetDirectXPixelFormatFromChannelType(_In_ _winml::ImageTensorChannelType channelType) {
|
||||
switch (channelType) {
|
||||
case _winml::kImageTensorChannelTypeBGR8:
|
||||
return wgdx::DirectXPixelFormat::B8G8R8A8UIntNormalized;
|
||||
|
|
|
@ -597,10 +597,10 @@ void TensorToVideoFrameConverter::ConvertGPUTensorToSoftwareBitmap(
|
|||
}
|
||||
|
||||
void TensorToVideoFrameConverter::ConvertBatchedDX12TensorToBuffers(
|
||||
ID3D12Resource* input_tensor,
|
||||
size_t buffer_size_in_bytes,
|
||||
_winml::D3DDeviceCache& device_cache,
|
||||
const std::vector<wss::IBuffer>& buffers) {
|
||||
_In_ ID3D12Resource* input_tensor,
|
||||
_In_ size_t buffer_size_in_bytes,
|
||||
_In_ _winml::D3DDeviceCache& device_cache,
|
||||
_Inout_ const std::vector<wss::IBuffer>& buffers) {
|
||||
assert(input_tensor != nullptr);
|
||||
|
||||
// TODO: Make an allocator for readback heaps
|
||||
|
|
|
@ -540,10 +540,10 @@ void VideoFrameToTensorConverter::ConvertSoftwareBitmapToGPUTensor(
|
|||
}
|
||||
|
||||
void VideoFrameToTensorConverter::ConvertBuffersToBatchedGPUTensor(
|
||||
const std::vector<wss::IBuffer>& buffers,
|
||||
size_t buffer_size_in_bytes,
|
||||
_winml::D3DDeviceCache& device_cache,
|
||||
ID3D12Resource* output_resource) {
|
||||
_In_ const std::vector<wss::IBuffer>& buffers,
|
||||
_In_ size_t buffer_size_in_bytes,
|
||||
_In_ _winml::D3DDeviceCache& device_cache,
|
||||
_Inout_ ID3D12Resource* output_resource) {
|
||||
// Copy the cpu memory into the gpu resource
|
||||
if (!upload_heap_ || upload_heap_->GetDesc().Width < buffer_size_in_bytes) {
|
||||
WINML_THROW_IF_FAILED(device_cache.GetD3D12Device()->CreateCommittedResource(
|
||||
|
|
|
@ -1344,7 +1344,7 @@ const WinmlAdapterApi* OnnxruntimeEngineFactory::UseWinmlAdapterApi() {
|
|||
return winml_adapter_api_;
|
||||
}
|
||||
|
||||
HRESULT OnnxruntimeEngineFactory::GetOrtEnvironment(OrtEnv** ort_env) {
|
||||
HRESULT OnnxruntimeEngineFactory::GetOrtEnvironment(_Out_ OrtEnv** ort_env) {
|
||||
RETURN_IF_FAILED(EnsureEnvironment());
|
||||
RETURN_IF_FAILED(environment_->GetOrtEnvironment(ort_env));
|
||||
return S_OK;
|
||||
|
@ -1356,7 +1356,7 @@ HRESULT OnnxruntimeEngineFactory::EnableDebugOutput(bool is_enabled) {
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT OnnxruntimeEngineFactory::CreateCustomRegistry(IMLOperatorRegistry** registry) {
|
||||
HRESULT OnnxruntimeEngineFactory::CreateCustomRegistry(_Out_ IMLOperatorRegistry** registry) {
|
||||
RETURN_HR_IF_NOT_OK_MSG(winml_adapter_api_->CreateCustomRegistry(registry),
|
||||
ort_api_);
|
||||
return S_OK;
|
||||
|
|
|
@ -111,7 +111,7 @@ class OnnxruntimeEngine : public Microsoft::WRL::RuntimeClass<
|
|||
(IInspectable* sequence, winml::TensorKind key_kind, winml::TensorKind value_kind, IValue* value) override;
|
||||
|
||||
STDMETHOD(GetSequenceOfTensorValues)
|
||||
(_winml::IValue* sequence_value, _Out_ std::vector<winrt::com_ptr<_winml::IValue>>& out_values) override;
|
||||
(_In_ _winml::IValue* sequence_value, _Out_ std::vector<winrt::com_ptr<_winml::IValue>>& out_values) override;
|
||||
|
||||
STDMETHOD(GetNumberOfIntraOpThreads)
|
||||
(uint32_t* num_threads) override;
|
||||
|
@ -140,7 +140,7 @@ class OnnxruntimeEngineFactory : public Microsoft::WRL::RuntimeClass<
|
|||
STDMETHOD(CreateModel)
|
||||
(_In_ void* data, _In_ size_t size, _Outptr_ IModel** out) override;
|
||||
STDMETHOD(CreateEngineBuilder)
|
||||
(IEngineBuilder** engine_builder) override;
|
||||
(_Outptr_ IEngineBuilder** engine_builder) override;
|
||||
STDMETHOD(EnableDebugOutput)
|
||||
(bool is_enabled) override;
|
||||
STDMETHOD(CreateCustomRegistry)
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
#include "OnnxruntimeErrors.h"
|
||||
using namespace _winml;
|
||||
|
||||
HRESULT OnnxruntimeEngineBuilder::RuntimeClassInitialize(OnnxruntimeEngineFactory* engine_factory) {
|
||||
HRESULT OnnxruntimeEngineBuilder::RuntimeClassInitialize(_In_ OnnxruntimeEngineFactory* engine_factory) {
|
||||
engine_factory_ = engine_factory;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::CreateEngine(_winml::IEngine** out) {
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::CreateEngine(_Outptr_ _winml::IEngine** out) {
|
||||
auto ort_api = engine_factory_->UseOrtApi();
|
||||
|
||||
Microsoft::WRL::ComPtr<IOrtSessionBuilder> onnxruntime_session_builder;
|
||||
|
@ -61,7 +61,7 @@ STDMETHODIMP OnnxruntimeEngineBuilder::CreateEngine(_winml::IEngine** out) {
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::GetD3D12Device(ID3D12Device** device) {
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::GetD3D12Device(_Outptr_ ID3D12Device** device) {
|
||||
*device = device_.Get();
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ STDMETHODIMP OnnxruntimeEngineBuilder::SetMetacommandsEnabled(int enabled) {
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::GetID3D12CommandQueue(ID3D12CommandQueue** queue) {
|
||||
STDMETHODIMP OnnxruntimeEngineBuilder::GetID3D12CommandQueue(_Outptr_ ID3D12CommandQueue** queue) {
|
||||
*queue = queue_.Get();
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ HRESULT CreateFeatureDescriptors(
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT ModelInfo::RuntimeClassInitialize(OnnxruntimeEngineFactory* engine_factory, OrtModel* ort_model) {
|
||||
HRESULT ModelInfo::RuntimeClassInitialize(_In_ OnnxruntimeEngineFactory* engine_factory, _In_ OrtModel* ort_model) {
|
||||
RETURN_HR_IF_NULL(E_INVALIDARG, ort_model);
|
||||
|
||||
const auto winml_adapter_api = engine_factory->UseWinmlAdapterApi();
|
||||
|
|
|
@ -24,25 +24,25 @@ IModelInfo : IUnknown {
|
|||
(int64_t * out) PURE;
|
||||
|
||||
STDMETHOD(GetModelMetadata)
|
||||
(ABI::Windows::Foundation::Collections::IMapView<HSTRING, HSTRING> * *metadata) PURE;
|
||||
(ABI::Windows::Foundation::Collections::IMapView<HSTRING, HSTRING> **metadata) PURE;
|
||||
|
||||
STDMETHOD(GetInputFeatures)
|
||||
(ABI::Windows::Foundation::Collections::IVectorView<winml::ILearningModelFeatureDescriptor> * *features) PURE;
|
||||
(ABI::Windows::Foundation::Collections::IVectorView<winml::ILearningModelFeatureDescriptor> **features) PURE;
|
||||
|
||||
STDMETHOD(GetOutputFeatures)
|
||||
(ABI::Windows::Foundation::Collections::IVectorView<winml::ILearningModelFeatureDescriptor> * *features) PURE;
|
||||
(ABI::Windows::Foundation::Collections::IVectorView<winml::ILearningModelFeatureDescriptor> **features) PURE;
|
||||
};
|
||||
|
||||
MIDL_INTERFACE("1b198b76-5c44-480d-837c-8433ca6eaf99")
|
||||
IModel : IUnknown {
|
||||
STDMETHOD(GetModelInfo)
|
||||
(IModelInfo * *info) PURE;
|
||||
(IModelInfo **info) PURE;
|
||||
|
||||
STDMETHOD(ModelEnsureNoFloat16)
|
||||
() PURE;
|
||||
|
||||
STDMETHOD(CloneModel)
|
||||
(IModel * *copy) PURE;
|
||||
(IModel **copy) PURE;
|
||||
};
|
||||
|
||||
using Resource = std::unique_ptr<void, std::function<void(void*)>>;
|
||||
|
@ -118,16 +118,16 @@ IEngine : IUnknown {
|
|||
(const char* const* data, size_t num_elements, const int64_t* shape, size_t count, _Out_ IValue** out) PURE;
|
||||
|
||||
STDMETHOD(CreateNullValue)
|
||||
(_Out_ IValue * *out) PURE;
|
||||
(_Out_ IValue **out) PURE;
|
||||
|
||||
STDMETHOD(CreateMapValue)
|
||||
(IInspectable * map, winml::TensorKind key_kind, winml::TensorKind value_kind, _Out_ IValue * *out) PURE;
|
||||
(IInspectable * map, winml::TensorKind key_kind, winml::TensorKind value_kind, _Out_ IValue **out) PURE;
|
||||
|
||||
STDMETHOD(CreateSequenceOfMapsValue)
|
||||
(IInspectable * sequence, winml::TensorKind key_kind, winml::TensorKind value_kind, _Out_ IValue * *out) PURE;
|
||||
(IInspectable * sequence, winml::TensorKind key_kind, winml::TensorKind value_kind, _Out_ IValue **out) PURE;
|
||||
|
||||
STDMETHOD(CreateSequenceOfValuesValue)
|
||||
(IValue ** values, size_t size, IValue * *out) PURE;
|
||||
(IValue ** values, size_t size, IValue **out) PURE;
|
||||
|
||||
STDMETHOD(CreateOneInputAcrossDevices)
|
||||
(const char* name, IValue* src, IValue** dest) PURE;
|
||||
|
@ -163,10 +163,10 @@ IEngineBuilder : IUnknown {
|
|||
(int enabled) PURE;
|
||||
|
||||
STDMETHOD(GetD3D12Device)
|
||||
(ID3D12Device * *device) PURE;
|
||||
(ID3D12Device **device) PURE;
|
||||
|
||||
STDMETHOD(GetID3D12CommandQueue)
|
||||
(ID3D12CommandQueue * *queue) PURE;
|
||||
(ID3D12CommandQueue **queue) PURE;
|
||||
|
||||
STDMETHOD(SetBatchSizeOverride)
|
||||
(uint32_t batch_size_override) PURE;
|
||||
|
@ -178,7 +178,7 @@ IEngineBuilder : IUnknown {
|
|||
(uint32_t intra_op_num_threads) PURE;
|
||||
|
||||
STDMETHOD(CreateEngine)
|
||||
(IEngine * *out) PURE;
|
||||
(IEngine **out) PURE;
|
||||
};
|
||||
|
||||
MIDL_INTERFACE("5eddd25a-70ad-46ef-a445-78fbaf792c2f")
|
||||
|
@ -190,13 +190,13 @@ IEngineFactory : IUnknown {
|
|||
(_In_ void* data, _In_ size_t size, _Outptr_ IModel** out) PURE;
|
||||
|
||||
STDMETHOD(CreateEngineBuilder)
|
||||
(IEngineBuilder * *engine_builder) PURE;
|
||||
(_Outptr_ IEngineBuilder **engine_builder) PURE;
|
||||
|
||||
STDMETHOD(EnableDebugOutput)
|
||||
(bool is_enabled) PURE;
|
||||
|
||||
STDMETHOD(CreateCustomRegistry)
|
||||
(_Out_ IMLOperatorRegistry * *registry) PURE;
|
||||
(_Out_ IMLOperatorRegistry **registry) PURE;
|
||||
};
|
||||
|
||||
} // namespace _winml
|
||||
|
|
Загрузка…
Ссылка в новой задаче