Исходный код СУБД 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#include "runtime_path_test_shared_library.h"
 
#include <exception>
#include <iostream>
 
#include "core/platform/env.h"
#include "core/common/logging/logging.h"
#include "core/platform/logging/make_platform_default_log_sink.h"
 
namespace {
 
std::basic_string<PATH_CHAR_T> InitializeAndGetRuntimePath() {
  using namespace onnxruntime;
 
  const bool default_filter_user_data = false;
  const std::string default_logger_id = "DefaultLogger";
  auto logging_manager = logging::LoggingManager(logging::MakePlatformDefaultLogSink(),
                                                 logging::Severity::kVERBOSE,
                                                 default_filter_user_data,
                                                 logging::LoggingManager::InstanceType::Default,
                                                 &default_logger_id);
 
  auto runtime_path = Env::Default().GetRuntimePath();
 
  return runtime_path;
}
 
}  // namespace
 
extern "C" const PATH_CHAR_T* OrtTestGetSharedLibraryRuntimePath(void) {
#if !defined(ORT_NO_EXCEPTIONS)
  try {
#endif
 
    static const auto runtime_path = InitializeAndGetRuntimePath();
    return runtime_path.c_str();
 
#if !defined(ORT_NO_EXCEPTIONS)
  } catch (const std::exception& e) {
    std::cerr << __FUNCTION__ << " - caught exception: " << e.what() << "\n";
    return nullptr;
  }
#endif
}