CMakeLists.txt 2.2 KB
Newer Older
Y
Yan Chunwei 已提交
1 2 3 4
cc_library(analysis SRCS pass_manager.cc dot.cc node.cc data_flow_graph.cc graph_traits.cc subgraph_splitter.cc
  fluid_to_data_flow_graph_pass.cc
  data_flow_graph_to_fluid_pass.cc
  dfg_graphviz_draw_pass.cc
5 6 7 8
  tensorrt_subgraph_pass.cc
  tensorrt_subgraph_node_mark_pass.cc
  analyzer.cc
  helper.cc
Y
Yan Chunwei 已提交
9
        model_store_pass.cc
10
  DEPS framework_proto proto_desc)
11
cc_test(test_node SRCS node_tester.cc DEPS analysis gflags glog gtest)
12
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)
Y
Yan Chunwei 已提交
13
cc_binary(inference_analyzer SRCS analyzer_main.cc DEPS analysis)
14 15 16

set(PYTHON_TESTS_DIR ${PADDLE_BINARY_DIR}/python/paddle/fluid/tests)

Y
Yan Chunwei 已提交
17
function (inference_analysis_test TARGET)
S
update  
superjomn 已提交
18 19 20 21 22
    if(WITH_TESTING)
        set(options "")
        set(oneValueArgs "")
        set(multiValueArgs SRCS)
        cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
23

24 25 26 27
        set(mem_opt "")
        if(WITH_GPU)
            set(mem_opt "--fraction_of_gpu_memory_to_use=0.5")
        endif()
S
update  
superjomn 已提交
28 29 30
        cc_test(${TARGET}
                SRCS "${analysis_test_SRCS}"
                DEPS analysis
31
                ARGS --inference_model_dir=${PYTHON_TESTS_DIR}/book/word2vec.inference.model ${mem_opt})
S
update  
superjomn 已提交
32 33
        set_tests_properties(${TARGET} PROPERTIES DEPENDS test_word2vec)
    endif(WITH_TESTING)
Y
Yan Chunwei 已提交
34
endfunction(inference_analysis_test)
Y
Yan Chunwei 已提交
35

Y
Yan Chunwei 已提交
36 37 38 39 40
inference_analysis_test(test_data_flow_graph SRCS data_flow_graph_tester.cc)
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_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)
41
inference_analysis_test(test_tensorrt_subgraph_pass SRCS tensorrt_subgraph_pass_tester.cc)
Y
Yan Chunwei 已提交
42
inference_analysis_test(test_pass_manager SRCS pass_manager_tester.cc)
43 44
inference_analysis_test(test_tensorrt_subgraph_node_mark_pass SRCS tensorrt_subgraph_node_mark_pass_tester.cc)
inference_analysis_test(test_analyzer SRCS analyzer_tester.cc)
Y
Yan Chunwei 已提交
45
inference_analysis_test(test_model_store_pass SRCS model_store_pass_tester.cc)