CMakeLists.txt 1.5 KB
Newer Older
1 2 3 4 5
unset(analysis_deps CACHE)
set(analysis_deps # analysis_deps can be extended accross the project
        framework_proto proto_desc graph pass paddle_fluid_api executor pretty_log
        ir_pass_manager
        CACHE INTERNAL "")
6

7 8 9 10 11 12 13 14 15
add_subdirectory(ir_passes)
add_subdirectory(passes)

cc_library(ir_pass_manager SRCS ir_pass_manager.cc DEPS graph pass ${INFER_IR_PASSES})

cc_library(argument SRCS argument.cc DEPS scope proto_desc)
cc_library(analysis_pass SRCS analysis_pass.cc DEPS proto_desc)

cc_library(analysis SRCS
16 17
  analyzer.cc
  helper.cc
18 19 20
  analysis_pass
  DEPS ${analysis_deps}
  )
21

22 23
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)

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

L
luotao1 已提交
42
inference_analysis_test(test_analyzer SRCS analyzer_tester.cc EXTRA_DEPS paddle_inference_api)