|
| 1 | +set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h) |
| 2 | +file(WRITE ${pass_file} "// Generated by the paddle/fluid/framework/ir/CMakeLists.txt. DO NOT EDIT!\n\n") |
| 3 | +file(APPEND ${pass_file} "\#include \"paddle/fluid/framework/ir/pass.h\"\n") |
| 4 | +function(pass_library TARGET) |
| 5 | + set(options "") |
| 6 | + set(oneValueArgs "") |
| 7 | + set(multiValueArgs SRCS DEPS) |
| 8 | + cmake_parse_arguments(op_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) |
| 9 | + cc_library(${TARGET} SRCS ${TARGET}.cc DEPS graph_pattern_detector pass) |
| 10 | + file(APPEND ${pass_file} "USE_PASS(${TARGET});\n") |
| 11 | + set(PASS_LIBRARY ${TARGET} ${PASS_LIBRARY} PARENT_SCOPE) |
| 12 | +endfunction() |
| 13 | + |
1 | 14 | cc_library(node SRCS node.cc DEPS proto_desc)
|
2 | 15 | cc_library(graph SRCS graph.cc DEPS node)
|
3 | 16 | cc_library(graph_helper SRCS graph_helper.cc DEPS graph)
|
4 | 17 | cc_library(pass SRCS pass.cc DEPS graph node graph_helper)
|
5 |
| -cc_library(graph_viz_pass SRCS graph_viz_pass.cc DEPS graph pass graph_helper) |
6 |
| -cc_library(graph_to_program_pass SRCS graph_to_program_pass.cc DEPS graph pass graph_helper) |
7 | 18 | cc_library(graph_traits SRCS graph_traits.cc DEPS graph)
|
8 |
| -cc_library(graph_pattern_detector SRCS graph_pattern_detector.cc DEPS graph graph_helper graph_traits) |
9 |
| -cc_library(fc_fuse_pass SRCS fc_fuse_pass.cc DEPS graph graph_pattern_detector) |
10 |
| -cc_library(attention_lstm_fuse_pass SRCS attention_lstm_fuse_pass.cc DEPS graph graph_pattern_detector) |
11 |
| -cc_library(infer_clean_graph_pass SRCS infer_clean_graph_pass.cc DEPS graph pass) |
12 |
| -cc_library(fc_lstm_fuse_pass SRCS fc_lstm_fuse_pass.cc DEPS graph graph_pattern_detector) |
13 |
| -cc_library(seq_concat_fc_fuse_pass SRCS seq_concat_fc_fuse_pass.cc DEPS graph graph_pattern_detector) |
| 19 | +cc_library(graph_pattern_detector SRCS graph_pattern_detector.cc DEPS graph graph_helper graph_traits gtest) |
| 20 | + |
| 21 | +pass_library(graph_to_program_pass) |
| 22 | +pass_library(graph_viz_pass) |
| 23 | +pass_library(fc_fuse_pass) |
| 24 | +pass_library(attention_lstm_fuse_pass) |
| 25 | +pass_library(infer_clean_graph_pass) |
| 26 | +pass_library(fc_lstm_fuse_pass) |
| 27 | +pass_library(seq_concat_fc_fuse_pass) |
| 28 | +set(GLOB_PASS_LIB ${PASS_LIBRARY} CACHE INTERNAL "Global PASS library") |
14 | 29 |
|
15 | 30 | cc_test(pass_test SRCS pass_test.cc DEPS graph pass graph_helper)
|
16 | 31 | cc_test(graph_test SRCS graph_test.cc DEPS graph graph_helper op_registry)
|
17 | 32 | cc_test(graph_helper_test SRCS graph_helper_test.cc DEPS graph graph_helper op_registry)
|
18 | 33 | cc_test(graph_to_program_pass_test SRCS graph_to_program_pass_test.cc DEPS graph_to_program_pass)
|
19 | 34 | cc_test(test_graph_pattern_detector SRCS graph_pattern_detector_tester.cc DEPS graph_pattern_detector)
|
20 |
| -cc_test(test_fc_fuse_pass SRCS fc_fuse_pass_tester.cc DEPS fc_fuse_pass graph_pattern_detector graph pass graph_traits framework_proto) |
21 |
| -set(GLOB_PASS_LIB fc_fuse_pass attention_lstm_fuse_pass infer_clean_graph_pass fc_lstm_fuse_pass seq_concat_fc_fuse_pass) |
| 35 | +cc_test(test_fc_fuse_pass SRCS fc_fuse_pass_tester.cc DEPS fc_fuse_pass framework_proto) |
0 commit comments