Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "adapter/pch.h"
 
#include "winml_adapter_c_api.h"
#include "winml_adapter_apis.h"
#include "core/session/ort_apis.h"
 
#include <core/providers/winml/winml_provider_factory.h>
#include <core/providers/cpu/cpu_provider_factory.h>
 
const OrtApi* GetVersion1Api();
 
namespace winmla = Windows::AI::MachineLearning::Adapter;
 
static constexpr WinmlAdapterApi winml_adapter_api_1 = {
  // Schema override
  &winmla::OverrideSchema,
 
  // OrtEnv methods
  &winmla::EnvConfigureCustomLoggerAndProfiler,
 
  // OrtModel methods
  &winmla::CreateModelFromPath,
  &winmla::CreateModelFromData,
  &winmla::CloneModel,
  &winmla::ModelGetAuthor,
  &winmla::ModelGetName,
  &winmla::ModelSetName,
  &winmla::ModelGetDomain,
  &winmla::ModelGetDescription,
  &winmla::ModelGetVersion,
  &winmla::ModelGetInputCount,
  &winmla::ModelGetOutputCount,
  &winmla::ModelGetInputName,
  &winmla::ModelGetOutputName,
  &winmla::ModelGetInputDescription,
  &winmla::ModelGetOutputDescription,
  &winmla::ModelGetInputTypeInfo,
  &winmla::ModelGetOutputTypeInfo,
  &winmla::ModelGetMetadataCount,
  &winmla::ModelGetMetadata,
  &winmla::ModelEnsureNoFloat16,
  &winmla::SaveModel,
 
  // OrtSessionOptions methods
  &OrtSessionOptionsAppendExecutionProvider_CPU,
  &winmla::OrtSessionOptionsAppendExecutionProviderEx_DML,
 
  // OrtSession methods
  &winmla::CreateSessionWithoutModel,
  &winmla::SessionGetExecutionProvider,
  &winmla::SessionInitialize,
  &winmla::SessionRegisterGraphTransformers,
  &winmla::SessionRegisterCustomRegistry,
  &winmla::SessionLoadAndPurloinModel,
  &winmla::SessionStartProfiling,
  &winmla::SessionEndProfiling,
  &winmla::SessionCopyOneInputAcrossDevices,
  &winmla::SessionGetNumberOfIntraOpThreads,
  &winmla::SessionGetIntraOpThreadSpinning,
  &winmla::SessionGetNamedDimensionsOverrides,
 
  // Dml methods (TODO need to figure out how these need to move to session somehow...)
  &winmla::DmlExecutionProviderFlushContext,
  &winmla::DmlExecutionProviderReleaseCompletedReferences,
  &winmla::DmlCopyTensor,
 
  &winmla::GetProviderMemoryInfo,
  &winmla::GetProviderAllocator,
  &winmla::FreeProviderAllocator,
 
  &winmla::ExecutionProviderSync,
 
  &winmla::CreateCustomRegistry,
 
  &winmla::ValueGetDeviceId,
  &winmla::SessionGetInputRequiredDeviceId,
 
  &winmla::CreateTensorTypeInfo,
  &winmla::CreateSequenceTypeInfo,
  &winmla::CreateMapTypeInfo,
  &winmla::CreateModel,
  &winmla::ModelAddInput,
  &winmla::ModelAddConstantInput,
  &winmla::ModelAddOutput,
  &winmla::ModelAddOperator,
  &winmla::ModelGetOpsetVersion,
  &winmla::OperatorGetNumInputs,
  &winmla::OperatorGetInputName,
  &winmla::OperatorGetNumOutputs,
  &winmla::OperatorGetOutputName,
  &winmla::JoinModels,
  &winmla::CreateThreadPool,
 
  // Release
  &winmla::ReleaseModel,
  &winmla::ReleaseThreadPool,
};
 
const WinmlAdapterApi* ORT_API_CALL OrtGetWinMLAdapter(_In_ uint32_t ort_version) NO_EXCEPTION {
  if (ort_version >= 2) {
    return &winml_adapter_api_1;
  }
 
  return nullptr;
}