Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include <string>
#include <unordered_map>
#include <vector>
#include <atomic>
#include "core/common/status.h"
#include "core/common/path_string.h"
#include "core/framework/session_options.h"
#include "core/session/onnxruntime_c_api.h"
#include "core/providers/providers.h"
 
struct OrtSessionOptions {
  onnxruntime::SessionOptions value;
 
  std::vector<OrtCustomOpDomain*> custom_op_domains_;
  std::vector<std::shared_ptr<onnxruntime::IExecutionProviderFactory>> provider_factories;
  OrtSessionOptions() = default;
  ~OrtSessionOptions();
  OrtSessionOptions(const OrtSessionOptions& other);
  OrtSessionOptions& operator=(const OrtSessionOptions& other);
 
  const onnxruntime::ConfigOptions& GetConfigOptions() const noexcept;
 
  void GetEpContextDataCallbacks(_Out_ OrtReadNamedBufferFunc* read_func, _Out_ void** read_state,
                                 _Out_ OrtWriteNamedBufferFunc* write_func, _Out_ void** write_state) const noexcept;
 
  // Adds the given provider options to the session config options using an EP-specific key prefix.
  // Most EPs use "ep.<lowercase_provider_name>.<PROVIDER_OPTION_KEY>".
  onnxruntime::Status AddProviderOptionsToConfigOptions(
      const std::unordered_map<std::string, std::string>& provider_options, const char* provider_name);
 
#if !defined(ORT_MINIMAL_BUILD) || defined(ORT_MINIMAL_BUILD_CUSTOM_OPS)
  onnxruntime::Status RegisterCustomOpsLibrary(onnxruntime::PathString library_name);
#endif
 
  // get the EP prefix to used when an EP specific option is added to config_options.
  // e.g. for EP called 'MyEP' an options 'device_id' would be added as 'ep.myep.device_id'
  //      with GetProviderOptionPrefix returning 'ep.myep.'
  // CUDAExecutionProvider uses the stable short prefix 'ep.cuda.'.
  static std::string GetProviderOptionPrefix(const char* provider_name);
 
  // Weightless source model buffer for EPContext sessions.
  // Set via SessionOptionsSetWeightlessSourceModelBuffer.
  const void* weightless_source_model_data = nullptr;
  size_t weightless_source_model_data_size = 0;
};