Исходный код СУБД 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
51
52
53
54
55
56
57
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
#include "test/perftest/test_configuration.h"
#include <core/session/onnxruntime_cxx_api.h>
#include <memory>
#include <optional>
#include <vector>
 
namespace onnxruntime {
namespace perftest {
namespace utils {
 
size_t GetPeakWorkingSetSize();
 
class ICPUUsage {
 public:
  virtual ~ICPUUsage() = default;
 
  virtual short GetUsage() const = 0;
 
  virtual void Reset() = 0;
};
 
std::unique_ptr<ICPUUsage> CreateICPUUsage();
 
std::vector<std::string> ConvertArgvToUtf8Strings(int argc, ORTCHAR_T* argv[]);
 
std::vector<char*> CStringsFromStrings(std::vector<std::string>& utf8_args);
 
void RegisterExecutionProviderLibrary(Ort::Env& env, PerformanceTestConfig& test_config);
 
void UnregisterExecutionProviderLibrary(Ort::Env& env, PerformanceTestConfig& test_config);
 
void ListEpDevices(const Ort::Env& env);
 
// Returns the OrtEpDevice instances that were added to the session.
std::vector<Ort::ConstEpDevice> AppendPluginExecutionProviders(Ort::Env& env,
                                                               Ort::SessionOptions& session_options,
                                                               const PerformanceTestConfig& test_config);
 
bool UsesNvidiaDevice(Ort::Env& env, const PerformanceTestConfig& test_config);
 
struct PluginEpAllocatorSelection {
  Ort::UnownedAllocator allocator;
  bool is_host_accessible = false;
};
 
// Preference order: default (device) allocator, then host accessible allocator, then nullopt
// (caller falls back to the CPU allocator).
std::optional<PluginEpAllocatorSelection> GetPluginEpAllocator(Ort::Env& env,
                                                               const std::vector<Ort::ConstEpDevice>& ep_devices);
 
}  // namespace utils
}  // namespace perftest
}  // namespace onnxruntime