Исходный код СУБД 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
 
#include "core/framework/sequential_execution_plan.h"
#include "core/framework/stream_execution_context.h"
 
namespace onnxruntime {
 
class SessionScope;
 
class BarrierStep : public SequentialExecutionPlan::ExecutionStep {
 public:
  BarrierStep(size_t id, NodeIndex node_index);
 
  Status Execute(StreamExecutionContext& ctx,
                 size_t /*stream_idx*/,
                 SessionScope& /*session_scope*/,
                 const bool& /*terminate_flag*/,
                 bool& continue_flag) override;
 
  std::string ToString() const override;
 
 private:
  size_t barrier_id_{0};
};
 
class WaitOnEPStep : public SequentialExecutionPlan::ExecutionStep {
 public:
  WaitOnEPStep(WaitNotificationFn handle, NotificationIndex idx, NodeIndex node_index);
 
  Status Execute(StreamExecutionContext& ctx,
                 size_t stream_idx,
                 SessionScope& /*session_scope*/,
                 const bool& /*terminate_flag*/,
                 bool& continue_flag) override;
 
  std::string ToString() const override;
 
 private:
  WaitNotificationFn wait_fn_;
  NotificationIndex notification_idx_;
};
 
class LaunchKernelStep : public SequentialExecutionPlan::ExecutionStep {
 public:
#if defined(ORT_MINIMAL_BUILD)
  LaunchKernelStep(NodeIndex index);
#else
  LaunchKernelStep(NodeIndex index, std::string_view node_name);
#endif
 
  Status Execute(StreamExecutionContext& ctx,
                 size_t stream_idx,
                 SessionScope& session_scope,
                 const bool& terminate_flag,
                 bool& continue_flag) override;
 
  std::string ToString() const override;
 
#if !defined(ORT_MINIMAL_BUILD)
 private:
  std::string node_name_;
#endif
};
 
class ActivateNotificationStep : public SequentialExecutionPlan::ExecutionStep {
 public:
  ActivateNotificationStep(NotificationIndex notification_index, NodeIndex node_index);
 
  Status Execute(StreamExecutionContext& ctx,
                 size_t stream_idx,
                 SessionScope& /*session_scope*/,
                 const bool& /*terminate_flag*/,
                 bool& continue_flag) override;
 
  virtual std::string ToString() const override;
 
 private:
  NotificationIndex notification_idx_;
};
 
class TriggerDownstreamStep : public SequentialExecutionPlan::ExecutionStep {
 public:
  TriggerDownstreamStep(size_t trigger_point_index, NodeIndex node_index);
  Status Execute(StreamExecutionContext& ctx,
                 size_t /*stream_idx*/,
                 SessionScope& session_scope,
                 const bool& terminate_flag,
                 bool& continue_flag) override;
 
  virtual std::string ToString() const override;
 
 private:
  size_t trigger_point_index_;
};
}  // namespace onnxruntime