CMakeLists.txt 1.8 KB
Newer Older
1 2 3 4
cc_library(
  subgraph_util
  SRCS subgraph_util.cc
  DEPS subgraph_detector)
5

6 7 8 9
if(WITH_GPU AND TENSORRT_FOUND)
  cc_library(
    tensorrt_subgraph_pass
    SRCS tensorrt_subgraph_pass.cc
R
risemeup1 已提交
10 11
    DEPS convert_to_mixed_precision subgraph_util tensorrt_op_teller
         infer_io_utils)
12

13 14 15
  set(analysis_deps
      ${analysis_deps} subgraph_util tensorrt_subgraph_pass
      CACHE INTERNAL "")
16

17 18 19
  set(pass_file
      ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp
  )
20
  file(APPEND ${pass_file} "USE_PASS(tensorrt_subgraph_pass);\n")
21 22 23
  set(INFER_IR_PASSES
      ${INFER_IR_PASSES} tensorrt_subgraph_pass
      CACHE INTERNAL "")
24
endif()
25

26 27 28 29 30 31 32 33 34 35 36
if(WITH_LITE)
  cc_library(
    lite_subgraph_pass
    SRCS lite_subgraph_pass.cc
    DEPS ${analysis_deps} subgraph_util lite_op_teller)
  set(analysis_deps
      ${analysis_deps} subgraph_util lite_subgraph_pass
      CACHE INTERNAL "")
  set(pass_file
      ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp
  )
石晓伟 已提交
37
  file(APPEND ${pass_file} "USE_PASS(lite_subgraph_pass);\n")
38 39 40 41 42 43 44
  set(INFER_IR_PASSES
      ${INFER_IR_PASSES} lite_subgraph_pass
      CACHE INTERNAL "")
  cc_test(
    lite_subgraph_pass_tester
    SRCS lite_subgraph_pass_tester.cc
    DEPS lite_subgraph_pass gtest glog)
石晓伟 已提交
45
endif()
D
denglin-github 已提交
46

47
message("WITH_DLNNE:${WITH_DLNNE}")
D
denglin-github 已提交
48
if(WITH_DLNNE)
49 50 51 52 53 54 55
  cc_library(
    dlnne_subgraph_pass
    SRCS dlnne_subgraph_pass.cc
    DEPS ${analysis_deps} subgraph_util)
  set(analysis_deps
      ${analysis_deps} subgraph_util dlnne_subgraph_pass
      CACHE INTERNAL "")
D
denglin-github 已提交
56

57 58 59
  set(pass_file
      ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp
  )
D
denglin-github 已提交
60
  file(APPEND ${pass_file} "USE_PASS(dlnne_subgraph_pass);\n")
61 62 63
  set(INFER_IR_PASSES
      ${INFER_IR_PASSES} dlnne_subgraph_pass
      CACHE INTERNAL "")
D
denglin-github 已提交
64
endif()