-
Notifications
You must be signed in to change notification settings - Fork 313
Expand file tree
/
Copy pathExecutionProvider.h
More file actions
42 lines (34 loc) · 1.42 KB
/
ExecutionProvider.h
File metadata and controls
42 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE.md in the repo root for license information.
#pragma once
//
// Execution Provider Header
//
// Wrapper for Windows ML execution provider ABI interfaces.
// Provides a clean C++ interface for working with execution providers.
//
#include <wrl/client.h>
#include <string>
#include "Microsoft.Windows.AI.MachineLearning.h"
namespace CppAbiEPEnumerationSample
{
/// <summary>
/// Wrapper for an execution provider instance
/// Encapsulates the complexity of ABI interface interactions
/// </summary>
class ExecutionProvider {
public:
// Constructor
explicit ExecutionProvider(Microsoft::WRL::ComPtr<ABI::Microsoft::Windows::AI::MachineLearning::IExecutionProvider> provider);
// Provider information methods
std::wstring GetName() const;
std::wstring GetDescription() const;
ABI::Microsoft::Windows::AI::MachineLearning::ExecutionProviderReadyState GetReadyState() const;
std::wstring GetReadyStateString(ABI::Microsoft::Windows::AI::MachineLearning::ExecutionProviderReadyState state) const;
// Provider operations
bool EnsureReadyAsync() const;
bool TryRegister() const;
private:
Microsoft::WRL::ComPtr<ABI::Microsoft::Windows::AI::MachineLearning::IExecutionProvider> m_provider;
};
} // namespace CppAbiEPEnumerationSample