CMakeLists.txt 1.6 KB
Newer Older
1
cc_library(subgraph_util SRCS subgraph_util.cc DEPS subgraph_detector)
2

Y
Yan Chunwei 已提交
3
if (WITH_GPU AND TENSORRT_FOUND)
4
  cc_library(tensorrt_subgraph_pass SRCS tensorrt_subgraph_pass.cc DEPS subgraph_util tensorrt_op_teller infer_io_utils)
5 6

  set(analysis_deps ${analysis_deps}
7
          subgraph_util tensorrt_subgraph_pass
8 9
          CACHE INTERNAL "")

10
  set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp)
11 12 13
  file(APPEND ${pass_file} "USE_PASS(tensorrt_subgraph_pass);\n")
  set(INFER_IR_PASSES ${INFER_IR_PASSES} tensorrt_subgraph_pass CACHE INTERNAL "")
endif()
14

石晓伟 已提交
15 16 17
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 "")
18
  set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp)
石晓伟 已提交
19 20 21 22
  file(APPEND ${pass_file} "USE_PASS(lite_subgraph_pass);\n")
  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)
endif()
D
denglin-github 已提交
23 24 25 26 27 28 29 30 31 32 33 34

MESSAGE("WITH_DLNNE:${WITH_DLNNE}")
if(WITH_DLNNE)
  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 "")

  set(pass_file ${PADDLE_BINARY_DIR}/paddle/fluid/inference/api/paddle_inference_pass.h.tmp)
  file(APPEND ${pass_file} "USE_PASS(dlnne_subgraph_pass);\n")
  set(INFER_IR_PASSES ${INFER_IR_PASSES} dlnne_subgraph_pass CACHE INTERNAL "")
endif()