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

6 7 8 9 10
if(WITH_GPU AND TENSORRT_FOUND)
  cc_library(
    tensorrt_subgraph_pass
    SRCS tensorrt_subgraph_pass.cc
    DEPS subgraph_util tensorrt_op_teller infer_io_utils)
11

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

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

25 26 27 28 29 30 31 32 33 34 35
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
  )
石晓伟 已提交
36
  file(APPEND ${pass_file} "USE_PASS(lite_subgraph_pass);\n")
37 38 39 40 41 42 43
  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)
石晓伟 已提交
44
endif()
D
denglin-github 已提交
45

46
message("WITH_DLNNE:${WITH_DLNNE}")
D
denglin-github 已提交
47
if(WITH_DLNNE)
48 49 50 51 52 53 54
  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 已提交
55

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