CMakeLists.txt 1.8 KB
Newer Older
L
luotao1 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h)
file(WRITE ${pass_file} "// Generated by the paddle/fluid/framework/ir/CMakeLists.txt.  DO NOT EDIT!\n\n")
file(APPEND ${pass_file} "\#include \"paddle/fluid/framework/ir/pass.h\"\n")
function(pass_library TARGET)
    set(options "")
    set(oneValueArgs "")
    set(multiValueArgs SRCS DEPS)
    cmake_parse_arguments(op_library "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
    cc_library(${TARGET} SRCS ${TARGET}.cc DEPS graph_pattern_detector pass)
    file(APPEND ${pass_file} "USE_PASS(${TARGET});\n")
    set(PASS_LIBRARY ${TARGET} ${PASS_LIBRARY} PARENT_SCOPE)
endfunction()

Y
yuyang18 已提交
14
cc_library(node SRCS node.cc DEPS proto_desc)
D
Dang 已提交
15
cc_library(graph SRCS graph.cc DEPS node)
X
better  
Xin Pan 已提交
16
cc_library(graph_helper SRCS graph_helper.cc DEPS graph)
X
Xin Pan 已提交
17
cc_library(pass SRCS pass.cc DEPS graph node graph_helper)
18
cc_library(graph_traits SRCS graph_traits.cc DEPS graph)
L
luotao1 已提交
19
cc_library(graph_pattern_detector SRCS graph_pattern_detector.cc DEPS graph graph_helper graph_traits)
L
luotao1 已提交
20 21 22 23 24 25 26 27 28

pass_library(graph_to_program_pass)
pass_library(graph_viz_pass)
pass_library(fc_fuse_pass)
pass_library(attention_lstm_fuse_pass)
pass_library(infer_clean_graph_pass)
pass_library(fc_lstm_fuse_pass)
pass_library(seq_concat_fc_fuse_pass)
set(GLOB_PASS_LIB ${PASS_LIBRARY} CACHE INTERNAL "Global PASS library")
X
Xin Pan 已提交
29 30 31 32

cc_test(pass_test SRCS pass_test.cc DEPS graph pass graph_helper)
cc_test(graph_test SRCS graph_test.cc DEPS graph graph_helper op_registry)
cc_test(graph_helper_test SRCS graph_helper_test.cc DEPS graph graph_helper op_registry)
X
Xin Pan 已提交
33
cc_test(graph_to_program_pass_test SRCS graph_to_program_pass_test.cc DEPS graph_to_program_pass)
34
cc_test(test_graph_pattern_detector SRCS graph_pattern_detector_tester.cc DEPS graph_pattern_detector)
L
luotao1 已提交
35
cc_test(test_fc_fuse_pass SRCS fc_fuse_pass_tester.cc DEPS fc_fuse_pass framework_proto)