Исходный код СУБД 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include "adapter/pch.h"
 
#ifdef USE_DML
 
#include "abi_custom_registry_impl.h"
 
namespace Windows::AI::MachineLearning::Adapter {
 
HRESULT STDMETHODCALLTYPE AbiCustomRegistryImpl::RegisterOperatorSetSchema(
  const MLOperatorSetId* opSetId,
  int baseline_version,
  const MLOperatorSchemaDescription* const* schema,
  uint32_t schemaCount,
  _In_opt_ IMLOperatorTypeInferrer* typeInferrer,
  _In_opt_ IMLOperatorShapeInferrer* shapeInferrer
) const noexcept try {
#ifdef LAYERING_DONE
  for (uint32_t i = 0; i < schemaCount; ++i) {
    telemetry_helper.RegisterOperatorSetSchema(
      schema[i]->name,
      schema[i]->inputCount,
      schema[i]->outputCount,
      schema[i]->typeConstraintCount,
      schema[i]->attributeCount,
      schema[i]->defaultAttributeCount
    );
  }
#endif
 
  // Delegate to base class
  return AbiCustomRegistry::RegisterOperatorSetSchema(
    opSetId, baseline_version, schema, schemaCount, typeInferrer, shapeInferrer
  );
}
CATCH_RETURN();
 
HRESULT STDMETHODCALLTYPE AbiCustomRegistryImpl::RegisterOperatorKernel(
  const MLOperatorKernelDescription* opKernel,
  IMLOperatorKernelFactory* operatorKernelFactory,
  _In_opt_ IMLOperatorShapeInferrer* shapeInferrer
) const noexcept {
  return RegisterOperatorKernel(opKernel, operatorKernelFactory, shapeInferrer, nullptr, false, false, false);
}
 
HRESULT STDMETHODCALLTYPE AbiCustomRegistryImpl::RegisterOperatorKernel(
  const MLOperatorKernelDescription* opKernel,
  IMLOperatorKernelFactory* operatorKernelFactory,
  _In_opt_ IMLOperatorShapeInferrer* shapeInferrer,
  _In_opt_ IMLOperatorSupportQueryPrivate* supportQuery,
  bool isInternalOperator,
  bool supportsGraph,
  const uint32_t* requiredInputCountForGraph,
  _In_reads_(constantCpuInputCount) const uint32_t* requiredConstantCpuInputs,
  uint32_t constantCpuInputCount,
  _In_reads_(aliasCount) const std::pair<uint32_t, uint32_t>* aliases,
  uint32_t aliasCount
) const noexcept try {
#ifdef LAYERING_DONE
  // Log a custom op telemetry if the operator is not a built-in DML operator
  if (!isInternalOperator) {
    telemetry_helper.LogRegisterOperatorKernel(
      opKernel->name, opKernel->domain, static_cast<int>(opKernel->executionType)
    );
  }
#endif
 
  // Delegate to base class
  return AbiCustomRegistry::RegisterOperatorKernel(
    opKernel,
    operatorKernelFactory,
    shapeInferrer,
    supportQuery,
    isInternalOperator,
    supportsGraph,
    requiredInputCountForGraph,
    requiredConstantCpuInputs,
    constantCpuInputCount,
    aliases,
    aliasCount
  );
}
CATCH_RETURN();
 
}  // namespace Windows::AI::MachineLearning::Adapter
 
#endif USE_DML