|
|
|
@ -21,22 +21,17 @@ cc_library(analysis SRCS
|
|
|
|
|
|
|
|
|
|
cc_test(test_dot SRCS dot_tester.cc DEPS analysis)
|
|
|
|
|
|
|
|
|
|
function (inference_analysis_test TARGET)
|
|
|
|
|
if(WITH_TESTING)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS ARGS EXTRA_DEPS)
|
|
|
|
|
cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
set(mem_opt "")
|
|
|
|
|
if(WITH_GPU)
|
|
|
|
|
set(mem_opt "--fraction_of_gpu_memory_to_use=0.5")
|
|
|
|
|
endif()
|
|
|
|
|
cc_test(${TARGET}
|
|
|
|
|
SRCS "${analysis_test_SRCS}"
|
|
|
|
|
DEPS analysis pass ${GLOB_PASS_LIB} ${analysis_test_EXTRA_DEPS}
|
|
|
|
|
ARGS --inference_model_dir=${PYTHON_TESTS_DIR}/book/word2vec.inference.model ${mem_opt} ${analysis_test_ARGS})
|
|
|
|
|
set_tests_properties(${TARGET} PROPERTIES DEPENDS test_word2vec)
|
|
|
|
|
endif(WITH_TESTING)
|
|
|
|
|
function(inference_analysis_test TARGET)
|
|
|
|
|
if(WITH_TESTING)
|
|
|
|
|
set(options "")
|
|
|
|
|
set(oneValueArgs "")
|
|
|
|
|
set(multiValueArgs SRCS ARGS EXTRA_DEPS)
|
|
|
|
|
cmake_parse_arguments(analysis_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
inference_base_test(${TARGET}
|
|
|
|
|
SRCS ${analysis_test_SRCS}
|
|
|
|
|
DEPS analysis pass ${GLOB_PASS_LIB} ${analysis_test_EXTRA_DEPS}
|
|
|
|
|
ARGS --inference_model_dir=${WORD2VEC_MODEL_DIR} ${analysis_test_ARGS})
|
|
|
|
|
endif()
|
|
|
|
|
endfunction(inference_analysis_test)
|
|
|
|
|
|
|
|
|
|
inference_analysis_test(test_analyzer SRCS analyzer_tester.cc EXTRA_DEPS paddle_inference_api)
|
|
|
|
|