forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpass_manager.cpp
44 lines (37 loc) · 1 KB
/
pass_manager.cpp
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
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include "engines_util/execute_tools.hpp"
#include "gtest/gtest.h"
#include "ngraph/graph_util.hpp"
#include "ngraph/ngraph.hpp"
#include "ngraph/pass/manager.hpp"
#include "util/test_tools.hpp"
using namespace ngraph;
using namespace std;
OPENVINO_SUPPRESS_DEPRECATED_START
TEST(pass_manager, add) {
pass::Manager pass_manager;
auto graph = make_test_graph();
size_t node_count = 0;
traverse_nodes(graph, [&](shared_ptr<Node> /* node */) {
node_count++;
});
pass_manager.run_passes(graph);
auto sorted = graph->get_ordered_ops();
EXPECT_EQ(node_count, sorted.size());
EXPECT_TRUE(validate_list(sorted));
}
namespace {
class DummyPass : public pass::FunctionPass {
public:
DummyPass() {}
bool run_on_function(std::shared_ptr<ngraph::Function> /* f */) override {
return false;
}
};
} // namespace