CMakeLists.txt 2.2 KB
Newer Older
1
set(cxx_api_lite_deps scope_lite optimizer_lite target_wrapper_host model_parser_lite)
S
superjomn 已提交
2
if(LITE_WITH_CUDA)
3
    set(cxx_api_lite_deps ${cxx_api_lite_deps} kernels_cuda)
S
Superjomn 已提交
4 5
    cc_library(cxx_api_lite_cuda SRCS cxx_api.cc DEPS ${cxx_api_lite_deps} target_wrapper_cuda)
    nv_test(test_cxx_api_lite_cuda SRCS cxx_api_test.cc DEPS cxx_api_lite_cuda)
S
superjomn 已提交
6
endif()
S
Superjomn 已提交
7

S
update  
superjomn 已提交
8
cc_library(cxx_api_lite SRCS cxx_api.cc DEPS ${cxx_api_lite_deps} ${ops_lite})
S
Superjomn 已提交
9 10

set(light_api_deps
S
update  
superjomn 已提交
11
    scope_lite target_wrapper_host model_parser_lite)
S
Superjomn 已提交
12 13 14 15 16

if(LITE_WITH_CUDA)
    set(light_api_deps ${light_api_deps} target_wrapper_cuda)
endif()

S
update  
superjomn 已提交
17
#cc_library(light_api_lite SRCS light_api.cc DEPS ${light_api_deps} ${ops_lite} ${host_kernels})
S
Superjomn 已提交
18

S
update  
superjomn 已提交
19
message(STATUS "get ops ${ops_lite}")
20 21
message(STATUS "get Host kernels ${host_kernels}")
message(STATUS "get ARM kernels ${arm_kernels}")
S
superjomn 已提交
22 23 24 25 26 27

include(ExternalProject)
set(LITE_URL "http://paddle-inference-dist.bj.bcebos.com" CACHE STRING "inference download url")
set(LITE_DEMO_INSTALL_DIR "${THIRD_PARTY_PATH}/inference_demo" CACHE STRING
        "A path setting inference demo download directories.")

Y
Yan Chunwei 已提交
28 29
if((NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) AND WITH_TESTING)
    lite_cc_test(test_cxx_api_lite SRCS cxx_api_test.cc
30 31 32 33
       DEPS cxx_api_lite model_parser_lite target_wrapper_host
       ${ops_lite} ${host_kernels} ${x86_kernels}
       PROFILE_DEPS basic_profiler_lite
       ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model
Y
Yan Chunwei 已提交
34
            --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL)
Y
Yan Chunwei 已提交
35

Y
Yan Chunwei 已提交
36 37
    lite_download_and_uncompress(${LITE_MODEL_DIR} ${LITE_URL} "lite_naive_model.tar.gz")
    add_dependencies(test_cxx_api_lite extern_lite_download_lite_naive_model_tar_gz)
Y
Yan Chunwei 已提交
38
endif()
39 40 41

if(NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND WITH_TESTING)
    add_dependencies(test_cxx_api_lite extern_lite_download_lite_naive_model_tar_gz)
Y
Yan Chunwei 已提交
42
endif()
43 44 45 46

# if(NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
#     lite_cc_test(test_light_api SRCS light_api_test.cc DEPS light_api_lite ARGS --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL)
# endif()
47

Y
Yan Chunwei 已提交
48

Y
Yan Chunwei 已提交
49 50
lite_cc_binary(cxx_api_lite_bin SRCS cxx_api_bin.cc
    DEPS
51
    cxx_api_lite
Y
Yan Chunwei 已提交
52 53 54 55 56
    model_parser_lite
    target_wrapper_host
    mir_passes
    ${ops_lite} ${host_kernels}
    ARM_DEPS ${arm_kernels})