CMakeLists.txt 2.5 KB
Newer Older
C
Chunwei 已提交
1 2
set(cxx_api_lite_deps
  scope_lite optimizer_lite target_wrapper_host model_parser_lite program_lite)
S
superjomn 已提交
3
if(LITE_WITH_CUDA)
4
    set(cxx_api_lite_deps ${cxx_api_lite_deps} kernels_cuda)
S
Superjomn 已提交
5 6
    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 已提交
7
endif()
S
Superjomn 已提交
8

C
Chunwei 已提交
9 10 11 12 13 14 15
lite_cc_library(lite_api_test_helper SRCS lite_api_test_helper.cc
  DEPS scope_lite optimizer_lite target_wrapper_host model_parser_lite program_lite
       ${ops_lite} ${host_kernels}
  CUDA_DEPS kernels_cuda
  X86_DEPS ${x86_kernels}
  )
lite_cc_library(cxx_api_lite SRCS cxx_api.cc DEPS lite_api_test_helper)
S
Superjomn 已提交
16 17

set(light_api_deps
C
Chunwei 已提交
18
    scope_lite target_wrapper_host model_parser_lite program_lite)
S
Superjomn 已提交
19 20 21 22 23

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

C
Chunwei 已提交
24 25 26
lite_cc_library(light_api_lite SRCS light_api.cc
  DEPS ${light_api_deps} ${ops_lite} ${host_kernels}
  )
S
Superjomn 已提交
27

S
update  
superjomn 已提交
28
message(STATUS "get ops ${ops_lite}")
29 30
message(STATUS "get Host kernels ${host_kernels}")
message(STATUS "get ARM kernels ${arm_kernels}")
S
superjomn 已提交
31 32 33 34 35

include(ExternalProject)
set(LITE_DEMO_INSTALL_DIR "${THIRD_PARTY_PATH}/inference_demo" CACHE STRING
        "A path setting inference demo download directories.")

Y
Yan Chunwei 已提交
36 37
if((NOT LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) AND WITH_TESTING)
    lite_cc_test(test_cxx_api_lite SRCS cxx_api_test.cc
Z
Zhen Wang 已提交
38
       DEPS cxx_api_lite mir_passes
39 40
       ${ops_lite} ${host_kernels} ${x86_kernels}
       ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model
Y
Yan Chunwei 已提交
41 42
            --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL)
    add_dependencies(test_cxx_api_lite extern_lite_download_lite_naive_model_tar_gz)
Y
Yan Chunwei 已提交
43
endif()
44 45


C
Chunwei 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
# These tests needs CLI arguments, and is not supported in ARM CI.
# TODO(Superjomn) support latter.
if(NOT LITE_ON_MOBILE)
    lite_cc_test(test_light_api SRCS light_api_test.cc
      DEPS light_api_lite mir_passes
      X86_DEPS ${x86_kernels}
      ARGS --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt
      SERIAL)

    lite_cc_test(test_apis_lite SRCS apis_test.cc
      DEPS cxx_api_lite light_api_lite ${ops_lite} mir_passes
      X86_DEPS ${x86_kernels}
      ARGS --model_dir=${LITE_MODEL_DIR}/lite_naive_model
          --optimized_model=${LITE_MODEL_DIR}/lite_naive_model_opt SERIAL)
endif()
61

Y
Yan Chunwei 已提交
62 63
lite_cc_binary(cxx_api_lite_bin SRCS cxx_api_bin.cc
    DEPS
64
    cxx_api_lite
Y
Yan Chunwei 已提交
65 66 67 68 69
    model_parser_lite
    target_wrapper_host
    mir_passes
    ${ops_lite} ${host_kernels}
    ARM_DEPS ${arm_kernels})