Исходный код СУБД 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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
#include "core/optimizer/graph_optimizer_registry.h"
#include "core/framework/compute_capability.h"
#include "core/graph/graph_viewer.h"
 
namespace onnxruntime {
static const std::string kConstantFoldingDQ = "ConstantFoldingDQ";
 
/**
 * Optimizer's selection function: Selects a set of nodes from a given graph for optimization. Additional key/value strings can be provided to configure the optimizer.
 *                                 If needed, use graph_optimizer_registry to access the session options, the CPU EP and the logger.
 *
 * Optimizer's optimization function: Gets the nodes in ComputeCapability from nodes_to_optimize. Use graph_optimizer_registry to access the session options, the CPU EP
 *                                    and the logger if needed to create the optimizer. Run optimization on the nodes/subgraph, and finally, update the ComputeCapability.
 *
 */
 
struct ConstantFoldingDQFuncs {
  static std::vector<std::unique_ptr<ComputeCapability>> Select(const GraphViewer& graph_viewer,
                                                                const KeyValueConfig& configs,
                                                                const GraphOptimizerRegistry& graph_optimizer_registry);
  static Status Optimize(Graph& graph,
                         const ComputeCapability& optimization_cc,
                         ComputeCapability& cc_to_update,
                         const GraphOptimizerRegistry& graph_optimizer_registry);
};
}  // namespace onnxruntime