CMakeLists.txt 2.6 KB
Newer Older
1
cc_library(ir_pass_manager SRCS ir_pass_manager.cc DEPS graph pass)
2
set(analysis_deps
3
        framework_proto proto_desc ir_pass_manager graph pass paddle_fluid_api executor pretty_log)
4 5

cc_library(analysis SRCS pass_manager.cc node.cc data_flow_graph.cc graph_traits.cc subgraph_splitter.cc
6 7 8
  analyzer.cc
  helper.cc
  # passes
X
Xin Pan 已提交
9
  analysis_pass.cc
Y
Yan Chunwei 已提交
10 11 12
  fluid_to_data_flow_graph_pass.cc
  data_flow_graph_to_fluid_pass.cc
  dfg_graphviz_draw_pass.cc
13 14
  tensorrt_subgraph_pass.cc
  tensorrt_subgraph_node_mark_pass.cc
15 16
  fluid_to_ir_pass.cc
  model_store_pass.cc
17
  DEPS ${analysis_deps})
18 19

cc_test(test_node SRCS node_tester.cc DEPS analysis)
20
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)
21
cc_binary(inference_analyzer SRCS analyzer_main.cc DEPS analysis paddle_fluid)
22

P
peizhilin 已提交
23 24 25 26
if(WIN32)
    target_link_libraries(inference_analyzer shlwapi)
endif(WIN32)

Y
Yan Chunwei 已提交
27
function (inference_analysis_test TARGET)
S
update  
superjomn 已提交
28 29 30
    if(WITH_TESTING)
        set(options "")
        set(oneValueArgs "")
T
tensor-tang 已提交
31
        set(multiValueArgs SRCS ARGS EXTRA_DEPS)
S
update  
superjomn 已提交
32
        cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
33 34 35 36
        set(mem_opt "")
        if(WITH_GPU)
            set(mem_opt "--fraction_of_gpu_memory_to_use=0.5")
        endif()
S
update  
superjomn 已提交
37 38
        cc_test(${TARGET}
                SRCS "${analysis_test_SRCS}"
L
luotao1 已提交
39
                DEPS analysis pass ${GLOB_PASS_LIB} ${analysis_test_EXTRA_DEPS}
T
tensor-tang 已提交
40
                ARGS --inference_model_dir=${PYTHON_TESTS_DIR}/book/word2vec.inference.model ${mem_opt} ${analysis_test_ARGS})
S
update  
superjomn 已提交
41 42
        set_tests_properties(${TARGET} PROPERTIES DEPENDS test_word2vec)
    endif(WITH_TESTING)
Y
Yan Chunwei 已提交
43
endfunction(inference_analysis_test)
Y
Yan Chunwei 已提交
44

L
luotao1 已提交
45
inference_analysis_test(test_analyzer SRCS analyzer_tester.cc EXTRA_DEPS paddle_inference_api)
Y
Yan Chunwei 已提交
46
inference_analysis_test(test_data_flow_graph SRCS data_flow_graph_tester.cc)
L
luotao1 已提交
47 48
inference_analysis_test(test_data_flow_graph_to_fluid_pass SRCS data_flow_graph_to_fluid_pass_tester.cc)
inference_analysis_test(test_fluid_to_ir_pass SRCS fluid_to_ir_pass_tester.cc)
Y
Yan Chunwei 已提交
49 50 51
inference_analysis_test(test_fluid_to_data_flow_graph_pass SRCS fluid_to_data_flow_graph_pass_tester.cc)
inference_analysis_test(test_subgraph_splitter SRCS subgraph_splitter_tester.cc)
inference_analysis_test(test_dfg_graphviz_draw_pass SRCS dfg_graphviz_draw_pass_tester.cc)
52
inference_analysis_test(test_tensorrt_subgraph_pass SRCS tensorrt_subgraph_pass_tester.cc)
Y
Yan Chunwei 已提交
53
inference_analysis_test(test_pass_manager SRCS pass_manager_tester.cc)
54
inference_analysis_test(test_tensorrt_subgraph_node_mark_pass SRCS tensorrt_subgraph_node_mark_pass_tester.cc)
Y
Yan Chunwei 已提交
55
inference_analysis_test(test_model_store_pass SRCS model_store_pass_tester.cc)